// GET: FinancialYear public ActionResult Index() { var categories = year.GetAll().ToList(); var financialyear = CurrentSession.GetCurrentSession(); var model = new FinancialYearView { SelectedYearId = financialyear.FinancialYear, FinancialYears = categories.Select(x => new SelectListItem { Value = x.Id.ToString(), Text = x.Extra1 }) }; return(PartialView("_FinancialYear", model)); }
private void CreateSession(string userName) { var data = service.GetAll().Where(a => a.UserName == userName).FirstOrDefault(); var company = companyService.GetAll().FirstOrDefault(); AppSession appSession = new AppSession(); if (data != null) { appSession.UserId = data.Id; appSession.UserName = data.UserName; appSession.UserRoleId = data.UserRoleId; appSession.UserStatus = data.UserStatus; appSession.BranchId = data.BranchId; appSession.FinancialYear = finService.GetAll().LastOrDefault().Id; appSession.Company = AutoMapper.Mapper.Map <CompanyResponse>(company); Session["Session"] = appSession; } else { Session["Session"] = null; } }