/// <summary> /// 获得数据列表 /// </summary> public List <LPWeb.Model.LoanRules> DataTableToList(DataTable dt) { List <LPWeb.Model.LoanRules> modelList = new List <LPWeb.Model.LoanRules>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { LPWeb.Model.LoanRules model; for (int n = 0; n < rowsCount; n++) { model = new LPWeb.Model.LoanRules(); if (dt.Rows[n]["LoanRuleId"].ToString() != "") { model.LoanRuleId = int.Parse(dt.Rows[n]["LoanRuleId"].ToString()); } if (dt.Rows[n]["Fileid"].ToString() != "") { model.Fileid = int.Parse(dt.Rows[n]["Fileid"].ToString()); } if (dt.Rows[n]["RuleGroupId"].ToString() != "") { model.RuleGroupId = int.Parse(dt.Rows[n]["RuleGroupId"].ToString()); } if (dt.Rows[n]["RuleId"].ToString() != "") { model.RuleId = int.Parse(dt.Rows[n]["RuleId"].ToString()); } if (dt.Rows[n]["Applied"].ToString() != "") { model.Applied = DateTime.Parse(dt.Rows[n]["Applied"].ToString()); } if (dt.Rows[n]["AppliedBy"].ToString() != "") { model.AppliedBy = int.Parse(dt.Rows[n]["AppliedBy"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(LPWeb.Model.LoanRules model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(LPWeb.Model.LoanRules model) { return(dal.Add(model)); }