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

            if (rowsCount > 0)
            {
                for (int i = 0; i < rowsCount; i++)
                {
                    Chain.Model.MicroWebsiteGoodsClass model = new Chain.Model.MicroWebsiteGoodsClass();
                    if (dt.Rows[i]["MicroGoodsClassID"] != null && dt.Rows[i]["MicroGoodsClassID"].ToString() != "")
                    {
                        model.MicroGoodsClassID = int.Parse(dt.Rows[i]["MicroGoodsClassID"].ToString());
                    }
                    if (dt.Rows[i]["MicroGoodsClassName"] != null && dt.Rows[i]["MicroGoodsClassName"].ToString() != "")
                    {
                        model.MicroGoodsClassName = dt.Rows[i]["MicroGoodsClassName"].ToString();
                    }
                    if (dt.Rows[i]["MicroGoodsClassRemark"] != null && dt.Rows[i]["MicroGoodsClassRemark"].ToString() != "")
                    {
                        model.MicroGoodsClassRemark = dt.Rows[i]["MicroGoodsClassRemark"].ToString();
                    }
                    if (dt.Rows[i]["MicroGoodsClassShopID"] != null && dt.Rows[i]["MicroGoodsClassShopID"].ToString() != "")
                    {
                        model.MicroGoodsClassShopID = int.Parse(dt.Rows[i]["MicroGoodsClassShopID"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Beispiel #2
0
 public bool Update(Chain.Model.MicroWebsiteGoodsClass model)
 {
     return(this.dal.Update(model));
 }
Beispiel #3
0
 public int Add(Chain.Model.MicroWebsiteGoodsClass model)
 {
     return(this.dal.Add(model));
 }