public ActionResult DiscountFees(StudentSearchViewModel userInput) { TransactionHelper helper = new TransactionHelper(); string error = ""; HostelTransactionViewModel viewModel = helper.ConstructViewModelForHostelFeeDiscount(userInput.bid, out error); if (viewModel != null) { // generate the list of account heads to be displayed and add it to the view bag ViewBag.acHeadList = new SelectList(helper.GetAccountHeads(), "id", "val"); // generate the list of payment types to be displayed and add it to the view bag ViewBag.paymentTypeList = new SelectList(helper.GetPaymentTypes(true), "id", "val", "4"); //generate the list of academic years to be displayed and add it to the view bag ViewBag.academicYearList = new SelectList(helper.GetValidAcademicYears(viewModel.year), DateTime.Now.Year + ""); // display the view return(PartialView("_AddDiscount", viewModel)); } return(Content(error)); }