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