/// <summary> /// 获得数据列表 /// </summary> public List <jdgl_res_head_service.Model.Yxy_sc_xz_sj> DataTableToList(DataTable dt) { List <jdgl_res_head_service.Model.Yxy_sc_xz_sj> modelList = new List <jdgl_res_head_service.Model.Yxy_sc_xz_sj>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { jdgl_res_head_service.Model.Yxy_sc_xz_sj model; for (int n = 0; n < rowsCount; n++) { model = new jdgl_res_head_service.Model.Yxy_sc_xz_sj(); if (dt.Rows[n]["id"] != null && dt.Rows[n]["id"].ToString() != "") { model.id = int.Parse(dt.Rows[n]["id"].ToString()); } if (dt.Rows[n]["yydh"] != null && dt.Rows[n]["yydh"].ToString() != "") { model.yydh = dt.Rows[n]["yydh"].ToString(); } if (dt.Rows[n]["qymc"] != null && dt.Rows[n]["qymc"].ToString() != "") { model.qymc = dt.Rows[n]["qymc"].ToString(); } if (dt.Rows[n]["scsj"] != null && dt.Rows[n]["scsj"].ToString() != "") { model.scsj = DateTime.Parse(dt.Rows[n]["scsj"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(jdgl_res_head_service.Model.Yxy_sc_xz_sj model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(jdgl_res_head_service.Model.Yxy_sc_xz_sj model) { return(dal.Add(model)); }