public BussinessManagementMenuViewModel(IRegionManager regionManager)
        {
            this.regionManager  = regionManager;
            this.AuthorizedUser = SessionService.Instance.AuthorizedUser;

            this.AuthorizedBusinessPassword = SessionService.Instance.AuthorizedBusinessPassword;
        }
        public async Task <ActionResult <BusinessPassword> > PostBusinessPassword(BusinessPassword businessPassword)
        {
            _context.BusinessPasswords.Add(businessPassword);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetBusinessPassword", new { id = businessPassword.Id }, businessPassword));
        }
        public async Task <IActionResult> PutBusinessPassword(long id, BusinessPassword businessPassword)
        {
            if (id != businessPassword.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public ActionResult <BusinessPassword> Post([FromBody] BusinessPassword businessPassword)
        {
            var authorizedBusinessPassword = _context.BusinessPasswords.SingleOrDefault(x => x.Password == businessPassword.Password);

            if (authorizedBusinessPassword == null)
            {
                return(NotFound());
            }
            return(authorizedBusinessPassword);
        }
        async void ExecuteBusinessLogonCommandAsync()
        {
            BusinessPassword authorizedBusinessPassword = await this.BusinessPassword.BusinessLogonAsync();

            // authorizedUser が null でなければログオンに成功している。
            if (authorizedBusinessPassword != null)
            {
                SessionService.Instance.IsAuthorized /*HumanPassword*/ = true;
                SessionService.Instance.AuthorizedBusinessPassword     = authorizedBusinessPassword;
                this.ErrorMessage = "";
                this.regionManager.RequestNavigate("HeaderRegion", nameof(Views.Header));
                this.regionManager.RequestNavigate("ContentRegion", nameof(Views.BussinessManagementMenu));
                this.regionManager.RequestNavigate("FooterRegion", nameof(Views.Footer));
            }
            else
            {
                this.ErrorMessage = "ログオンに失敗しました。";
            }
        }