コード例 #1
0
 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));
         }
     }
 }
コード例 #2
0
 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));
     }
 }
コード例 #3
0
        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));
            }
        }
コード例 #4
0
        public ActionResult Create()
        {
            Order_Edit model = new Order_Edit(customerDb, employeeDb, statusDb, new Order());

            return(View(model));
        }