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