Esempio n. 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <DTcms.Model.StoreOutGoods> DataTableToList(DataTable dt)
        {
            List <DTcms.Model.StoreOutGoods> modelList = new List <DTcms.Model.StoreOutGoods>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                DTcms.Model.StoreOutGoods model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new DTcms.Model.StoreOutGoods();
                    if (dt.Rows[n]["StoreOutOrderId"].ToString() != "")
                    {
                        model.StoreOutOrderId = int.Parse(dt.Rows[n]["StoreOutOrderId"].ToString());
                    }
                    if (dt.Rows[n]["Id"].ToString() != "")
                    {
                        model.Id = int.Parse(dt.Rows[n]["Id"].ToString());
                    }
                    if (dt.Rows[n]["GoodsId"].ToString() != "")
                    {
                        model.GoodsId = int.Parse(dt.Rows[n]["GoodsId"].ToString());
                    }
                    if (dt.Rows[n]["StoreInOrderId"].ToString() != "")
                    {
                        model.StoreInOrderId = int.Parse(dt.Rows[n]["StoreInOrderId"].ToString());
                    }
                    if (dt.Rows[n]["StoreInGoodsStoreInOrderId"].ToString() != "")
                    {
                        model.StoreInGoodsStoreInOrderId = int.Parse(dt.Rows[n]["StoreInGoodsStoreInOrderId"].ToString());
                    }
                    if (dt.Rows[n]["StoreInGoodsId"].ToString() != "")
                    {
                        model.StoreInGoodsId = int.Parse(dt.Rows[n]["StoreInGoodsId"].ToString());
                    }
                    model.Remark = dt.Rows[n]["Remark"].ToString();
                    if (dt.Rows[n]["StoringOutTime"].ToString() != "")
                    {
                        model.StoringOutTime = DateTime.Parse(dt.Rows[n]["StoringOutTime"].ToString());
                    }
                    if (dt.Rows[n]["FactStoringOutTime"].ToString() != "")
                    {
                        model.FactStoringOutTime = DateTime.Parse(dt.Rows[n]["FactStoringOutTime"].ToString());
                    }
                    if (dt.Rows[n]["Status"].ToString() != "")
                    {
                        model.Status = int.Parse(dt.Rows[n]["Status"].ToString());
                    }
                    if (dt.Rows[n]["Count"].ToString() != "")
                    {
                        model.Count = decimal.Parse(dt.Rows[n]["Count"].ToString());
                    }


                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Esempio n. 2
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<DTcms.Model.StoreOutGoods> DataTableToList(DataTable dt)
        {
            List<DTcms.Model.StoreOutGoods> modelList = new List<DTcms.Model.StoreOutGoods>();
            int rowsCount = dt.Rows.Count;
            if (rowsCount > 0)
            {
                DTcms.Model.StoreOutGoods model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new DTcms.Model.StoreOutGoods();
                    if (dt.Rows[n]["Id"].ToString() != "")
                    {
                        model.Id = int.Parse(dt.Rows[n]["Id"].ToString());
                    }
                    if (dt.Rows[n]["StoreOutOrderId"].ToString() != "")
                    {
                        model.StoreOutOrderId = int.Parse(dt.Rows[n]["StoreOutOrderId"].ToString());
                    }
                    if (dt.Rows[n]["StoreInOrderId"].ToString() != "")
                    {
                        model.StoreInOrderId = int.Parse(dt.Rows[n]["StoreInOrderId"].ToString());
                    }
                    if (dt.Rows[n]["StoreInGoodsId"].ToString() != "")
                    {
                        model.StoreInGoodsId = int.Parse(dt.Rows[n]["StoreInGoodsId"].ToString());
                    }
                    if (dt.Rows[n]["Status"].ToString() != "")
                    {
                        model.Status = int.Parse(dt.Rows[n]["Status"].ToString());
                    }
                    if (dt.Rows[n]["Count"].ToString() != "")
                    {
                        model.Count = decimal.Parse(dt.Rows[n]["Count"].ToString());
                    }

                    modelList.Add(model);
                }
            }
            return modelList;
        }
Esempio n. 3
0
 public void AddStoreOutGoods(StoreOutGoods storeOutGoods)
 {
     _storeOutGoods.Add(storeOutGoods);
 }
Esempio n. 4
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(DTcms.Model.StoreOutGoods model)
 {
     return(dal.Update(model));
 }
Esempio n. 5
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void  Add(DTcms.Model.StoreOutGoods model)
 {
     dal.Add(model);
 }
Esempio n. 6
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(DTcms.Model.StoreOutGoods model)
 {
     return(dal.Add(model));
 }
Esempio n. 7
0
 public void AddStoreOutGoods(StoreOutGoods storeOutGoods)
 {
     _storeOutGoods.Add(storeOutGoods);
 }