public IActionResult FindSessions([FromForm] FindResultsViewModel findResultsViewModel) { var externalManager = _context.ManagerFactory.CreateExternalDbManager(); var sessionManager = _context.ManagerFactory.CreateSessionManager(); if (findResultsViewModel == null) { return(RedirectToAction("FindResults")); } var selectedStudy = externalManager .GetAllStudyListModels().SingleOrDefault(x => x.StudyName == findResultsViewModel.SelectedStudy); var findResultsSessionsModel = new FindResultsViewModel(); if (selectedStudy != null) { findResultsSessionsModel.StudyId = selectedStudy.StudyId; findResultsSessionsModel.SelectedStudy = selectedStudy.StudyName; findResultsSessionsModel.Sessions = sessionManager .GetAllSessionModelsForStudy(selectedStudy.StudyId) .Select(x => x.SessionName).ToList(); findResultsSessionsModel.Studies = externalManager.GetAllStudyListModels().Select(x => x.StudyName).ToList(); } return(View("FindResults", findResultsSessionsModel)); }
public async Task <IActionResult> FindParticipants([FromForm] FindResultsViewModel findResultsViewModel) { var externalManager = _context.ManagerFactory.CreateExternalDbManager(); var sessionManager = _context.ManagerFactory.CreateSessionManager(); if (findResultsViewModel == null) { return(RedirectToAction("FindResults")); } var selectedSession = await sessionManager.GetStudySession(findResultsViewModel.StudyId, findResultsViewModel.SelectedSession); var findParticipantsViewModel = new FindResultsViewModel(); if (selectedSession != null) { findParticipantsViewModel.Studies = externalManager.GetAllStudyListModels().Select(x => x.StudyName).ToList(); findParticipantsViewModel.StudyId = findResultsViewModel.StudyId; findParticipantsViewModel.SelectedStudy = findResultsViewModel.SelectedStudy; findParticipantsViewModel.Sessions = sessionManager .GetAllSessionModelsForStudy(findResultsViewModel.StudyId) .Select(x => x.SessionName).ToList(); findParticipantsViewModel.SessionId = selectedSession.Id; findParticipantsViewModel.SelectedSession = selectedSession.SessionName; findParticipantsViewModel.Participants = externalManager.GetParticipantIds(findResultsViewModel.StudyId).ToList(); findParticipantsViewModel.Surveys = selectedSession.Surveys; } return(View("FindResults", findParticipantsViewModel)); }
public DockingAdapterViewModel() { DockingAdapter = new ObservableCollection <Workspace>(); ToolboxViewModel toolbox = new ToolboxViewModel() { Name = "ToolboxWindow", Header = "Toolbox", State = DockState.Dock, SideInDockMode = DockSide.Left, DesiredWidthInDockedMode = 250 }; SolutionExplorerViewModel solutionexplorer = new SolutionExplorerViewModel() { Name = "SolutionExplorerWindow", Header = "Solution Explorer", State = DockState.Dock, SideInDockMode = DockSide.Right, DesiredWidthInDockedMode = 300 }; ClassViewModel classview = new ClassViewModel() { Name = "ClassViewWindow", Header = "Class View", State = DockState.Dock, TargetNameInDockedMode = "SolutionExplorerWindow", SideInDockMode = DockSide.Tabbed }; PropertiesViewModel properties = new PropertiesViewModel() { Name = "PropertiesWindow", Header = "Properties", State = DockState.Dock, TargetNameInDockedMode = "SolutionExplorerWindow", SideInDockMode = DockSide.Bottom }; ErrorListViewModel errorlist = new ErrorListViewModel() { Name = "ErrorListWindow", Header = "Error List", State = DockState.Dock, SideInDockMode = DockSide.Bottom, DesiredHeightInDockedMode = 200 }; FindSymbolResultsViewModel findsymbolresults = new FindSymbolResultsViewModel() { Name = "FindSymbolResultsWindow", Header = "Find Symbol Results", State = DockState.Dock, TargetNameInDockedMode = "ErrorListWindow", SideInDockMode = DockSide.Tabbed }; OutputViewModel output = new OutputViewModel() { Name = "OutputWindow", Header = "Output", State = DockState.Dock, TargetNameInDockedMode = "ErrorListWindow", SideInDockMode = DockSide.Tabbed }; FindResultsViewModel findresults = new FindResultsViewModel() { Name = "FindResults1Window", Header = "Find Results 1", State = DockState.Dock, TargetNameInDockedMode = "ErrorListWindow", SideInDockMode = DockSide.Tabbed }; MainWindowXAMLViewModel mainwindowxaml = new MainWindowXAMLViewModel() { Header = "MainWindow.xaml", State = DockState.Document }; MainWindowCSViewModel mainwindowcs = new MainWindowCSViewModel() { Header = "MainWindow.xaml.cs", State = DockState.Document }; DockingAdapter.Add(toolbox); DockingAdapter.Add(solutionexplorer); DockingAdapter.Add(classview); DockingAdapter.Add(properties); DockingAdapter.Add(errorlist); DockingAdapter.Add(findsymbolresults); DockingAdapter.Add(output); DockingAdapter.Add(findresults); DockingAdapter.Add(mainwindowxaml); DockingAdapter.Add(mainwindowcs); }
public IActionResult FindResults() { var externalManager = _context.ManagerFactory.CreateExternalDbManager(); var findResultsViewModel = new FindResultsViewModel() { Studies = externalManager.GetAllStudyListModels().Select(x => x.StudyName).ToList() }; return(View(findResultsViewModel)); }