Example #1
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(Hownet.Model.Pack2DepotInfo model)
 {
     return(dal.Add(model));
 }
Example #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Hownet.Model.Pack2DepotInfo model)
 {
     return(dal.Update(model));
 }
Example #3
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <Hownet.Model.Pack2DepotInfo> DataTableToList(DataTable dt)
        {
            List <Hownet.Model.Pack2DepotInfo> modelList = new List <Hownet.Model.Pack2DepotInfo>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                Hownet.Model.Pack2DepotInfo model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Hownet.Model.Pack2DepotInfo();
                    if (dt.Rows[n]["ID"] != null && dt.Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = int.Parse(dt.Rows[n]["ID"].ToString());
                    }
                    if (dt.Rows[n]["MainID"] != null && dt.Rows[n]["MainID"].ToString() != "")
                    {
                        model.MainID = int.Parse(dt.Rows[n]["MainID"].ToString());
                    }
                    if (dt.Rows[n]["TaskID"] != null && dt.Rows[n]["TaskID"].ToString() != "")
                    {
                        model.TaskID = int.Parse(dt.Rows[n]["TaskID"].ToString());
                    }
                    if (dt.Rows[n]["MaterielID"] != null && dt.Rows[n]["MaterielID"].ToString() != "")
                    {
                        model.MaterielID = int.Parse(dt.Rows[n]["MaterielID"].ToString());
                    }
                    if (dt.Rows[n]["ColorID"] != null && dt.Rows[n]["ColorID"].ToString() != "")
                    {
                        model.ColorID = int.Parse(dt.Rows[n]["ColorID"].ToString());
                    }
                    if (dt.Rows[n]["SizeID"] != null && dt.Rows[n]["SizeID"].ToString() != "")
                    {
                        model.SizeID = int.Parse(dt.Rows[n]["SizeID"].ToString());
                    }
                    if (dt.Rows[n]["ColorOneID"] != null && dt.Rows[n]["ColorOneID"].ToString() != "")
                    {
                        model.ColorOneID = int.Parse(dt.Rows[n]["ColorOneID"].ToString());
                    }
                    if (dt.Rows[n]["ColorTwoID"] != null && dt.Rows[n]["ColorTwoID"].ToString() != "")
                    {
                        model.ColorTwoID = int.Parse(dt.Rows[n]["ColorTwoID"].ToString());
                    }
                    if (dt.Rows[n]["MListID"] != null && dt.Rows[n]["MListID"].ToString() != "")
                    {
                        model.MListID = int.Parse(dt.Rows[n]["MListID"].ToString());
                    }
                    if (dt.Rows[n]["PackAmount"] != null && dt.Rows[n]["PackAmount"].ToString() != "")
                    {
                        model.PackAmount = decimal.Parse(dt.Rows[n]["PackAmount"].ToString());
                    }
                    if (dt.Rows[n]["NowAmount"] != null && dt.Rows[n]["NowAmount"].ToString() != "")
                    {
                        model.NowAmount = decimal.Parse(dt.Rows[n]["NowAmount"].ToString());
                    }
                    model.Remark = dt.Rows[n]["Remark"].ToString();
                    if (dt.Rows[n]["BrandID"] != null && dt.Rows[n]["BrandID"].ToString() != "")
                    {
                        model.BrandID = int.Parse(dt.Rows[n]["BrandID"].ToString());
                    }
                    if (dt.Rows[n]["MeasureID"] != null && dt.Rows[n]["MeasureID"].ToString() != "")
                    {
                        model.MeasureID = int.Parse(dt.Rows[n]["MeasureID"].ToString());
                    }
                    if (dt.Rows[n]["PackAmountID"] != null && dt.Rows[n]["PackAmountID"].ToString() != "")
                    {
                        model.PackAmountID = int.Parse(dt.Rows[n]["PackAmountID"].ToString());
                    }
                    if (dt.Rows[n]["DepotMeasureID"] != null && dt.Rows[n]["DepotMeasureID"].ToString() != "")
                    {
                        model.DepotMeasureID = int.Parse(dt.Rows[n]["DepotMeasureID"].ToString());
                    }
                    if (dt.Rows[n]["DepotBrandID"] != null && dt.Rows[n]["DepotBrandID"].ToString() != "")
                    {
                        model.DepotBrandID = int.Parse(dt.Rows[n]["DepotBrandID"].ToString());
                    }
                    if (dt.Rows[n]["DepotInfoID"] != null && dt.Rows[n]["DepotInfoID"].ToString() != "")
                    {
                        model.DepotInfoID = int.Parse(dt.Rows[n]["DepotInfoID"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }