Example #1
0
        public IActionResult NewShoppingBag(NewShoppingBagVM newShoppingBagVM)
        {
            ShoppingBag sb = new ShoppingBag()
            {
                Customer = _customerService.GetById(newShoppingBagVM.Customer.Id),
                Date     = newShoppingBagVM.Date
            };

            _ShoppingBagService.NewShoppingBag(sb);


            return(RedirectToAction("DetailBag", new { id = sb.Id }));
        }
Example #2
0
        public IActionResult NewShoppingBag(string id)
        {
            Customer c = _customerService.GetById(id);

            if (c != null)
            {
                NewShoppingBagVM newShoppingBagVM = new NewShoppingBagVM()
                {
                    Customer = c,
                    Date     = DateTime.Now
                };
                return(View(newShoppingBagVM));
            }
            else
            {
                return(RedirectToAction("Index", "Main"));
            }
        }