Example #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <SmartTeaching.Entity.Base_Role> DataTableToList(DataTable dt)
        {
            List <SmartTeaching.Entity.Base_Role> modelList = new List <SmartTeaching.Entity.Base_Role>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                SmartTeaching.Entity.Base_Role model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new SmartTeaching.Entity.Base_Role();
                    if (dt.Rows[n]["RoleId"].ToString() != "")
                    {
                        model.RoleId = int.Parse(dt.Rows[n]["RoleId"].ToString());
                    }
                    model.RoleName    = dt.Rows[n]["RoleName"].ToString();
                    model.Description = dt.Rows[n]["Description"].ToString();


                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Example #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(SmartTeaching.Entity.Base_Role model)
 {
     return(dal.Update(model));
 }
Example #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(SmartTeaching.Entity.Base_Role model)
 {
     return(dal.Add(model));
 }