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