public ActionResult Edit(OccasionVacation model) { model.ErrorMessage = "Item Not Update Please Try Again!"; if (ModelState.IsValid) { try { bool isUpdate = OccasionVacationsLogic.UpdateOccasionVacation(model); if (isUpdate) { return(RedirectToAction("Index", VacationYearsLogic.GetVacationYear(model.VacationYearId))); } } catch (Exception e) { LogsLogic.InsertLog(new Log() { Message = e.Message, StackTrace = e.StackTrace, StoryName = "ManagmentProject/OccasionVacations/Edit(Post)" }); } } return(View(model)); }
public ActionResult Delete(int vacationYearId, int occasionVacationId) { try { OccasionVacationsLogic.DeleteOccasionVacation(occasionVacationId); } catch (Exception e) { LogsLogic.InsertLog(new Log() { Message = e.Message, StackTrace = e.StackTrace, StoryName = "ManagmentProject/OccasionVacations/Delete", Parameters = "id=" + vacationYearId }); } return(RedirectToAction("Index", VacationYearsLogic.GetVacationYear(vacationYearId)));/////////////////// }
public ActionResult Create(OccasionVacation model = null) { if (ModelState.IsValid) { try { model.CreatedByUserId = SessionData.UserId; if (!OccasionVacationsLogic.InsertNewOccasionVacation(model)) { return(View(model)); } } catch (Exception e) { LogsLogic.InsertLog(new Log() { Message = e.Message, StackTrace = e.StackTrace, StoryName = "ManagmentProject/OccasionVacations/Create(Post)", }); } } return(RedirectToAction("Index", VacationYearsLogic.GetVacationYear(model.VacationYearId))); }