Exemple #1
0
        public int DeleteRole(int id)
        {
            RoleQueriesCommands roleCQ = new RoleQueriesCommands();

            if (roleCQ.IsRoleExists(id))
            {
                Role role = roleCQ.GetRoleById(id);

                var result = roleCQ.DeleteRole(role);
                if (result == 1)
                {
                    //Successfully removed role and deactivated the accounts associated with
                    return(1);
                }
                else if (result == 2)
                {
                    //Internal error occured. Accounts could not be deactivated.
                    return(2);
                }
                else
                {
                    //Internal error occured. Role deletion unsuccessfull.
                    return(3);
                }
            }
            else
            {
                //Provided role doesn't exists.
                return(0);
            }
        }
Exemple #2
0
        public Role GetRole(int id)
        {
            RoleQueriesCommands RoleCQ = new RoleQueriesCommands();
            var result = RoleCQ.GetRoleById(id);

            return(result);
        }