/// <summary> /// 获得数据列表 /// </summary> public List <LPWeb.Model.RegionExecutives> DataTableToList(DataTable dt) { List <LPWeb.Model.RegionExecutives> modelList = new List <LPWeb.Model.RegionExecutives>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { LPWeb.Model.RegionExecutives model; for (int n = 0; n < rowsCount; n++) { model = new LPWeb.Model.RegionExecutives(); if (dt.Rows[n]["RegionId"].ToString() != "") { model.RegionId = int.Parse(dt.Rows[n]["RegionId"].ToString()); } if (dt.Rows[n]["ExecutiveId"].ToString() != "") { model.ExecutiveId = int.Parse(dt.Rows[n]["ExecutiveId"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(LPWeb.Model.RegionExecutives model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(LPWeb.Model.RegionExecutives model) { dal.Add(model); }