Esempio n. 1
0
 public void CitizenEdit(Guid citizenId)
 {
     try
     {
         _viewModel.ShowUpdatePanel();
         _viewModel.HideAddPanel();
         var citizen = _citizenService.GetCitizen(citizenId);
         _viewModel.UpdateCitizenId = citizen.CitizenId;
         _viewModel.UpdateName      = citizen.Name;
         _viewModel.UpdateSpecie    = citizen.Specie;
         _viewModel.UpdateRole      = citizen.Role;
         _viewModel.UpdateStatus    = citizen.Status;
     }
     catch (Exception ex)
     {
         BaseException.HandleException(ex, false);
         _viewModel.ShowErrorMessage(ex.Message);
     }
 }
Esempio n. 2
0
        public async Task OnPostConfirmPassword()
        {
            if (SearchCitizen.Password == SearchCitizen.OriginalPassword)
            {
                CitizenData = await _citizenService.GetCitizen(SearchCitizen.CprNumber);

                ShowResult = true;
                if (CitizenData != null)
                {
                    await _citizenNotifier.NotifyCitizen(SearchCitizen.CprNumber,
                                                         $"You have been stalked ${CitizenData.FirstName}");

                    _audit.Write("{User} stalked citizen with CPR number {CprNumber}", User.Identity.Name, this.SearchCitizen.CprNumber);
                }
            }
            else
            {
                this.ShowError    = true;
                this.ShowPassword = true;
            }
        }