public ActionResult Update(int tableOrderId, int dishId, int quantity) { TableOrder foundOrder = TableOrder.Find(tableOrderId); foundOrder.UpdateDish(dishId, quantity); return(RedirectToAction("Show")); }
public ActionResult Update(int tableOrderId, string tableNumber, DateTime orderDate) { TableOrder foundTableOrder = TableOrder.Find(tableOrderId); foundTableOrder.Edit(tableNumber, orderDate); return(RedirectToAction("Show")); }
public ActionResult Create(int tableOrderId, int dishId, int newDishQuantity) { TableOrder foundOrder = TableOrder.Find(tableOrderId); foundOrder.AddDish(dishId, newDishQuantity); return(RedirectToAction("Show")); }
public ActionResult Delete(int tableOrderId) { TableOrder foundOrder = TableOrder.Find(tableOrderId); foundOrder.Delete(); return(RedirectToAction("Index")); }
public ActionResult Delete(int tableOrderId, int dishId) { Console.WriteLine(" Delete: {0} {1}", tableOrderId, dishId); TableOrder foundOrder = TableOrder.Find(tableOrderId); foundOrder.DeleteDish(dishId); return(RedirectToAction("Show")); }
public ActionResult Show(int tableOrderId) { TableOrder foundOrder = TableOrder.Find(tableOrderId); Dictionary <string, object> model = new Dictionary <string, object>(); model["order"] = foundOrder; model["order_dishes"] = foundOrder.GetAllDishes(); model["all_dishes"] = foundOrder.GetPotentialDishes();//Dish.GetAll(); return(View(model)); }
public void Find_FindsOrderInDatabase_Order() { string tableNumber = "4"; DateTime orderDate = new DateTime(2019, 3, 12); TableOrder newOrder = new TableOrder(tableNumber, orderDate); newOrder.Save(); int id = newOrder.GetId(); TableOrder testOrder = TableOrder.Find(id); Assert.AreEqual(newOrder, testOrder); }
public ActionResult Edit(int tableOrderId) { TableOrder foundTableOrder = TableOrder.Find(tableOrderId); return(View(foundTableOrder)); }