public ActionResult Edit(T model) { _items.Update(model); _context.SaveChanges(); _context.Dispose(); return(RedirectToAction("../TimeOffs/Index")); }
public ActionResult Approve(int id) { VacationDbContext context = new VacationDbContext(); BaseTimeOff timeOff = context.PaidTimeOffs.Find(id); timeOff.IsApproved = true; context.SaveChanges(); context.Dispose(); return(RedirectToAction("../TimeOffs/Index")); }