public IActionResult OrderSuccess(OrderByLocation order) { Repo.AddOrders( order.LocationID, order.CustomerID, order.SalesAmount, order.Date, order.TimeSpan ); Repo.SaveChange(); var savedOrder = Repo.GetAllOrders().Last(); order.NewOrderDetails.ForEach( detail => { if (detail.ItemCheck) { Repo.AddOrderDetails( savedOrder.Id, detail.ItemID, detail.ItemQty ); Repo.SaveChange(); } } ); return(RedirectToAction("Index", "Dashboard", new{ id = order.CustomerID })); }
public IActionResult NewOrder(int id) { // Check the last time customer make an order // if time is less than 2hr // Show a message // If time is more than 2hr // Allo user to complete order Customer customer = Repo.GetCustomerByID(id); OrderByLocation newOrder = new OrderByLocation { InventoryLocation = Repo.GetInventoryByLocationID(customer.LocationId), Item = Repo.GetAllItem(), Types = Repo.GetAllItemType(), CustomerID = customer.Id, LocationID = customer.LocationId }; return(View(newOrder)); }
public IActionResult NewOrder(OrderByLocation order) { return(RedirectToAction( "OrderSummary", "DashBoard", order )); }
public IActionResult OrderSummary(OrderByLocation order) { return(View(order)); }