Example #1
0
 public IActionResult Add(OrdersViewModel ordersViewModel)
 {
     ordersViewModel.orders.Datecreation = DateTime.Now;
     db.Orders.Add(ordersViewModel.orders);
     db.SaveChanges();
     return(RedirectToAction("Index", "orders"));
 }
Example #2
0
 public IActionResult Delete(int id)
 {
     db.Orders.Remove(db.Orders.Find(id));
     db.SaveChanges();
     return(RedirectToAction("index"));
 }