Пример #1
0
        /// <summary>
        /// 添加角色
        /// </summary>
        public int AddRole(RoleEntity role)
        {
            RoleEntity roleCompare = dal.GetRoleByRoleName(role.RoleName);

            if (roleCompare != null)
            {
                throw new Exception("已经存在此角色!");
            }
            return(dal.AddRole(role));
        }
Пример #2
0
 /// <summary>
 /// 添加角色
 /// </summary>
 /// <param name="model">角色对象</param>
 /// <returns></returns>
 public bool AddRole(Role model)
 {
     return(idal.AddRole(model) > 0);
 }