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

            if (rowsCount > 0)
            {
                Hownet.Model.WMSInventoryInfo model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Hownet.Model.WMSInventoryInfo();
                    if (dt.Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = int.Parse(dt.Rows[n]["ID"].ToString());
                    }
                    else
                    {
                        model.ID = 0;
                    }
                    if (dt.Rows[n]["MainID"].ToString() != "")
                    {
                        model.MainID = int.Parse(dt.Rows[n]["MainID"].ToString());
                    }
                    else
                    {
                        model.MainID = 0;
                    }
                    if (dt.Rows[n]["MaterielID"].ToString() != "")
                    {
                        model.MaterielID = int.Parse(dt.Rows[n]["MaterielID"].ToString());
                    }
                    else
                    {
                        model.MaterielID = 0;
                    }
                    if (dt.Rows[n]["BrandID"].ToString() != "")
                    {
                        model.BrandID = int.Parse(dt.Rows[n]["BrandID"].ToString());
                    }
                    else
                    {
                        model.BrandID = 0;
                    }
                    if (dt.Rows[n]["ColorID"].ToString() != "")
                    {
                        model.ColorID = int.Parse(dt.Rows[n]["ColorID"].ToString());
                    }
                    else
                    {
                        model.ColorID = 0;
                    }
                    if (dt.Rows[n]["ColorOneID"].ToString() != "")
                    {
                        model.ColorOneID = int.Parse(dt.Rows[n]["ColorOneID"].ToString());
                    }
                    else
                    {
                        model.ColorOneID = 0;
                    }
                    if (dt.Rows[n]["ColorTwoID"].ToString() != "")
                    {
                        model.ColorTwoID = int.Parse(dt.Rows[n]["ColorTwoID"].ToString());
                    }
                    else
                    {
                        model.ColorTwoID = 0;
                    }
                    if (dt.Rows[n]["SizeID"].ToString() != "")
                    {
                        model.SizeID = int.Parse(dt.Rows[n]["SizeID"].ToString());
                    }
                    else
                    {
                        model.SizeID = 0;
                    }
                    if (dt.Rows[n]["MeasureID"].ToString() != "")
                    {
                        model.MeasureID = int.Parse(dt.Rows[n]["MeasureID"].ToString());
                    }
                    else
                    {
                        model.MeasureID = 0;
                    }
                    if (dt.Rows[n]["PreviousNumber"].ToString() != "")
                    {
                        model.PreviousNumber = decimal.Parse(dt.Rows[n]["PreviousNumber"].ToString());
                    }
                    else
                    {
                        model.PreviousNumber = 0;
                    }
                    if (dt.Rows[n]["NowAmount"].ToString() != "")
                    {
                        model.NowAmount = decimal.Parse(dt.Rows[n]["NowAmount"].ToString());
                    }
                    else
                    {
                        model.NowAmount = 0;
                    }
                    if (dt.Rows[n]["ChangeAmount"].ToString() != "")
                    {
                        model.ChangeAmount = decimal.Parse(dt.Rows[n]["ChangeAmount"].ToString());
                    }
                    else
                    {
                        model.ChangeAmount = 0;
                    }
                    model.Remark = dt.Rows[n]["Remark"].ToString();
                    if (dt.Rows[n]["CompanyID"].ToString() != "")
                    {
                        model.CompanyID = int.Parse(dt.Rows[n]["CompanyID"].ToString());
                    }
                    else
                    {
                        model.CompanyID = 0;
                    }
                    if (dt.Rows[n]["MListID"].ToString() != "")
                    {
                        model.MListID = int.Parse(dt.Rows[n]["MListID"].ToString());
                    }
                    else
                    {
                        model.MListID = 0;
                    }
                    if (dt.Rows[n]["RepertoryID"].ToString() != "")
                    {
                        model.RepertoryID = int.Parse(dt.Rows[n]["RepertoryID"].ToString());
                    }
                    else
                    {
                        model.RepertoryID = 0;
                    }
                    model.A = int.Parse(dt.Rows[n]["A"].ToString());
                    modelList.Add(model);
                }
            }
            return(modelList);
        }