Beispiel #1
0
        public async Task <ActionResult <HumanPassword> > PostHumanPassword(HumanPassword humanPassword)
        {
            _context.HumanPasswords.Add(humanPassword);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetHumanPassword", new { id = humanPassword.Id }, humanPassword));
        }
Beispiel #2
0
        public async Task <IActionResult> PutHumanPassword(long id, HumanPassword humanPassword)
        {
            if (id != humanPassword.Id)
            {
                return(BadRequest());
            }

            _context.Entry(humanPassword).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!HumanPasswordExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public ActionResult <HumanPassword> Post([FromBody] HumanPassword humanPassword)
        {
            var authorizedHumanPassword = _context.HumanPasswords.SingleOrDefault(x => x.Password == humanPassword.Password);

            if (authorizedHumanPassword == null)
            {
                return(NotFound());
            }
            return(authorizedHumanPassword);
        }
        async void ExecuteHumanLogonCommandAsync()
        {
            HumanPassword authorizedHumanPassword = await this.HumanPassword.HumanLogonAsync();

            // authorizedUser が null でなければログオンに成功している。
            if (authorizedHumanPassword != null)
            {
                SessionService.Instance.IsAuthorized /*HumanPassword*/ = true;
                SessionService.Instance.AuthorizedHumanPassword        = authorizedHumanPassword;
                this.ErrorMessage = "";
                this.regionManager.RequestNavigate("HeaderRegion", nameof(Views.Header));
                this.regionManager.RequestNavigate("ContentRegion", nameof(Views.HumanManagementMenu));
                this.regionManager.RequestNavigate("FooterRegion", nameof(Views.Footer));
            }
            else
            {
                this.ErrorMessage = "ログオンに失敗しました。";
            }
        }
Beispiel #5
0
 public HeaderViewModel()
 {
     this.AuthorizedUser          = SessionService.Instance.AuthorizedUser;
     this.AuthorizedHumanPassword = SessionService.Instance.AuthorizedHumanPassword;
 }
 public HumanManagementMenuViewModel(IRegionManager regionManager)
 {
     this.regionManager           = regionManager;
     this.AuthorizedUser          = SessionService.Instance.AuthorizedUser;
     this.AuthorizedHumanPassword = SessionService.Instance.AuthorizedHumanPassword;
 }