//[OutputCache(NoStore = true, Location = OutputCacheLocation.Server, Duration = 100)] public ActionResult MainMenu() { string moduleName = MenuSession.GetModuleName(this.HttpContext); string taskName = MenuSession.GetTaskName(this.HttpContext); string taskController = MenuSession.GetTaskController(this.HttpContext); ViewBag.ModuleName = moduleName; ViewBag.TaskName = taskName; ViewBag.TaskController = taskController; ViewBag.GlobalFromDate = HomeSession.GetGlobalFromDate(this.HttpContext); ViewBag.GlobalToDate = HomeSession.GetGlobalToDate(this.HttpContext); //BEGIN: Cho nay: sau nay can phai bo di, vi lam nhu the nay khong hay ho gi ca. Thay vao do, se thua ke tu base controller -> de lay userid, locationid, location official name var Db = new ApplicationDbContext(); string aspUserID = User.Identity.GetUserId(); int userID = Db.Users.Where(w => w.Id == aspUserID).FirstOrDefault().UserID; ViewBag.LocationName = this.moduleRepository.GetLocationName(userID); //BEGIN: Cho nay: sau nay can phai bo di, vi lam nhu the nay khong hay ho gi ca. Thay vao do, se thua ke tu base controller -> de lay userid, locationid, location official name var moduleMaster = moduleRepository.GetAllModules().OrderByDescending(o => o.SerialID); return(PartialView(moduleMaster)); }
public ApplicationController() { this._moduleRepository = DependencyResolver.Current.GetService <IModuleRepository>(); foreach (var module in _moduleRepository.GetAllModules()) { ViewData[module.name] = module.value; } }
//[OutputCache(NoStore = true, Location = OutputCacheLocation.Server, Duration = 100)] public ActionResult MainMenu() { string moduleName = MenuSession.GetModuleName(this.HttpContext); string taskName = MenuSession.GetTaskName(this.HttpContext); string taskController = MenuSession.GetTaskController(this.HttpContext); ViewBag.ModuleName = moduleName; ViewBag.TaskName = taskName; ViewBag.TaskController = taskController; var moduleMaster = moduleRepository.GetAllModules(); return(PartialView(moduleMaster)); }
public IEnumerable <ModuleViewModel> GetAllModules() { var modules = _moduleRepository.GetAllModules(); _logger.LogTrace($"Retrieved {modules.Count} modules."); return(modules.Select(module => new ModuleViewModel { CohortNaam = module.Cohort.CohortNaam, Specialisaties = module.Studiefasen.Select(studiefase => studiefase.Specialisatie.Naam), ModuleCode = module.ModuleCode, Matrix = _matrixService.CreateCompetentieMatrix(module.Competenties), Perioden = module.Studiefasen.Select(studiefase => studiefase.Periode.PeriodeNummer), Eindeisen = module.Eindeisen.Select(eindeis => eindeis.EindeisBeschrijving), AuditLogEntries = module.AuditLogEntries.Select(entry => new AuditLogEntryViewModel { Omschrijving = entry.Omschrijving, Timestamp = entry.Timestamp }) })); }
public async Task <IEnumerable <ModuleResource> > GetAllModules() { var modules = await repository.GetAllModules(); return(mapper.Map <IEnumerable <Module>, IEnumerable <ModuleResource> >(modules)); }
public List <ModuleSearchResult> GetModules() { return(_moduleRepository.GetAllModules()); }