Exemple #1
0
        public List <Chain.Model.ProductCenter> DataTableToList(DataTable dt)
        {
            List <Chain.Model.ProductCenter> modelList = new List <Chain.Model.ProductCenter>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                for (int i = 0; i < rowsCount; i++)
                {
                    Chain.Model.ProductCenter model = new Chain.Model.ProductCenter();
                    if (dt.Rows[i]["ProductID"] != null && dt.Rows[i]["ProductID"].ToString() != "")
                    {
                        model.ProductID = int.Parse(dt.Rows[i]["ProductID"].ToString());
                    }
                    if (dt.Rows[i]["ProductName"] != null && dt.Rows[i]["ProductName"].ToString() != "")
                    {
                        model.ProductName = dt.Rows[i]["ProductName"].ToString();
                    }
                    if (dt.Rows[i]["ProductPhoto"] != null && dt.Rows[i]["ProductPhoto"].ToString() != "")
                    {
                        model.ProductPhoto = dt.Rows[i]["ProductPhoto"].ToString();
                    }
                    if (dt.Rows[i]["ProductDesc"] != null && dt.Rows[i]["ProductDesc"].ToString() != "")
                    {
                        model.ProductDesc = dt.Rows[i]["ProductDesc"].ToString();
                    }
                    if (dt.Rows[i]["ProductCreateTime"] != null && dt.Rows[i]["ProductCreateTime"].ToString() != "")
                    {
                        model.ProductCreateTime = new DateTime?(DateTime.Parse(dt.Rows[i]["ProductCreateTime"].ToString()));
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemple #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         if (base.Request.QueryString["ProductID"] != null)
         {
             int ProductID = int.Parse(base.Request.QueryString["ProductID"]);
             Chain.BLL.ProductCenter   bllProduct   = new Chain.BLL.ProductCenter();
             Chain.Model.ProductCenter modelProduct = bllProduct.GetModel(ProductID);
             this.txtProductDesc.Value       = modelProduct.ProductDesc;
             this.txtProductName.Value       = modelProduct.ProductName;
             this.txtProductRemark.Value     = modelProduct.ProductRemark;
             this.imgProductPhoto.Src        = modelProduct.ProductPhoto.ToString();
             this.txtUpdateProductName.Value = modelProduct.ProductPhoto;
             this.txtProductID.Value         = ProductID.ToString();
             this.sltClassID.Value           = modelProduct.ClassID.ToString();
             this.ltlTitle.Text = "微官网   >   产品管理   >   产品编辑 ";
         }
         else
         {
             this.ltlTitle.Text = "微官网   >   产品管理   >   产品新增 ";
         }
         this.BindClassInfo(this.sltClassID);
     }
 }
Exemple #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         if (base.Request.QueryString["ProductID"] != null)
         {
             int ProductID = int.Parse(base.Request.QueryString["ProductID"]);
             Chain.BLL.ProductCenter   bllProduct   = new Chain.BLL.ProductCenter();
             Chain.Model.ProductCenter modelProduct = bllProduct.GetModel(ProductID);
             this.spProductDesc.InnerHtml = modelProduct.ProductDesc;
         }
     }
 }
Exemple #4
0
 public bool Update(Chain.Model.ProductCenter model)
 {
     return(this.dal.Update(model));
 }
Exemple #5
0
 public int Add(Chain.Model.ProductCenter model)
 {
     return(this.dal.Add(model));
 }