/// <summary> /// 获得数据列表 /// </summary> public List <tdps.Model.SPXX> DataTableToList(DataTable dt) { List <tdps.Model.SPXX> modelList = new List <tdps.Model.SPXX>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { tdps.Model.SPXX model; for (int n = 0; n < rowsCount; n++) { model = new tdps.Model.SPXX(); model.SPHM = dt.Rows[n]["SPHM"].ToString(); model.NSRSBH = dt.Rows[n]["NSRSBH"].ToString(); model.NSRMC = dt.Rows[n]["NSRMC"].ToString(); model.NSRSWJGDM = dt.Rows[n]["NSRSWJGDM"].ToString(); model.NSRSWJGMC = dt.Rows[n]["NSRSWJGMC"].ToString(); model.SSSQ_Q = dt.Rows[n]["SSSQ_Q"].ToString(); model.SSSQ_Z = dt.Rows[n]["SSSQ_Z"].ToString(); if (dt.Rows[n]["SL"].ToString() != "") { model.SL = decimal.Parse(dt.Rows[n]["SL"].ToString()); } model.KSSL = dt.Rows[n]["KSSL"].ToString(); model.JKSJ = dt.Rows[n]["JKSJ"].ToString(); if (dt.Rows[n]["SJJE"].ToString() != "") { model.SJJE = decimal.Parse(dt.Rows[n]["SJJE"].ToString()); } model.ZSXMDM = dt.Rows[n]["ZSXMDM"].ToString(); model.ZSXMMC = dt.Rows[n]["ZSXMMC"].ToString(); model.ZSPMDM = dt.Rows[n]["ZSPMDM"].ToString(); model.ZSPMMC = dt.Rows[n]["ZSPMMC"].ToString(); model.JYLXDM = dt.Rows[n]["JYLXDM"].ToString(); model.JYLXMC = dt.Rows[n]["JYLXMC"].ToString(); model.PZZLDM = dt.Rows[n]["PZZLDM"].ToString(); model.PZZLMC = dt.Rows[n]["PZZLMC"].ToString(); model.YHZH = dt.Rows[n]["YHZH"].ToString(); model.BZ = dt.Rows[n]["BZ"].ToString(); model.WSPZH = dt.Rows[n]["WSPZH"].ToString(); model.ZSSWJGDM = dt.Rows[n]["ZSSWJGDM"].ToString(); model.ZSSWJGMC = dt.Rows[n]["ZSSWJGMC"].ToString(); model.WSZKJSJ = dt.Rows[n]["WSZKJSJ"].ToString(); modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(tdps.Model.SPXX model) { dal.Update(model); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(tdps.Model.SPXX model, object trans) { dal.Update(model, trans); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(tdps.Model.SPXX model) { dal.Add(model); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(tdps.Model.SPXX model, object trans) { dal.Add(model, trans); }