Exemplo n.º 1
0
        public IActionResult Delivery(DelivaryViewModel model)
        {
            if (ModelState.IsValid)
            {
                Address address = new Address
                {
                    Hous        = model.Hous,
                    Apartment   = model.Apartment,
                    City        = model.City,
                    PhoneNumber = model.PhoneNumber,
                    Porch       = model.Porch,
                    Street      = model.Street
                };

                HttpContext.Session.Set <Address>("address", address);

                if (model.PayType == 1)
                {
                    return(View("CreditCardPay"));
                }
                else if (model.PayType == 2)
                {
                    return(View("YandexMoneyPay"));
                }
                else
                {
                    return(NotFound());
                }
            }

            return(View(model));
        }
Exemplo n.º 2
0
        public IActionResult Delivery()
        {
            Address address = HttpContext.Session.Get <Address>("address");

            if (address != null)
            {
                DelivaryViewModel model = new DelivaryViewModel
                {
                    Hous        = address.Hous,
                    Apartment   = address.Apartment,
                    City        = address.City,
                    PhoneNumber = address.PhoneNumber,
                    Porch       = address.Porch,
                    Street      = address.Street
                };

                return(View(model));
            }

            return(View());
        }
Exemplo n.º 3
0
        private void Button_Clicked(object sender, EventArgs e)
        {
            DelivaryViewModel modl = new DelivaryViewModel();

            this.BindingContext = modl;
        }