コード例 #1
0
        public List <Chain.Model.GoodsAllotDetail> DataTableToList(DataTable dt)
        {
            List <Chain.Model.GoodsAllotDetail> modelList = new List <Chain.Model.GoodsAllotDetail>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                for (int i = 0; i < rowsCount; i++)
                {
                    Chain.Model.GoodsAllotDetail model = new Chain.Model.GoodsAllotDetail();
                    if (dt.Rows[i]["AllotDetailID"] != null && dt.Rows[i]["AllotDetailID"].ToString() != "")
                    {
                        model.AllotDetailID = int.Parse(dt.Rows[i]["AllotDetailID"].ToString());
                    }
                    if (dt.Rows[i]["AllotDetailAllotID"] != null && dt.Rows[i]["AllotDetailAllotID"].ToString() != "")
                    {
                        model.AllotDetailAllotID = int.Parse(dt.Rows[i]["AllotDetailAllotID"].ToString());
                    }
                    if (dt.Rows[i]["AllotDetailGoodsID"] != null && dt.Rows[i]["AllotDetailGoodsID"].ToString() != "")
                    {
                        model.AllotDetailGoodsID = int.Parse(dt.Rows[i]["AllotDetailGoodsID"].ToString());
                    }
                    if (dt.Rows[i]["AllotDetailNumber"] != null && dt.Rows[i]["AllotDetailNumber"].ToString() != "")
                    {
                        model.AllotDetailNumber = decimal.Parse(dt.Rows[i]["AllotDetailNumber"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
コード例 #2
0
 public bool Updates(Chain.Model.GoodsAllotDetail model)
 {
     return(this.dal.Updates(model));
 }
コード例 #3
0
 public int Add(Chain.Model.GoodsAllotDetail model)
 {
     return(this.dal.Add(model));
 }