public ActionResult Edit(int id, Order order) { try { // TODO: Add update logic here DateTime oldStartDate = orderDb.Get(id).StartDate; orderDb.Edit(order); if (order.StartDate == oldStartDate) { return(RedirectToAction(ActionNameIndex)); } else { return(RedirectToAction(ActionNameIndexWithId + id)); } } catch { try { Order_Edit model = new Order_Edit(customerDb, employeeDb, statusDb, order);; return(View(model)); } catch (NotFoundInDatabaseException) { return(View(ViewNameNotFound)); } } }
public ActionResult Edit(int id) { try { Order_Edit model = new Order_Edit(customerDb, employeeDb, statusDb, orderDb, id); return(View(model)); } catch (NotFoundInDatabaseException) { return(View(ViewNameNotFound)); } }
public ActionResult Create(Order order) { try { order.StatusId = createdOrderStatusId; order.ToDo = createdOrderToDO; orderDb.Create(order); return(RedirectToAction(ActionNameIndex)); } catch { Order_Edit model = new Order_Edit(customerDb, employeeDb, statusDb, order); return(View(model)); } }
public ActionResult Create() { Order_Edit model = new Order_Edit(customerDb, employeeDb, statusDb, new Order()); return(View(model)); }