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

            if (rowsCount > 0)
            {
                TSM.Model.pms_Product_Batch model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new TSM.Model.pms_Product_Batch();
                    if (dt.Rows[n]["ProductBatchID"].ToString() != "")
                    {
                        model.ProductBatchID = int.Parse(dt.Rows[n]["ProductBatchID"].ToString());
                    }
                    model.ProductBatchName = dt.Rows[n]["ProductBatchName"].ToString();
                    if (dt.Rows[n]["BisnessContactID"].ToString() != "")
                    {
                        model.BisnessContactID = int.Parse(dt.Rows[n]["BisnessContactID"].ToString());
                    }
                    if (dt.Rows[n]["QualityContactID"].ToString() != "")
                    {
                        model.QualityContactID = int.Parse(dt.Rows[n]["QualityContactID"].ToString());
                    }
                    if (dt.Rows[n]["CustomerInfoID"].ToString() != "")
                    {
                        model.CustomerInfoID = int.Parse(dt.Rows[n]["CustomerInfoID"].ToString());
                    }
                    if (dt.Rows[n]["FinalCustInfoID"].ToString() != "")
                    {
                        model.FinalCustInfoID = int.Parse(dt.Rows[n]["FinalCustInfoID"].ToString());
                    }
                    if (dt.Rows[n]["ProductDate"].ToString() != "")
                    {
                        model.ProductDate = DateTime.Parse(dt.Rows[n]["ProductDate"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
示例#2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(TSM.Model.pms_Product_Batch model)
 {
     dal.Update(model);
 }
示例#3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(TSM.Model.pms_Product_Batch model)
 {
     return(dal.Add(model));
 }