コード例 #1
0
 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));
 }
コード例 #2
0
 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)));///////////////////
 }
コード例 #3
0
 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)));
 }