Esempio n. 1
0
        public List <Chain.Model.ProductClass> DataTableToList(DataTable dt)
        {
            List <Chain.Model.ProductClass> modelList = new List <Chain.Model.ProductClass>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                for (int i = 0; i < rowsCount; i++)
                {
                    Chain.Model.ProductClass model = new Chain.Model.ProductClass();
                    if (dt.Rows[i]["ClassID"] != null && dt.Rows[i]["ClassID"].ToString() != "")
                    {
                        model.ClassID = int.Parse(dt.Rows[i]["ClassID"].ToString());
                    }
                    if (dt.Rows[i]["ClassName"] != null && dt.Rows[i]["ClassName"].ToString() != "")
                    {
                        model.ClassName = dt.Rows[i]["ClassName"].ToString();
                    }
                    if (dt.Rows[i]["ClassRemark"] != null && dt.Rows[i]["ClassRemark"].ToString() != "")
                    {
                        model.ClassRemark = dt.Rows[i]["ClassRemark"].ToString();
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Esempio n. 2
0
 public bool Update(Chain.Model.ProductClass model)
 {
     return(this.dal.Update(model));
 }
Esempio n. 3
0
 public int Add(Chain.Model.ProductClass model)
 {
     return(this.dal.Add(model));
 }