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 })); }
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")); } }