Exemplo n.º 1
0
        public IActionResult OnGet()
        {
            var information = new GetCustomerInformation(HttpContext.Session).Do();

            if (_env.IsDevelopment())
            {
                CustomerInformation = new AddCustomerInformation.Request
                {
                    FirstName   = "Mhd",
                    LastName    = "Zamel",
                    Address1    = "Dubai",
                    Address2    = "Ajman",
                    City        = "Damascus",
                    Email       = "*****@*****.**",
                    PhoneNumber = "0505838490",
                    PostalCode  = "00000"
                };
            }
            if (information == null)
            {
                return(Page());
            }
            else
            {
                return(RedirectToPage("/CheckOut/Payment"));
            }
        }
Exemplo n.º 2
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"));
        }
        public IActionResult OnGet()
        {
            var information = new GetCustomerInformation(HttpContext.Session).Do();

            if (information == null)
            {
                if (_env.IsDevelopment())
                {
                    CustomerInformation = new AddCustomerInformation.Request
                    {
                        FirstName   = "John",
                        LastName    = "Doe",
                        Email       = "*****@*****.**",
                        PhoneNumber = "(000) 000-0000",
                        Address1    = "1234 Bangalore Road",
                        Address2    = "",
                        City        = "Bangalore",
                        PostCode    = "12345",
                    };
                }
                return(Page());
            }
            else
            {
                return(RedirectToPage("/Checkout/Payment"));
            }
        }
Exemplo n.º 4
0
        public IActionResult OnGet()
        {
            // get customer info

            var information = new GetCustomerInformation(_sessionManager).Do();

            if (information == null)
            {
                if (_env.EnvironmentName == "Development")
                {
                    CustomerInformation =
                        new AddCustomerInformation.Request()
                    {
                        FirstName   = "Andrew",
                        LastName    = "Smith",
                        Email       = "*****@*****.**",
                        PhoneNumber = "+722222222",
                        Address1    = "Somewhere",
                        Address2    = "Nowhere",
                        City        = "Moscow",
                        PostCode    = "123"
                    };
                }
                return(Page());
            }

            // if info exist go to payment

            return(RedirectToPage("/Checkout/Payment"));
        }
Exemplo n.º 5
0
        public IActionResult OnGet(
            [FromServices] GetCustomerInformation getCustomerInformation)
        {
            var information = getCustomerInformation.Do();

            if (information == null)
            {
                if (_env.IsDevelopment())
                {
                    CustomerInformation = new AddCustomerInformation.Request
                    {
                        FirstName   = "Jan",
                        LastName    = "Kowalski",
                        Email       = "*****@*****.**",
                        PhoneNumber = "111222333",
                        Address1    = "Cebulowa",
                        Address2    = "21/37",
                        City        = "Radom",
                        PostCode    = "33-666",
                    };
                }
                return(Page());
            }
            else
            {
                return(RedirectToPage("/Checkout/Payment"));
            }
        }
Exemplo n.º 6
0
        public IActionResult OnGet()
        {
            //Get Cart
            //If cart exists, then go to payment
            var information = new GetCustomerInformation(HttpContext.Session).Do();

            if (information == null)
            {
                if (_env.IsDevelopment())
                {
                    CustomerInformation = new AddCustomerInformation.Request
                    {
                        FirstName   = "ff",
                        LastName    = "ll",
                        Email       = "ee@ee",
                        PhoneNumber = "0125421",
                        Address1    = "add1",
                        Address2    = "add2",
                        City        = "nz city",
                        PostCode    = "5510",
                    };
                }
                return(Page());
            }
            else
            {
                return(RedirectToPage("/Checkout/Payment"));
            }
        }
Exemplo n.º 7
0
        public IActionResult OnGet()
        {
            var information = new GetCustomerInformation(HttpContext.Session).Do();

            if (information == null)
            {
                if (_env.IsDevelopment())
                {
                    CustomerInformation = new AddCustomerInformation.Request
                    {
                        FirstName   = "Daniel",
                        LastName    = "Sivewright",
                        Email       = "*****@*****.**",
                        PhoneNumber = "0725077755",
                        Address1    = "20 Alexis Preller",
                        Address2    = "",
                        City        = "Johannesburg",
                        PostCode    = "2055",
                    };
                }
                return(Page());
            }
            else
            {
                return(RedirectToPage("/Checkout/Payment"));
            }
        }
Exemplo n.º 8
0
        public IActionResult OnGet()
        {
            var customerInformation = new GetCustomerInformation(HttpContext.Session).Do();

            if (customerInformation == null)
            {
                if (_env.IsDevelopment())
                {
                    CustomerInfo = new AddCustomerInformation.Request
                    {
                        FirstName = "A",
                        LastName  = "A",
                        Address1  = "A",
                        Address2  = "A",
                        City      = "A",
                        Email     = "*****@*****.**",
                        PhoneNo   = "222",
                        PostCode  = "A"
                    };
                }
                return(Page());
            }

            return(RedirectToPage("Payment"));
        }
