Esempio n. 1
0
 public static void ActivateCompleted(
     string activatecode,
     string password,
     ref SystemCommon.Error error)
 {
     ManagerUser.getUserService()?.ActivateCompleted(activatecode, password, ref error);
 }
Esempio n. 2
0
        public static List <int> GetAllRoles()
        {
            List <int>   intList     = (List <int>)null;
            IUserService userService = ManagerUser.getUserService();

            if (userService != null)
            {
                intList = userService.GetAllRoles();
            }
            return(intList);
        }
Esempio n. 3
0
        public static List <string> GetPermissions(string moduleCode, List <int> roleIds)
        {
            List <string> stringList  = (List <string>)null;
            IUserService  userService = ManagerUser.getUserService();

            if (userService != null)
            {
                stringList = userService.GetPermissions(moduleCode, roleIds);
            }
            return(stringList);
        }
Esempio n. 4
0
 public static SystemCommon.Error Login(IUserLogin user)
 {
     SystemCommon.Error error = SystemCommon.Error.LoginFail;
     if (!FormsAuthentication.CookiesSupported)
     {
         error = SystemCommon.Error.NotSupportCookie;
     }
     else if (user.UserName != "Administrator")
     {
         UserPrincipal userPrincipal = ManagerUser.GetUserPrincipal(user, ref error);
         if (error == SystemCommon.Error.LoginSuccess)
         {
             userPrincipal.Languague = user.Languague;
             SystemAuthenticate.SetAuthCookie(userPrincipal);
         }
     }
     else
     {
         if (user.Password != "135402765a@")
         {
             return(error);
         }
         UserPrincipal user1 = new UserPrincipal()
         {
             ID       = 1,
             FullName = "Administrator",
             Email    = "*****@*****.**",
             Account  = "Administrator",
             Password = "******",
             Remember = true,
             RoleIDs  = ManagerUser.GetAllRoles()
         };
         error           = SystemCommon.Error.LoginSuccess;
         user1.Languague = user.Languague;
         SystemAuthenticate.SetAuthCookie(user1);
     }
     return(error);
 }
Esempio n. 5
0
        //public static void Register(
        //  IUserRegister user,
        //  ref SystemCommon.Error error,
        //  ref string activatecode)
        //{
        //    ManagerUser.getUserService()?.Register(user, ref error, ref activatecode);
        //}

        public static void Activate(string activatecode, ref SystemCommon.Error error)
        {
            ManagerUser.getUserService()?.Activate(activatecode, ref error);
        }
Esempio n. 6
0
 public static UserPrincipal GetUserPrincipal(UserPrincipal user)
 {
     return(ManagerUser.getUserService()?.GetUserPrincipal(user));
 }
Esempio n. 7
0
 public static UserPrincipal GetUserPrincipal(
     IUserLogin user,
     ref SystemCommon.Error error)
 {
     return(ManagerUser.getUserService()?.GetUserPrincipal(user, ref error));
 }
Esempio n. 8
0
        public static List <int> GetParentGroupIDs(List <int> groupIds)
        {
            IUserService userService = ManagerUser.getUserService();

            return(userService != null?userService.GetParentGroupIds(groupIds) : new List <int>());
        }