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