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