public int GetRemainingVacationDays(int userId, int vacationTypeId, int year = 0)
        {
            int remainingDaysOfVacation = 0;

            try
            {
                if (year == 0)
                {
                    year = DateTimeHelper.Today().Year;
                }
                int totalTakenDaysOfVavationType = EmployeeVacationsLogic.GetUserVacationDays(userId, vacationTypeId, year);
                int vacationMaxDays = VacationTypesLogic.GetVacationTypeById(vacationTypeId).VacationLength;
                remainingDaysOfVacation = vacationMaxDays - totalTakenDaysOfVavationType;
            }
            catch (Exception e)
            {
                LogsLogic.InsertLog(new Log()
                {
                    Message    = e.Message,
                    StackTrace = e.StackTrace,
                    StoryName  = "ManagmentProject/EmployeeVacations/GetRemainingVacationDays",
                    Parameters = "userId=" + userId + "&vacationTypeId=" + vacationTypeId
                });
            }
            return(remainingDaysOfVacation);
        }
        public ActionResult Edit(int id)
        {
            VacationType model = new VacationType();

            try
            {
                if (id > 0)
                {
                    model = VacationTypesLogic.GetVacationTypeById(id);
                }
                else
                {
                    return(RedirectToAction("Index"));
                }
            }
            catch (Exception e)
            {
                LogsLogic.InsertLog(new Log()
                {
                    Message    = e.Message,
                    StackTrace = e.StackTrace,
                    StoryName  = "ManagmentProject/VacationTypes/Edit",
                    Parameters = "id=" + id
                });
            }
            return(View(model));
        }