Exemplo n.º 1
0
        public ActionResult Add(EmployeeOrder order)
        {
            //order.eOrderID = context.EmployeeOrders.Max(x => x.eOrderID) + 1;
            order = order.Validate();
            using (var repository = new Repository <EmployeeOrder>())
            {
                if (repository.Add(order))
                {
                    repository.Save();
                }
                else
                {
                    return(HttpNotFound());
                }
            }

            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult UpdateConfirmed(EmployeeOrder order)
 {
     if (order == null)
     {
         return(HttpNotFound());
     }
     order = order.Validate();
     using (var repository = new Repository <EmployeeOrder>())
     {
         if (repository.Update(order))
         {
             repository.Save();
         }
         else
         {
             return(HttpNotFound());
         }
     }
     return(RedirectToAction("Index"));
 }