public ActionResult Index(int?statusId, int?userId)
        {
            EmployeeVacationsIndexModel model;

            try
            {
                model = EmployeeVacationsLogic.GetEmployeeVacationsIndexModel(statusId, userId);
            }
            catch (Exception e)
            {
                LogsLogic.InsertLog(new Log()
                {
                    Message    = e.Message,
                    StackTrace = e.StackTrace,
                    StoryName  = "ManagementProject/EmployeeVacations/Index",
                    Parameters = "statusId = " + statusId + "& userId= " + userId
                });
                model = new EmployeeVacationsIndexModel()
                {
                    EmployeeUsersList  = new List <UserProfile>(),
                    VacationStatusList = new List <VacationStatu>()
                };
            }
            return(View(model));
        }
예제 #2
0
        public static EmployeeVacationsIndexModel GetEmployeeVacationsIndexModel(int?statusId, int?userId)
        {
            EmployeeVacationsIndexModel model = new EmployeeVacationsIndexModel();

            model.VacationStatusList = EmployeeVacationsRepositories.GetAllVacationStatus();
            model.EmployeeUsersList  = UserProfilesRepository.GetNotAdminUsers();
            model.StatusId           = statusId ?? 0;
            model.EmployeeUserId     = userId ?? 0;
            return(model);
        }