public ActionResult ScheduleRpt(string errMsg) { if (Session["UserID"] != null) { ViewBag.BranchCode = new SelectList(_BranchService.All().ToList(), "BranchCode", "BranchName");//GardenSelection(); ViewBag.AccountCode = LoadDropDown.LoadContlAccount("2", _ItemService, _SubsidiaryService, _NewChartService); ViewBag.UnitCode = LoadDropDown.LoadUnit(); ViewBag.DeptCode = LoadDropDown.LoadDept(); var Fydd = _FYDDService.All().FirstOrDefault(s => s.FinYear == Session["FinYear"].ToString()); ViewBag.FyddFDate = Fydd.FYDF; ViewBag.FyddTDate = Fydd.FYDT; ViewBag.Message = errMsg; return(View()); } else { return(RedirectToAction("SecUserLogin", "SecUserLogin")); } }