示例#1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <TSM.Model.CK_TakeGoods> DataTableToList(DataTable dt)
        {
            List <TSM.Model.CK_TakeGoods> modelList = new List <TSM.Model.CK_TakeGoods>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                TSM.Model.CK_TakeGoods model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new TSM.Model.CK_TakeGoods();
                    if (dt.Rows[n]["CK_TakeGoodsID"].ToString() != "")
                    {
                        model.CK_TakeGoodsID = int.Parse(dt.Rows[n]["CK_TakeGoodsID"].ToString());
                    }
                    if (dt.Rows[n]["CK_PeopleID"].ToString() != "")
                    {
                        model.CK_PeopleID = int.Parse(dt.Rows[n]["CK_PeopleID"].ToString());
                    }
                    if (dt.Rows[n]["CK_ProductID"].ToString() != "")
                    {
                        model.CK_ProductID = int.Parse(dt.Rows[n]["CK_ProductID"].ToString());
                    }
                    model.CK_TakeGoodsNo = dt.Rows[n]["CK_TakeGoodsNo"].ToString();
                    if (dt.Rows[n]["CK_TakeGoodsAmount"].ToString() != "")
                    {
                        model.CK_TakeGoodsAmount = int.Parse(dt.Rows[n]["CK_TakeGoodsAmount"].ToString());
                    }
                    if (dt.Rows[n]["CK_TakeGoodsDate"].ToString() != "")
                    {
                        model.CK_TakeGoodsDate = DateTime.Parse(dt.Rows[n]["CK_TakeGoodsDate"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
示例#2
0
 /// <summary>
 /// ��������б�
 /// </summary>
 public List<TSM.Model.CK_TakeGoods> DataTableToList(DataTable dt)
 {
     List<TSM.Model.CK_TakeGoods> modelList = new List<TSM.Model.CK_TakeGoods>();
     int rowsCount = dt.Rows.Count;
     if (rowsCount > 0)
     {
         TSM.Model.CK_TakeGoods model;
         for (int n = 0; n < rowsCount; n++)
         {
             model = new TSM.Model.CK_TakeGoods();
             if(dt.Rows[n]["CK_TakeGoodsID"].ToString()!="")
             {
                 model.CK_TakeGoodsID=int.Parse(dt.Rows[n]["CK_TakeGoodsID"].ToString());
             }
             if(dt.Rows[n]["CK_PeopleID"].ToString()!="")
             {
                 model.CK_PeopleID=int.Parse(dt.Rows[n]["CK_PeopleID"].ToString());
             }
             if(dt.Rows[n]["CK_ProductID"].ToString()!="")
             {
                 model.CK_ProductID=int.Parse(dt.Rows[n]["CK_ProductID"].ToString());
             }
             model.CK_TakeGoodsNo=dt.Rows[n]["CK_TakeGoodsNo"].ToString();
             if(dt.Rows[n]["CK_TakeGoodsAmount"].ToString()!="")
             {
                 model.CK_TakeGoodsAmount=int.Parse(dt.Rows[n]["CK_TakeGoodsAmount"].ToString());
             }
             if(dt.Rows[n]["CK_TakeGoodsDate"].ToString()!="")
             {
                 model.CK_TakeGoodsDate=DateTime.Parse(dt.Rows[n]["CK_TakeGoodsDate"].ToString());
             }
             modelList.Add(model);
         }
     }
     return modelList;
 }
示例#3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(TSM.Model.CK_TakeGoods model)
 {
     dal.Update(model);
 }
示例#4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(TSM.Model.CK_TakeGoods model)
 {
     return(dal.Add(model));
 }