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

            if (rowsCount > 0)
            {
                Hownet.Model.ProduceSellInfo model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Hownet.Model.ProduceSellInfo();
                    if (dt.Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = int.Parse(dt.Rows[n]["ID"].ToString());
                    }
                    if (dt.Rows[n]["MainID"].ToString() != "")
                    {
                        model.MainID = int.Parse(dt.Rows[n]["MainID"].ToString());
                    }
                    if (dt.Rows[n]["MaterielID"].ToString() != "")
                    {
                        model.MaterielID = int.Parse(dt.Rows[n]["MaterielID"].ToString());
                    }
                    if (dt.Rows[n]["ColorID"].ToString() != "")
                    {
                        model.ColorID = int.Parse(dt.Rows[n]["ColorID"].ToString());
                    }
                    if (dt.Rows[n]["ColorOneID"].ToString() != "")
                    {
                        model.ColorOneID = int.Parse(dt.Rows[n]["ColorOneID"].ToString());
                    }
                    if (dt.Rows[n]["ColorTwoID"].ToString() != "")
                    {
                        model.ColorTwoID = int.Parse(dt.Rows[n]["ColorTwoID"].ToString());
                    }
                    if (dt.Rows[n]["SizeID"].ToString() != "")
                    {
                        model.SizeID = int.Parse(dt.Rows[n]["SizeID"].ToString());
                    }
                    if (dt.Rows[n]["Amount"].ToString() != "")
                    {
                        model.Amount = decimal.Parse(dt.Rows[n]["Amount"].ToString());
                    }
                    if (dt.Rows[n]["BrandID"].ToString() != "")
                    {
                        model.BrandID = int.Parse(dt.Rows[n]["BrandID"].ToString());
                    }
                    if (dt.Rows[n]["MListID"].ToString() != "")
                    {
                        model.MListID = int.Parse(dt.Rows[n]["MListID"].ToString());
                    }
                    if (dt.Rows[n]["SalesInfoID"].ToString() != "")
                    {
                        model.SalesInfoID = int.Parse(dt.Rows[n]["SalesInfoID"].ToString());
                    }
                    else
                    {
                        model.SalesInfoID = 0;
                    }
                    if (dt.Rows[n]["MeasureID"].ToString() != "")
                    {
                        model.MeasureID = int.Parse(dt.Rows[n]["MeasureID"].ToString());
                    }
                    else
                    {
                        model.MeasureID = 0;
                    }
                    if (dt.Rows[n]["SelesID"].ToString() != "")
                    {
                        model.SelesID = int.Parse(dt.Rows[n]["SelesID"].ToString());
                    }
                    else
                    {
                        model.SelesID = 0;
                    }
                    if (dt.Rows[n]["RepertoryListID"] != null && dt.Rows[n]["RepertoryListID"].ToString() != "")
                    {
                        model.RepertoryListID = int.Parse(dt.Rows[n]["RepertoryListID"].ToString());
                    }
                    if (dt.Rows[n]["RepertoryID"] != null && dt.Rows[n]["RepertoryID"].ToString() != "")
                    {
                        model.RepertoryID = int.Parse(dt.Rows[n]["RepertoryID"].ToString());
                    }
                    if (dt.Rows[n]["PSOID"] != null && dt.Rows[n]["PSOID"].ToString() != "")
                    {
                        model.PSOID = int.Parse(dt.Rows[n]["PSOID"].ToString());
                    }
                    model.A = int.Parse(dt.Rows[n]["A"].ToString());
                    modelList.Add(model);
                }
            }
            return(modelList);
        }