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

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