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