コード例 #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <JumbotOA.Entity.PlanEntity> DataTableToList(DataTable dt)
        {
            List <JumbotOA.Entity.PlanEntity> modelList = new List <JumbotOA.Entity.PlanEntity>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                JumbotOA.Entity.PlanEntity model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new JumbotOA.Entity.PlanEntity();
                    if (dt.Rows[n]["Pwid"].ToString() != "")
                    {
                        model.Pwid = int.Parse(dt.Rows[n]["Pwid"].ToString());
                    }
                    if (dt.Rows[n]["Uid"].ToString() != "")
                    {
                        model.Uid = int.Parse(dt.Rows[n]["Uid"].ToString());
                    }
                    if (dt.Rows[n]["Pwdate"].ToString() != "")
                    {
                        model.Pwdate = DateTime.Parse(dt.Rows[n]["Pwdate"].ToString());
                    }
                    model.Pwpath  = dt.Rows[n]["Pwpath"].ToString();
                    model.Locked  = dt.Rows[n]["Locked"].ToString();
                    model.Manager = dt.Rows[n]["Manager"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
コード例 #2
0
 /// <summary>
 /// 获得数据列表
 /// </summary>
 public List<JumbotOA.Entity.PlanEntity> DataTableToList(DataTable dt)
 {
     List<JumbotOA.Entity.PlanEntity> modelList = new List<JumbotOA.Entity.PlanEntity>();
     int rowsCount = dt.Rows.Count;
     if (rowsCount > 0)
     {
         JumbotOA.Entity.PlanEntity model;
         for (int n = 0; n < rowsCount; n++)
         {
             model = new JumbotOA.Entity.PlanEntity();
             if (dt.Rows[n]["Pwid"].ToString() != "")
             {
                 model.Pwid = int.Parse(dt.Rows[n]["Pwid"].ToString());
             }
             if (dt.Rows[n]["Uid"].ToString() != "")
             {
                 model.Uid = int.Parse(dt.Rows[n]["Uid"].ToString());
             }
             if (dt.Rows[n]["Pwdate"].ToString() != "")
             {
                 model.Pwdate = DateTime.Parse(dt.Rows[n]["Pwdate"].ToString());
             }
             model.Pwpath = dt.Rows[n]["Pwpath"].ToString();
             model.Locked = dt.Rows[n]["Locked"].ToString();
             model.Manager = dt.Rows[n]["Manager"].ToString();
             modelList.Add(model);
         }
     }
     return modelList;
 }
コード例 #3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(JumbotOA.Entity.PlanEntity model)
 {
     dal.Update(model);
 }
コード例 #4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(JumbotOA.Entity.PlanEntity model)
 {
     return(dal.Add(model));
 }