/// <summary> /// 添加角色 /// </summary> public int AddRole(RoleEntity role) { RoleEntity roleCompare = dal.GetRoleByRoleName(role.RoleName); if (roleCompare != null) { throw new Exception("已经存在此角色!"); } return(dal.AddRole(role)); }
/// <summary> /// 添加角色 /// </summary> /// <param name="model">角色对象</param> /// <returns></returns> public bool AddRole(Role model) { return(idal.AddRole(model) > 0); }