当前位置: 首页>>代码示例>>C#>>正文


C# ReportType.ToEnumAttr方法代码示例

本文整理汇总了C#中ReportType.ToEnumAttr方法的典型用法代码示例。如果您正苦于以下问题:C# ReportType.ToEnumAttr方法的具体用法?C# ReportType.ToEnumAttr怎么用?C# ReportType.ToEnumAttr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ReportType的用法示例。


在下文中一共展示了ReportType.ToEnumAttr方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RunReport


//.........这里部分代码省略.........
        //                if (!IsDemo)
        //                    FileUtility.CopyFile(AppNEnvConfig.GetReportsProcessingPath + AppNEnvConfig.GetFileSeperator + CurrentRunningReportType.ToEnumDesc<ReportXlsmType>(), AppNEnvConfig.GetReportsPath, toMove: true);
        //                FileUtility.CleanReportsProcessingDir(new List<string> { ReportXmlType.eOR.ToEnumDesc<ReportXmlType>() });
        //                //System.Threading.Thread.Sleep(5000);
        //                CurrentRunningReportType = ReportXlsmType.eCheckup;
        //                if (IsDemo)
        //                    FileUtility.CreateReport(new List<string> { ReportXmlType.eCheckup.ToEnumDesc<ReportXmlType>(), CurrentRunningReportType.ToEnumDesc<ReportXlsmType>() });
        //                else
        //                    eAudITUtility.GenerateReport(RequestInfo.SSCTechActivity.SourceMAFGuid, workbookDetails, CurrentRunningReportType, RequestInfo.SSCTechActivity.SourceMAFName);
        //                if (!IsDemo)
        //                    FileUtility.CopyFile(AppNEnvConfig.GetReportsProcessingPath + AppNEnvConfig.GetFileSeperator + CurrentRunningReportType.ToEnumDesc<ReportXlsmType>(), AppNEnvConfig.GetReportsPath, toMove: true);
        //                FileUtility.CleanReportsProcessingDir(new List<string> { ReportXmlType.eCheckup.ToEnumDesc<ReportXmlType>() });
        //                MsgUtility.ShowMessageBox("Reports generated successfully.", MessageType.Info);
        //                if (IsDemo)
        //                    RequestInfo.IsReportGenerated = false;
        //            }
        //            //}
        //        };
        //        worker.RunWorkerCompleted += (s, e) =>
        //        {
        //            if (e.Error != null)
        //            {
        //                IsProgressBarVisible = false;
        //                IsBusy = false;
        //                SSCLog.HandleError(e.Error);
        //            }
        //            IsProgressBarVisible = false;
        //            IsBusy = false;
        //        };
        //        IsBusy = true;
        //        worker.RunWorkerAsync();
        //    }
        //}
        private void RunReport(List<WorkbookDetail> workbookDetails, ReportType reportType, DispatcherTimer dt)
        {
            //dt.Stop();
            //ProgressBarMsg = string.Format("Generating Report {0}", reportType.ToString());
            pMsg = string.Format("Generating Report {0}", reportType.ToString());
            currentStartTimmer = 0;
            //dt.Start();

            using (BackgroundWorker worker = new BackgroundWorker())
            {
                worker.DoWork += (s, e) =>
                {
                    CurrentRunningReportType = reportType;

                    if (IsDemo)
                        FileUtility.CreateReport(new List<string> { reportType.ToEnumAttr<ReportType, ReportAttribute>().XmlFileName, CurrentRunningReportType.ToEnumAttr<ReportType, ReportAttribute>().XlsmFileName });
                    else
                    {
                        //Thread.Sleep(50000);

                        eAudITUtility.GenerateReport(RequestInfo.SSCTechActivity.SourceMAFGuid, workbookDetails, CurrentRunningReportType);
                    }

                    if (!IsDemo)
                        FileUtility.CopyFile(AppNEnvConfig.GetReportsProcessingPath + AppNEnvConfig.GetFileSeperator + CurrentRunningReportType.ToEnumAttr<ReportType, ReportAttribute>().XlsmFileName, FilePathType.Reports.DirPath(), toMove: false);

                    FileUtility.CleanReportsProcessingDir(new List<string> {
                        reportType.ToEnumAttr<ReportType, ReportAttribute>().XlsmFileName,
                        reportType.ToEnumAttr<ReportType, ReportAttribute>().XmlFileName });
                };

                worker.RunWorkerCompleted += (s, e) =>
                {
                    if (e.Error != null)
                    {
                        dt.Stop();
                        IsReportInProgress = false;
                        IsProgressBarVisible = false;
                        IsBusy = false;
                        SSCLog.HandleError(e.Error);
                    }
                    else
                    {
                        if (reportType == ReportType.eOR)
                        {
                            SSCTechInfo.TimeInSecToGenerateReporteOR = currentStartTimmer;
                            RunReport(workbookDetails, ReportType.eCheckup, dt);
                        }
                        else if (reportType == ReportType.eCheckup)
                        {
                            SSCTechInfo.TimeInSecToGenerateReporteCheckup = currentStartTimmer;
                            dt.Stop();
                            IsReportInProgress = false;
                            IsProgressBarVisible = false;
                            IsBusy = false;

                            if (Directory.EnumerateFiles(this.ReportsViewModel.DirPath).Any())
                            {
                                MsgUtility.ShowMessageBox("Reports generated successfully.", MessageType.Info);
                            }
                        }
                    }
                };

                worker.RunWorkerAsync();
            }
        }
开发者ID:mengithub,项目名称:XP-3,代码行数:101,代码来源:MainWindowViewModel.cs


注:本文中的ReportType.ToEnumAttr方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。