public void StoreActionResponseMessageByLoginStatus(LoginStatus status) { IValidationMessageService validationMessageService = NinjectWebCommon.GetConcreteInstance <IValidationMessageService>(); if (status == LoginStatus.Blocked) { validationMessageService.StoreActionResponseMessageInfo("Your account has been blocked. Please contact with support."); } else if (status == LoginStatus.Failed) { validationMessageService.StoreActionResponseMessageError("Problem has been occurred while proccessing you requst. Please try again."); } else if (status == LoginStatus.InvalidLogin) { validationMessageService.StoreActionResponseMessageError("Incorrect Username or Password"); } else if (status == LoginStatus.Successful) { validationMessageService.StoreActionResponseMessageSuccess("Login Successful"); } else if (status == LoginStatus.Unverified) { validationMessageService.StoreActionResponseMessageError("Please confirm your email address."); } }
public User CreateUser() { IMembershipService membershipService = NinjectWebCommon.GetConcreteInstance <IMembershipService>(); IUserFactory userFactory = NinjectWebCommon.GetConcreteInstance <IUserFactory>(); User user = userFactory.Create(this.Password); user.EmailAddress = this.Email; user.UserName = this.Email; user.Name = this.Email; user.Status = UserStatus.Unverified; user.TypeOfUser = UserType.Employee; user = membershipService.CreateUser(user); return(user); }
public void SendCofirmEmailIfRequired(User user) { if (!user.UserVerifications.Any()) { return; } IUriMakerService uriMakerService = NinjectWebCommon.GetConcreteInstance <IUriMakerService>(); IConfirmUserUriBuilder confirmUserUriBuilder = NinjectWebCommon.GetConcreteInstance <IConfirmUserUriBuilder>(); IEmailService emailService = NinjectWebCommon.GetConcreteInstance <IEmailService>(); IConfirmUserMessageBuilder forgotPasswordMessageBuilder = NinjectWebCommon.GetConcreteInstance <IConfirmUserMessageBuilder>(); confirmUserUriBuilder.Build(user.UserVerifications.First().VerificationCode); string url = uriMakerService.GetFullUri(confirmUserUriBuilder); forgotPasswordMessageBuilder.Build(user, url); emailService.SendText(forgotPasswordMessageBuilder); }
public void ProcessForgotPassword() { IMembershipService membershipService = NinjectWebCommon.GetConcreteInstance <IMembershipService>(); IUserService userService = NinjectWebCommon.GetConcreteInstance <IUserService>(); IUriMakerService uriMakerService = NinjectWebCommon.GetConcreteInstance <IUriMakerService>(); IForgotPasswordUriBuilder forgotPasswordUriBuilder = NinjectWebCommon.GetConcreteInstance <IForgotPasswordUriBuilder>(); IEmailService emailService = NinjectWebCommon.GetConcreteInstance <IEmailService>(); IForgotPasswordMessageBuilder forgotPasswordMessageBuilder = NinjectWebCommon.GetConcreteInstance <IForgotPasswordMessageBuilder>(); User user = userService.GetUserByEmail(this.Email); PasswordVerification passwordVerification = membershipService.ProcessForgotPassword(user); forgotPasswordUriBuilder.Build(passwordVerification.VerificationCode); string url = uriMakerService.GetFullUri(forgotPasswordUriBuilder); forgotPasswordMessageBuilder.Build(user, url); emailService.SendText(forgotPasswordMessageBuilder); }
public ShowUserModel() { _userService = NinjectWebCommon.GetConcreteInstance <IUserService>(); }
public StockPriceViewModel() { _log = NinjectWebCommon.GetConcreteInstance <ILogHelperFactory>(); _unitOfWork = NinjectWebCommon.GetConcreteInstance <IStockAppUnitOfWork>(); }
public APIInfoViewModel() { _log = NinjectWebCommon.GetConcreteInstance <ILogHelperFactory>(); }