Пример #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <TSM.Model.pms_Product_Mater> DataTableToList(DataTable dt)
        {
            List <TSM.Model.pms_Product_Mater> modelList = new List <TSM.Model.pms_Product_Mater>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                TSM.Model.pms_Product_Mater model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new TSM.Model.pms_Product_Mater();
                    if (dt.Rows[n]["ProductMaterID"].ToString() != "")
                    {
                        model.ProductMaterID = int.Parse(dt.Rows[n]["ProductMaterID"].ToString());
                    }
                    model.ProductMater = dt.Rows[n]["ProductMater"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Пример #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(TSM.Model.pms_Product_Mater model)
 {
     dal.Update(model);
 }
Пример #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(TSM.Model.pms_Product_Mater model)
 {
     return(dal.Add(model));
 }