/// <summary> /// 获得数据列表 /// </summary> public List<cfs.Model.OT_PAPERDETAIL> DataTableToList(DataTable dt) { List<cfs.Model.OT_PAPERDETAIL> modelList = new List<cfs.Model.OT_PAPERDETAIL>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { cfs.Model.OT_PAPERDETAIL model; for (int n = 0; n < rowsCount; n++) { model = new cfs.Model.OT_PAPERDETAIL(); if(dt.Rows[n]["PD_ID"]!=null && dt.Rows[n]["PD_ID"].ToString()!="") { model.PD_ID=dt.Rows[n]["PD_ID"].ToString(); } if(dt.Rows[n]["PD_SID"]!=null && dt.Rows[n]["PD_SID"].ToString()!="") { model.PD_SID=dt.Rows[n]["PD_SID"].ToString(); } if(dt.Rows[n]["PD_QID"]!=null && dt.Rows[n]["PD_QID"].ToString()!="") { model.PD_QID=dt.Rows[n]["PD_QID"].ToString(); } if(dt.Rows[n]["PD_NUM"]!=null && dt.Rows[n]["PD_NUM"].ToString()!="") { model.PD_NUM=int.Parse(dt.Rows[n]["PD_NUM"].ToString()); } if(dt.Rows[n]["PD_POINT"]!=null && dt.Rows[n]["PD_POINT"].ToString()!="") { model.PD_POINT=decimal.Parse(dt.Rows[n]["PD_POINT"].ToString()); } modelList.Add(model); } } return modelList; }
/// <summary> /// 获得数据列表 /// </summary> public List <cfs.Model.OT_PAPERDETAIL> DataTableToList(DataTable dt) { List <cfs.Model.OT_PAPERDETAIL> modelList = new List <cfs.Model.OT_PAPERDETAIL>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { cfs.Model.OT_PAPERDETAIL model; for (int n = 0; n < rowsCount; n++) { model = new cfs.Model.OT_PAPERDETAIL(); if (dt.Rows[n]["PD_ID"] != null && dt.Rows[n]["PD_ID"].ToString() != "") { model.PD_ID = dt.Rows[n]["PD_ID"].ToString(); } if (dt.Rows[n]["PD_SID"] != null && dt.Rows[n]["PD_SID"].ToString() != "") { model.PD_SID = dt.Rows[n]["PD_SID"].ToString(); } if (dt.Rows[n]["PD_QID"] != null && dt.Rows[n]["PD_QID"].ToString() != "") { model.PD_QID = dt.Rows[n]["PD_QID"].ToString(); } if (dt.Rows[n]["PD_NUM"] != null && dt.Rows[n]["PD_NUM"].ToString() != "") { model.PD_NUM = int.Parse(dt.Rows[n]["PD_NUM"].ToString()); } if (dt.Rows[n]["PD_POINT"] != null && dt.Rows[n]["PD_POINT"].ToString() != "") { model.PD_POINT = decimal.Parse(dt.Rows[n]["PD_POINT"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(cfs.Model.OT_PAPERDETAIL model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(cfs.Model.OT_PAPERDETAIL model) { return(dal.Add(model)); }