public ActionResult EventPerformance(vmAdmin_EventFilter filter)
        {
            var eventFilter = SetEventFilter(filter);

            if (filter.EventId.HasValue)
            {
                var performanceFilter = new vmAdmin_PerformanceFilter { EventId = filter.EventId };
                performanceFilter = SetPerformanceFilter(performanceFilter);

                var sizeTotals = (_service as ReportingService).GetTShirtSizeTotalsByEventId((int)filter.EventId);

                var vm = new vmAdmin_EventPerformance
                {
                    Filter = eventFilter,
                    Report = GetPerformanceReport(performanceFilter)
                };

                if (sizeTotals != null)
                {
                    vm.Report.TShirtSizes = (List<Dictionary<String, int>>)sizeTotals;
                }
                else
                {
                    vm.Report.TShirtSizes = new List<Dictionary<String, int>>();
                }

                return View(vm);
            }

            return View(new vmAdmin_EventPerformance { Filter = eventFilter, Report = new vmAdmin_PerformanceReport() });
        }
        public FileResult ExportEventPerformance(vmAdmin_EventFilter filter)
        {
            var performanceFilter = new vmAdmin_PerformanceFilter { EventId = filter.EventId };
            performanceFilter = SetPerformanceFilter(performanceFilter);

            var sizeTotals = (_service as ReportingService).GetTShirtSizeTotalsByEventId((int)filter.EventId);
            var report = GetPerformanceReport(performanceFilter) ;
            if (sizeTotals != null)
                report.TShirtSizes = (List<Dictionary<String, int>>)sizeTotals;
            else
                report.TShirtSizes = new List<Dictionary<String, int>>();

            return ExportPerformanceReport(report, performanceFilter, "Event Performance", "EventPerformance.xls");
        }
 private vmAdmin_EventFilter SetEventFilter(vmAdmin_EventFilter filter)
 {
     return new vmAdmin_EventFilter { EventId = filter.EventId, EventList = GetEventList() };
 }
 public ActionResult Registrant(vmAdmin_EventFilter filter)
 {
     var vm = SetEventFilter(filter);
     return View(vm);
 }