예제 #1
0
        /// <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);
        }
예제 #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(LPWeb.Model.UserLoanRep model)
 {
     dal.Update(model);
 }
예제 #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(LPWeb.Model.UserLoanRep model)
 {
     return(dal.Add(model));
 }