Exemplo n.º 9
0
        public void GetCustomerInformationTest()
        {
            var customerInformation = new CustomerInformation
            {
                FirstName   = "Bob",
                LastName    = "Smith",
                Email       = "*****@*****.**",
                PhoneNumber = "375123092723",
                Address1    = "Lenina street 12",
                Address2    = "",
                City        = "Minsk",
                PostCode    = "220000"
            };

            var mock = new Mock <ISessionManager>();

            mock.Setup(x => x.GetCustomerInformation()).Returns(customerInformation);

            GetCustomerInformation.Response response =
                new GetCustomerInformation(mock.Object).Do();

            Assert.True(
                response.FirstName == customerInformation.FirstName &&
                response.LastName == customerInformation.LastName &&
                response.Email == customerInformation.Email &&
                response.PhoneNumber == customerInformation.PhoneNumber &&
                response.Address1 == customerInformation.Address1 &&
                response.Address2 == customerInformation.Address2 &&
                response.City == customerInformation.City &&
                response.PostCode == customerInformation.PostCode
                );
        }
        public IActionResult OnGet([FromServices] GetCustomerInformation getCustomerInformation)
        {
            //Get Cart
            var information = getCustomerInformation.Do();

            if (information == null)
            {
                if (_env.IsDevelopment())
                {
                    CustomerInformation = new AddCustomerInformation.Request
                    {
                        FirstName   = "A",
                        LastName    = "A",
                        Address1    = "A",
                        Address2    = "A",
                        City        = "A",
                        State       = "A",
                        Zipcode     = "A",
                        Email       = "*****@*****.**",
                        PhoneNumber = "11",
                    };
                }
                return(Page());
            }
            else
            {
                return(RedirectToPage("Payment"));
            }
        }
Exemplo n.º 11
0
        public IActionResult OnGet(
            [FromServices] GetCustomerInformation getCustomerInformation)
        {
            var information = getCustomerInformation.Do();

            if (information == null)
            {
                if (_env.IsDevelopment())
                {
                    CustomerInformation = new AddCustomerInformation.Request
                    {
                        FirstName   = "First",
                        LastName    = "Last",
                        Email       = "*****@*****.**",
                        PhoneNumber = "5555555555",
                        Address1    = "123 Fake Street",
                        Address2    = "Apartment A",
                        City        = "Beverly Hills",
                        State       = "CA",
                        ZipCode     = "90210",
                    };
                }
                return(Page());
            }
            else
            {
                return(RedirectToPage("/Checkout/Payment"));
            }
        }
Exemplo n.º 12
0
        public IActionResult OnGet(
            [FromServices] GetCustomerInformation getCustomerInformation)
        {
            var information = getCustomerInformation.Do();

            if (information == null)
            {
                //
                #region DevEnvOnly
                if (_environment.IsDevelopment())
                {
                    CustomerInformation = new AddCustomerInformation.Request {
                        FirstName   = "devTest",
                        LastName    = "devTest",
                        Email       = "*****@*****.**",
                        PhoneNumber = "1111",
                        Address1    = "devTest",
                        Address2    = "devTest",
                        City        = "devTest",
                        PostCode    = "devTest"
                    };
                }
                #endregion
                //
                return(Page());
            }
            else
            {
                return(RedirectToPage("/Checkout/Payment"));
            }
        }
Exemplo n.º 13
0
        public IActionResult OnGet()
        {
            var information = new GetCustomerInformation(HttpContext.Session).Do();

            if (information == null)
            {
                if (_env.IsDevelopment())
                {
                    CustomerInformation = new AddCustomerInformation.Request
                    {
                        FirstName   = "A",
                        LastName    = "A",
                        Email       = "[email protected]",
                        PhoneNumber = "11",
                        Address1    = "A",
                        Address2    = "A",
                        City        = "A",
                        PostCode    = "A",
                    };
                }
                return(Page());
            }
            else
            {
                return(RedirectToPage("/Checkout/Payment"));
            }
        }
