public ActionResult Delete(long id, AbsenceViewModel avm) { try { activeUser = userBll.GetUserById((long)HttpContext.Session.GetInt32("userId")); string userCode = userBll.GetUserById(absenceBll.GetAbsenceById(id).UserId).Login; Absence absence = absenceBll.GetAbsenceById(id); if (activeUser.Administrator > 0 || activeUser.UserId == absence.UserId) { absenceBll.DeleteAbsence(id); } ViewData["sessionData"] = new int?[] { HttpContext.Session.GetInt32("admin"), HttpContext.Session.GetInt32("language") }; return(RedirectToAction(nameof(Index), new AbsenceViewModel { UserCode = userCode })); } catch { return(View()); } }
public void Delete(long id) { absenceBll.DeleteAbsence(id); //absenceProcessor.Delete(id); }