public virtual ActionResult editHoliday(Holidays holiday) { Authentication auth = new Authentication(); if (auth.isAdmin(this) || Authentication.DEBUG_bypassAuth) { HolidaysDB.Entry(holiday).State = System.Data.EntityState.Modified; HolidaysDB.SaveChanges(); return RedirectToAction("viewHolidays"); } else { return View("error"); } }
public virtual ActionResult addHoliday(Holidays holiday) { Authentication auth = new Authentication(); if (auth.isAdmin(this) || Authentication.DEBUG_bypassAuth) { HolidaysDB.HolidaysList.Add(holiday); HolidaysDB.SaveChanges(); return RedirectToAction("viewHolidays"); } else { return View("error"); } }