Beispiel #1
0
        /// <summary>
        /// Returns a <see cref="ReportsListViewModel"/> that contains a <see cref="List{ReportViewModel}"/> of reports with
        /// descriptions and URLs for Izenda report viewer.
        /// </summary>
        /// <param name="customerId">The customer id</param>
        /// <param name="userName">User name making request.  Not presently used.</param>
        /// <param name="reportCategory">Enumeration <see cref="ReportCategory"/> of the requested report category</param>
        /// <returns>Returns a <see cref="ReportsListViewModel"/> instance</returns>
        public ReportsListViewModel GetReportsList(int customerId, string userName, ReportCategory reportCategory)
        {
            var model = new ReportsListViewModel()
            {
                CustomerId   = customerId,
                Category     = reportCategory,
                CategoryName =
                    HttpContext.Current.GetLocaleResource(ResourceTypes.ReportCat,
                                                          RbacEntities.CustomerReportsCategories.FirstOrDefault(m => m.CustomerReportsCategoryId == (int)reportCategory).Name).ToString(),
                Reports = new List <ReportViewModel>()
            };


            foreach (var report in RbacEntities.CustomerReports.Where(m => m.CustomerId == customerId && m.CustomerReportsCategoryId == (int)reportCategory))
            {
                model.Reports.Add(new ReportViewModel()
                {
                    Name        = HttpContext.Current.GetLocaleResource(ResourceTypes.ReportName, report.ReportAction).ToString(),
                    Description = HttpContext.Current.GetLocaleResource(ResourceTypes.ReportDesc, report.ReportAction).ToString(),
                    Action      = report.ReportAction
                });
            }

            return(model);
        }
Beispiel #2
0
        public MainWindowViewModel()
        {
            _teamListViewModel            = ContainerHelper.Container.Resolve <TeamListViewModel>();
            _teamAddEditViewModel         = ContainerHelper.Container.Resolve <TeamAddEditViewModel>();
            _scorerListViewModel          = ContainerHelper.Container.Resolve <ScorerListViewModel>();
            _scorerAddEditViewModel       = ContainerHelper.Container.Resolve <ScorerAddEditViewModel>();
            _scorerSetTeamsViewModel      = ContainerHelper.Container.Resolve <ScorerSetTeamsViewModel>();
            _loginViewModel               = ContainerHelper.Container.Resolve <LoginViewModel>();
            _startSessionViewModel        = ContainerHelper.Container.Resolve <StartSessionViewModel>();
            _saveSessionConfigViewModel   = ContainerHelper.Container.Resolve <SaveSessionConfigViewModel>();
            _loadConfigViewModel          = ContainerHelper.Container.Resolve <LoadConfigViewModel>();
            _deleteBadSessionViewModel    = ContainerHelper.Container.Resolve <DeleteBadSessionViewModel>();
            _sessionStartConfirmViewModel = ContainerHelper.Container.Resolve <SessionStartConfirmViewModel>();
            _loadGameViewModel            = ContainerHelper.Container.Resolve <LoadGameViewModel>();
            _reportsListViewModel         = ContainerHelper.Container.Resolve <ReportsListViewModel>();
            _currentViewModel             = _loginViewModel;

            NavCommand = new RelayCommand <string>(OnNav);

            _teamListViewModel.AddTeamRequested  += NavToAddTeam;
            _teamListViewModel.EditTeamRequested += NavToEditTeam;
            _teamAddEditViewModel.Done           += NavToTeamList;

            _scorerListViewModel.AddScorerRequested      += NavToAddScorer;
            _scorerListViewModel.EditScorerRequested     += NavToEditScorer;
            _scorerListViewModel.AssociateTeamsRequested += NavToAssociateTeamsWithScorer;
            _scorerAddEditViewModel.Done += NavToScorerList;
            _scorerAddEditViewModel.AssociateTeamsRequested += NavToAssociateTeamsWithScorer;
            _scorerSetTeamsViewModel.Done += NavToScorerList;

            _startSessionViewModel.Done += NavToLogin;
            _startSessionViewModel.LoadConfigRequested   += NavToLoadConfig;
            _startSessionViewModel.SaveConfigRequested   += NavToSaveConfig;
            _startSessionViewModel.StartSessionRequested += NavToConfirmSession;

            _saveSessionConfigViewModel.Done += NavToLogin;

            _loadConfigViewModel.Done += NavToLogin;
            _loadConfigViewModel.UseConfigRequested += NavToConfirmSession;
            _loadConfigViewModel.FailedLoadError    += NavToBadSession;

            _deleteBadSessionViewModel.Done += NavToLogin;

            _sessionStartConfirmViewModel.Done += NavToLogin;
            _sessionStartConfirmViewModel.StartSessionRequested += OpenScoringWindow;

            _loadGameViewModel.StartGameRequested += LoadScoringWindow;
            _loadGameViewModel.FailedLoadError    += NavToBadSession;
            _loadGameViewModel.Done += NavToLogin;

            _reportsListViewModel.Done += NavToLogin;
        }
Beispiel #3
0
 public ExportToExcel(ReportsListViewModel reportsListViewModel)
 {
     _reportsListViewModel = reportsListViewModel;
 }