/// <summary> /// Saves the password. /// </summary> /// <param name="passwordInfo">The password information.</param> /// <returns></returns> public string SavePassword(IPasswordView passwordInfo) { passwordInfo.Password = this.encryptionService.Encrypt(passwordInfo.Password); return(this.accountRepository.SavePassword(passwordInfo)); }
public ChangePasswordPresenter( IPasswordView view, IErrorView errorView, IDatabaseService databaseService, IAuthService authService, ISettingsService settingsService, IBackgroundTaskFactory backgroundTaskFactory) { _view = view; _errorView = errorView; _databaseService = databaseService; _authService = authService; _settingsService = settingsService; _backgroundTaskFactory = backgroundTaskFactory; }
public UserProfileViewModel(IPasswordView passwordView = null) { _passwordView = passwordView; _session = Session.CurrentSession; _userService = new UserService(); _defaultPhotoVisibility = Visibility.Visible; _userPhotoVisibility = Visibility.Collapsed; MessageQueue = new SnackbarMessageQueue(TimeSpan.FromSeconds(1)); ConfirmCommand = new FormCommand(Confirm); CancelCommand = new FormCommand(Cancel); EditPhotoCommand = new FormCommand(EditPhoto); Initialize(); }
/// <summary> /// Saves the password. /// </summary> /// <param name="registrationInfo">The registration information.</param> /// <returns></returns> /// <exception cref="ArgumentNullException">registrationInfo</exception> public string SavePassword(IPasswordView registrationInfo) { var result = string.Empty; if (registrationInfo == null) { throw new ArgumentNullException(nameof(registrationInfo)); } try { using ( var dbContext = (PitalyticsEntities)dbContextFactory.GetDbContext()) { var userinfo = dbContext.UserRegistrations.SingleOrDefault( x => x.UserRegistrationId == registrationInfo.userId); var useractive = dbContext.UserActivationCodes.SingleOrDefault(x => x.ActivationCode == registrationInfo.code); useractive.IsUsed = true; dbContext.SaveChanges(); userinfo.Password = registrationInfo.Password; dbContext.SaveChanges(); } } catch (Exception e) { result = string.Format("SavePassword - {0} , {1}", e.Message, e.InnerException != null ? e.InnerException.Message : ""); } return(result); ; }
public PasswordViewMediator (IPasswordView target):base( target as IMediatorTarget) { this.View = target; }
public PasswordViewMediator(IPasswordView target) : base(target as IMediatorTarget) { this.View = target; }