Example #1
0
 public AuthenticationViewModel(IAuthenticationService authenticationService)
 {
     _authenticationService = authenticationService;
     Credential             = Credential.CreateNewCredential();
     LoginCommand           = new RelayCommand(Login, CanLogin);
     LogoutCommand          = new RelayCommand(Logout, CanLogout);
     ShowViewCommand        = new RelayCommand(ShowView, null);
     base.DisplayTitle      = Resources.AuthenticationViewModel_DisplayTitle;
 }
        public CustomerDTO Create([FromBody] string name)
        {
            var credential = Credential.CreateNewCredential(name);

            _bank.AddCustomer(credential);
            var customer = _bank.Login(credential);

            return(new CustomerDTO(customer));
        }
Example #3
0
 void NotifyProperty()
 {
     NotifyPropertyChanged(Resources.NotifyPropertyChanged_Authenticated);
     NotifyPropertyChanged(Resources.NotifyPropertyChanged_IsAuthenticated);
     NotifyPropertyChanged(Resources.NotifyPropertyChanged_IsNotAuthenticated);
     NotifyPropertyChanged(Resources.NotifyPropertyChanged_Status);
     LoginCommand.RaiseCanExecuteChanged();
     LogoutCommand.RaiseCanExecuteChanged();
     this.Credential.Username = string.Empty;
     this.Credential.Password = string.Empty;
     this.Credential.Status   = string.Empty;
     Credential = Credential.CreateNewCredential();
 }