Example #1
0
        /// <summary>
        /// Gets the payroll history list.
        /// </summary>
        /// <param name="selectedMonth">The selected month.</param>
        /// <param name="selectedYear">The selected year.</param>
        /// <param name="message">The message.</param>
        /// <returns></returns>
        public IPayrollHistoryListView GetPayrollHistoryList(string selectedMonth, int?selectedYear, string message)
        {
            var loggedUserDetails = usersRepository.GetUserById((int)session.GetSessionValue(SessionKey.UserId));

            // company Collection
            var companyCollection = this.companyRepository.GetMyCompanies(loggedUserDetails.CompanyId);

            var companyInSession = (int)this.session.GetSessionValue(SessionKey.CompanyId);

            var monthDropDown = this.lookupRepository.GetAllMonths();

            var yearDropDown = this.lookupRepository.GetAllYears();

            var payrollHistoryCollection = payrollRepository.GetPayrollHistoryList(companyInSession);

            var viewModel = this.payrollViewModelFactory.CreatePayrollHistoryList(selectedMonth, selectedYear, payrollHistoryCollection, monthDropDown, yearDropDown, message);

            return(viewModel);
        }