Ejemplo n.º 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <LPWeb.Model.LoanStages> DataTableToList(DataTable dt)
        {
            List <LPWeb.Model.LoanStages> modelList = new List <LPWeb.Model.LoanStages>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                LPWeb.Model.LoanStages model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new LPWeb.Model.LoanStages();
                    if (dt.Rows[n]["LoanStageId"].ToString() != "")
                    {
                        model.LoanStageId = int.Parse(dt.Rows[n]["LoanStageId"].ToString());
                    }
                    if (dt.Rows[n]["Completed"].ToString() != "")
                    {
                        model.Completed = DateTime.Parse(dt.Rows[n]["Completed"].ToString());
                    }
                    if (dt.Rows[n]["SequenceNumber"].ToString() != "")
                    {
                        model.SequenceNumber = int.Parse(dt.Rows[n]["SequenceNumber"].ToString());
                    }
                    if (dt.Rows[n]["FileId"].ToString() != "")
                    {
                        model.FileId = int.Parse(dt.Rows[n]["FileId"].ToString());
                    }
                    if (dt.Rows[n]["DaysFromEstClose"].ToString() != "")
                    {
                        model.DaysFromEstClose = int.Parse(dt.Rows[n]["DaysFromEstClose"].ToString());
                    }
                    model.StageName = dt.Rows[n]["StageName"].ToString();
                    if (dt.Rows[n]["WflTemplId"].ToString() != "")
                    {
                        model.WflTemplId = int.Parse(dt.Rows[n]["WflTemplId"].ToString());
                    }
                    if (dt.Rows[n]["WflStageId"].ToString() != "")
                    {
                        model.WflStageId = int.Parse(dt.Rows[n]["WflStageId"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(LPWeb.Model.LoanStages model)
 {
     dal.Update(model);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(LPWeb.Model.LoanStages model)
 {
     return(dal.Add(model));
 }