Web/Admin/Products/Edit.aspx.cs

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using cosmos.Web.UI;
using Maticsoft.Common;

namespace cosmos.Web.Admin.Products
{
    public partial class Edit : ManagePage
    {
        public int Id;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!int.TryParse(Request.Params["id"] as string, out this.Id))
            {
                JscriptMsg(350, 230, "错误提示", "<b>出现错误!</b>您要修改的信息不存在或参数不正确。", "back", "Error");
                return;
            }
            if (!Page.IsPostBack)
            {
                //绑定类别
                ChannelTreeBind(0, "所有类别", 1, this.ddlClassId);
                //绑定类别
                ShowInfo(this.Id);
            }
        }

        #region 赋值操作
        private void ShowInfo(int _id)
        {
            cosmos.BLL.ProductInfo bll = new cosmos.BLL.ProductInfo();
            cosmos.Model.ProductInfo model = bll.GetModel(_id);

            this.txtTitle.Text = model.Title;
            ddlClassId.SelectedValue = model.ClassId.ToString();
            this.txtImgUrl.Text = model.ImgUrl;
            ckeditor.Text = cosmos.Common.Utils.ToTxt(model.Content);
            this.txtPubTime.Text = string.Format("{0:d}", model.PubTime);
            this.txtClick.Text = model.Click.ToString();
            this.txtSortId.Text = model.SortId.ToString();
            if (model.IsTop == 1)
            {
                cblItem.Items[0].Selected = true;
            }
            if (model.IsLock == 1)
            {
                cblItem.Items[1].Selected = true;
            }
        }
        #endregion

        #region 编辑产品
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";
            if (!PageValidate.IsDateTime(txtPubTime.Text))
后面还有 67 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。