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

            if (rowsCount > 0)
            {
                TSM.Model.pms_Customer_Require model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new TSM.Model.pms_Customer_Require();
                    if (dt.Rows[n]["CustomerRequireID"].ToString() != "")
                    {
                        model.CustomerRequireID = int.Parse(dt.Rows[n]["CustomerRequireID"].ToString());
                    }
                    model.CustomerRequire = dt.Rows[n]["CustomerRequire"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Esempio n. 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(TSM.Model.pms_Customer_Require model)
 {
     dal.Update(model);
 }
Esempio n. 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(TSM.Model.pms_Customer_Require model)
 {
     return(dal.Add(model));
 }