Пример #1
0
        public IActionResult OnGet([FromServices] GetCart getCart,
                                   [FromServices] GetCustomerInformation getCustomerInformation)
        {
            var cart = getCart.Exec();

            if (cart.Count() == 0)
            {
                return(RedirectToPage("/Cart"));
            }

            var information = getCustomerInformation.Exec();

            if (information == null)
            {
                if (_environment.IsDevelopment())
                {
                    CustomerInformation = new CustomerInformationDto
                    {
                        FirstName   = "Toko",
                        LastName    = "Goshadze",
                        Email       = "*****@*****.**",
                        PhoneNumber = "599744894",
                        Address     = "28 Amaghleba street",
                        City        = "Tbilisi",
                        PostCode    = "0105"
                    }
                }
                ;
                return(Page());
            }

            return(RedirectToPage("/Checkout/Payment"));
        }
Пример #2
0
 public void Exec(CustomerInformationDto customerInformationDto)
 {
     _sessionManager.AddCustomerInformation(new CustomerInformation
     {
         FirstName   = customerInformationDto.FirstName,
         LastName    = customerInformationDto.LastName,
         Email       = customerInformationDto.Email,
         PhoneNumber = customerInformationDto.PhoneNumber,
         Address     = customerInformationDto.Address,
         City        = customerInformationDto.City,
         PostCode    = customerInformationDto.PostCode
     });
 }