示例#1
0
        public virtual ActionResult CreateEmployeeLoan()
        {
            var viewModel = new EmployeeLoanViewModel();

            viewModel.Loans = _loanRepository.Find(x => x.IsActive).Select(x => new SelectListItem
            {
                Value = x.LoanId.ToString(),
                Text  = x.LoanName
            }).ToList();

            var dayOfWeeks = new List <SelectListItem>();

            foreach (DayOfWeek dayOfWeek in Enum.GetValues(typeof(DayOfWeek)))
            {
                dayOfWeeks.Add(new SelectListItem
                {
                    Text  = dayOfWeek.ToString(),
                    Value = ((int)dayOfWeek).ToString()
                });
            }
            viewModel.WeeklyPaymentDayOfWeekList = dayOfWeeks;


            var loanPaymentFrequencies = new List <SelectListItem>
            {
                new SelectListItem
                {
                    Text  = FrequencyType.Weekly.ToString(),
                    Value = ((int)FrequencyType.Weekly).ToString()
                },
                new SelectListItem
                {
                    Text  = FrequencyType.SemiMonthly.ToString(),
                    Value = ((int)FrequencyType.SemiMonthly).ToString()
                },
                new SelectListItem
                {
                    Text  = FrequencyType.Monthly.ToString(),
                    Value = ((int)FrequencyType.Monthly).ToString()
                }
            };

            viewModel.PaymentFrequencies = loanPaymentFrequencies;

            return(View(viewModel));
        }
        public virtual ActionResult Loan()
        {
            var loan = _loanRepository.Find(x => x.IsActive);

            return(View(loan));
        }