Esempio n. 1
0
        //
        private void CreateExceptionSummaryReport()
        {
            try
            {
                //IReports objReports = ReportsBusinessObject.CreateInstance();

                LogManager.WriteLog("Fetching report data from database...", LogManager.enumLogLevel.Info);

                DataSet ExceptionDetails = objReports.GetExceptionSummary(_BatchID);

                if (ExceptionDetails.Tables[0].Rows.Count == 0)
                {
                    LogManager.WriteLog("No Records found for the selected criteria - Return", LogManager.enumLogLevel.Info);

                    MessageBox.ShowBox("MessageID261", BMC_Icon.Information);
                    return;
                }

                if (IsCommonCDO)
                {
                    using (CReportViewer cReportViewer = new CReportViewer(_ExchangeConnectionString, _TicketingConnectionString))
                    {
                        LogManager.WriteLog("Report data fetched successfully from database", LogManager.enumLogLevel.Info);
                        if (Settings.Region.ToUpper() == "UK")
                        {
                            cReportViewer.ShowExceptionSummaryReportUK(_BatchID, _ExchangeConnectionString, _TicketingConnectionString);
                        }
                        else
                        {
                            cReportViewer.ShowExceptionSummaryReport(_BatchID, _ExchangeConnectionString, _TicketingConnectionString);
                        }

                        cReportViewer.SetOwner(System.Windows.Window.GetWindow(this));
                        cReportViewer.Show();
                    }
                }
                else
                {
                    using (CReportViewer cReportViewer = new CReportViewer())
                    {
                        LogManager.WriteLog("Report data fetched successfully from database", LogManager.enumLogLevel.Info);
                        if (Settings.Region.ToUpper() == "UK")
                        {
                            cReportViewer.ShowExceptionSummaryReportUK(_BatchID);
                        }
                        else
                        {
                            cReportViewer.ShowExceptionSummaryReport(_BatchID);
                        }
                        cReportViewer.SetOwner(System.Windows.Window.GetWindow(this));

                        cReportViewer.Show();
                    }
                }


                LogManager.WriteLog("ShowExceptionSummaryReport Successfull", LogManager.enumLogLevel.Info);
            }
            catch (Exception ex)
            {
                LogManager.WriteLog("Report" + ex.Message, LogManager.enumLogLevel.Info);
            }
        }