Inheritance: DevExpress.XtraReports.UI.XtraReport, ILocalizable
 public void Execute()
 {
     if (Prizm.Main.Common.DateExtension.CheckDiapason(viewModel.StartDate, viewModel.EndDate))
     {
         try
         {
             data = repo.GetPipesFromInspection(viewModel.StartDate, viewModel.EndDate);
             IncomingReportsXtraReport report = new IncomingReportsXtraReport();
             SetDataSortByColumn("number");
             data.TranslateStatus <PartInspectionStatus>(SQLProvider.TableNameForInspectionReport, SQLProvider.ColumnNameForInspectionStatus, viewModel.localizedInspectionStatus);
             report.DataSource        = data;
             report.FootersVisibility = viewModel.IsFooterVisible;
             report.CreateDocument();
             var tool = new ReportPrintTool(report);
             tool.AutoShowParametersPanel = false;
             tool.ShowPreview();
         }
         catch (RepositoryException ex)
         {
             log.Error(string.Concat(ex.InnerException.Message, ex.Message));
             notify.ShowFailure(ex.InnerException.Message, ex.Message);
         }
     }
     else
     {
         notify.ShowInfo(Program.LanguageManager.GetString(StringResources.Message_FailureReportDate),
                         Program.LanguageManager.GetString(StringResources.Message_FailureReportDateHeader));
         log.Warn("Date limits not valid!" + "Diapason: start date= "
                  + viewModel.StartDate.ToString() + " end date= " + viewModel.EndDate.ToString());
     }
 }
 public void Execute()
 {
     if (Prizm.Main.Common.DateExtension.CheckDiapason(viewModel.StartDate, viewModel.EndDate))
     {
         try
         {
             data = repo.GetPipesFromInspection(viewModel.StartDate, viewModel.EndDate);
             IncomingReportsXtraReport report = new IncomingReportsXtraReport();
             SetDataSortByColumn("number");
             data.TranslateStatus<PartInspectionStatus>(SQLProvider.TableNameForInspectionReport, SQLProvider.ColumnNameForInspectionStatus, viewModel.localizedInspectionStatus);
             report.DataSource = data;
             report.FootersVisibility = viewModel.IsFooterVisible;
             report.CreateDocument();
             var tool = new ReportPrintTool(report);
             tool.AutoShowParametersPanel = false;
             tool.ShowPreview();
         }
         catch (RepositoryException ex)
         {
             log.Error(string.Concat(ex.InnerException.Message, ex.Message));
             notify.ShowFailure(ex.InnerException.Message, ex.Message);
         }
     }
     else
     {
         notify.ShowInfo(Program.LanguageManager.GetString(StringResources.Message_FailureReportDate),
             Program.LanguageManager.GetString(StringResources.Message_FailureReportDateHeader));
         log.Warn("Date limits not valid!" + "Diapason: start date= "
             + viewModel.StartDate.ToString() + " end date= " + viewModel.EndDate.ToString());
     }
 }
Exemple #3
0
 public void Execute()
 {
     if (viewModel.StartDate > viewModel.EndDate)
     {
         notify.ShowNotify(Program.LanguageManager.GetString(StringResources.Message_FailureReportDate),
                           Program.LanguageManager.GetString(StringResources.Message_FailureReportDateHeader));
     }
     try
     {
         data = repo.GetPipesFromInspection(viewModel.StartDate, viewModel.EndDate);
         IncomingReportsXtraReport report = new IncomingReportsXtraReport();
         report.DataSource = data;
         report.CreateDocument();
         viewModel.PreviewSource = report;
     }
     catch (RepositoryException ex)
     {
         log.Error(string.Concat(ex.InnerException.Message, ex.Message));
         notify.ShowFailure(ex.InnerException.Message, ex.Message);
     }
 }