public async Task<byte[]> GetOperatorRatingReport(OperatorRatingReportSettings settings) { return await Task.Run(() => { CheckPermission(UserRole.Administrator, AdministratorPermissions.Reports); return GenerateReport(new OperatorRatingReportProvider(settings)); }); }
private OperatorRatingReportSettings GetReportSettings() { OperatorRatingReportSettings settings = null; switch ((ReportDetailLevel)detailLevelTabControl.SelectedIndex) { case ReportDetailLevel.Year: settings = new OperatorRatingReportSettings() { StartYear = (int)startYearComboBox.SelectedItem, FinishYear = (int)finishYearComboBox.SelectedItem, }; break; case ReportDetailLevel.Month: settings = new OperatorRatingReportSettings() { StartYear = startMonthPicker.Value.Year, StartMonth = startMonthPicker.Value.Month, FinishYear = finishMonthPicker.Value.Year, FinishMonth = finishMonthPicker.Value.Month }; break; case ReportDetailLevel.Day: settings = new OperatorRatingReportSettings() { StartYear = startDatePicker.Value.Year, StartMonth = startDatePicker.Value.Month, StartDay = startDatePicker.Value.Day, FinishYear = finishDatePicker.Value.Year, FinishMonth = finishDatePicker.Value.Month, FinishDay = finishDatePicker.Value.Day }; break; default: throw new ApplicationException("Неверный тип детализации"); } settings.DetailLevel = (ReportDetailLevel)detailLevelTabControl.SelectedIndex; settings.Operators = isFullCheckBox.Checked ? new Guid[0] : GetSelectedOperators(); return settings; }
public OperatorRatingReportProvider(OperatorRatingReportSettings settings) { this.settings = settings; }