Пример #1
0
        public IActionResult OnPost()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            if (_pizzaShopDbHandler.FindManager(Customer.PhoneNumber) != null ||
                _pizzaShopDbHandler.FindEmployee(Customer.PhoneNumber) != null ||
                _pizzaShopDbHandler.FindCustomer(Customer.PhoneNumber) != null)
            {
                ErrorMessage = "This phone number is registered with another account. Please try a different phone number.";
                return(Page());
            }

            _pizzaShopDbHandler.AddCustomer(Customer);

            return(RedirectToPage("/Customer/Login"));
        }