Exemplo n.º 14
0
        public IActionResult OnGet()
        {
            var information = new GetCustomerInformation(HttpContext.Session).Do();

            if (information == null)
            {
                if (_env.IsDevelopment())
                {
                    CustomerInformation = new AddCustomerInformation.Request
                    {
                        Name         = "Test Name",
                        Email        = "*****@*****.**",
                        PhoneNumber  = "12",
                        Address      = "Test Address",
                        Neighborhood = "Test Neighborhood",
                        City         = "Test City",
                        State        = "Test State",
                        ZipCode      = "Test Zipcode"
                    };
                }
                return(Page());
            }
            else
            {
                return(RedirectToPage("/Checkout/Payment"));
            }
        }
        public IActionResult OnGet(
            [FromServices] GetCustomerInformation getCustomerInformation)
        {
            // Get Cart
            var information = getCustomerInformation.Do();

            // If Cart exist go to payment
            if (information == null)
            {
                if (_env.IsDevelopment())
                {
                    CustomerInformation = new AddCustomerInformation.Request
                    {
                        FirstName   = "Jaime",
                        LastName    = "Barras",
                        Email       = "*****@*****.**",
                        PhoneNumber = "(866) 555-1234",
                        Address1    = "Home Address",
                        Address2    = "Office Address",
                        City        = "New York",
                        ZipCode     = "25078",
                    };
                }

                return(Page());
            }
            else
            {
                return(RedirectToPage("/Checkout/Payment"));
            }
        }
Exemplo n.º 16
0
        public IActionResult OnGet([FromServices] GetCustomerInformation getCustomerInformation)
        {
            var info = getCustomerInformation.Do();

            if (info == null)
            {
                if (_env.IsDevelopment())
                {
                    CustomerInfo = new AddCustomerInformation.Request
                    {
                        FirstName   = "FirstName",
                        LastName    = "LastName",
                        Email       = "*****@*****.**",
                        PhoneNumber = "123",
                        Address1    = "Address1",
                        Address2    = "Address2",
                        City        = "City",
                        PostCode    = "PostCode",
                    };
                }
                return(Page());
            }
            else
            {
                return(RedirectToPage("/Checkout/Payment"));
            }
        }
Exemplo n.º 17
0
        public IActionResult OnGet()
        {
            var information = new GetCustomerInformation(HttpContext.Session).Do();

            if (information == null)
            {
                return(RedirectToPage("/Checkout/CustomerInformation"));
            }
            return(Page());
        }
Exemplo n.º 18
0
        public IActionResult OnGet([FromServices] GetCustomerInformation getCustomerInformation)
        {
            var information = getCustomerInformation.Do();

            if (information == null)
            {
                return(RedirectToPage("/Checkout/CustomerInformation"));
            }
            return(Page());
        }
Exemplo n.º 19
0
        public IActionResult Payment()
        {
            var information = new GetCustomerInformation(HttpContext.Session).Get();

            if (information == null)
            {
                return(RedirectToAction("CustomerInformation", "Product"));
            }

            return(View());
        }
Exemplo n.º 20
0
        public IActionResult OnGet()
        {
            var information = new GetCustomerInformation(HttpContext.Session).Do();

            //if information is not there do not allow payment
            if (information == null)
            {
                return(RedirectToPage("/Checkout/CustomerInformation"));
            }
            return(Page());
        }
Exemplo n.º 21
0
        public IActionResult CustomerInformation()
        {
            var information = new GetCustomerInformation(HttpContext.Session).Get();

            if (information == null)
            {
                return(View());
            }
            else
            {
                return(RedirectToAction("Payment", "Order"));
            }
        }
Exemplo n.º 22
0
        public IActionResult OnGet()
        {
            var information = new GetCustomerInformation(_sessionManager).Do();

            if (information == null)
            {
                return(RedirectToPage("/Checkout/CustomerInformation"));
            }

            CartOrder = new Application.Cart.GetOrder(_sessionManager).Do();

            return(Page());
        }
Exemplo n.º 23
0
        public IActionResult OnGet()
        {
            var information = new GetCustomerInformation(HttpContext.Session).Do();

            if (information == null)
            {
                return(Page());
            }
            else
            {
                return(RedirectToPage("/Checkout/Payment"));
            }
            //GEt cart
            //if cart
        }
Exemplo n.º 24
0
        public IActionResult OnGet()
        {
            var CartOrder = new Shop.Application.Cart.GetOrder(HttpContext.Session, _ctx).Do();

            TotalPayment = CartOrder.GetTotalCharge();

            var information = new GetCustomerInformation(HttpContext.Session).Do();

            if (information == null)
            {
                return(RedirectToPage("/CheckOt/CustomerInformation"));
            }
            else
            {
                return(Page());
            }
        }
Exemplo n.º 25
0
        public IActionResult OnGet([FromServices] GetCustomerInformation getCustomerInformation,
                                   [FromServices] GetCart getCart)
        {
            var information = getCustomerInformation.Exec();
            var totalValue  = getCart.Exec().Sum(x => x.RealValue * x.Quantity);

            TotalValue = $"${totalValue}";

            if (information == null)
            {
                return(RedirectToPage("/Checkout/CustomerInformation"));
            }

            var cart = getCart.Exec();

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

            return(Page());
        }