private void CreateCollectionReport()
        {
            try
            {
                //IReports objReports = isCommonCDOforDeclaration ? ReportsBusinessObject.CreateInstance(ExchangeConst, TicketConst) : ReportsBusinessObject.CreateInstance();
                IReports objReports          = ReportsBusinessObject.CreateInstance();
                DataSet  BatchWinLossDetails = null;
                if (_BatchID > 0)
                {
                    BatchWinLossDetails = objReports.GetBatchWinLoss(_BatchID, 0);
                }
                else if (_WeekNumber > 0)
                {
                    BatchWinLossDetails = objReports.GetBatchWinLoss(_WeekNumber, 1);
                }

                //DataSet BatchWinLossDetails = objReports.GetBatchWinLoss(_BatchID, _WeekNumber);

                if (BatchWinLossDetails.Tables[0].Rows.Count == 0 || BatchWinLossDetails.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;
                }
                using (CReportViewer cReportViewer = isCommonCDOforDeclaration ? new CReportViewer(ExchangeConst, TicketConst) : new CReportViewer())
                {
                    LogManager.WriteLog("Report data fetched successfully from database", LogManager.enumLogLevel.Info);

                    if (_BatchID > 0)
                    {
                        cReportViewer.ShowCollectionReport(_BatchID, 0);
                    }
                    else if (_WeekNumber > 0)
                    {
                        cReportViewer.ShowCollectionReport(_WeekNumber, 1);
                    }

                    cReportViewer.SetOwner(Window.GetWindow(this));
                    cReportViewer.ShowDialog();
                }
                LogManager.WriteLog("CreateCollectionReport Successfull", LogManager.enumLogLevel.Info);
            }

            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
            }
        }
Esempio n. 2
0
        private void ShowCollectionReport()
        {
            try
            {
                LogManager.WriteLog("ShowCollectionReport  Start", LogManager.enumLogLevel.Info);

                if (IsCommonCDO)
                {
                    using (CReportViewer cReportViewer = new CReportViewer(_ExchangeConnectionString, _TicketingConnectionString))
                    {
                        LogManager.WriteLog("Report data fetched successfully from database", LogManager.enumLogLevel.Info);

                        if (_BatchID > 0)
                        {
                            cReportViewer.ShowCollectionReport(_BatchID, 0);
                        }
                        cReportViewer.Show();
                    }
                }
                else
                {
                    using (CReportViewer cReportViewer = new CReportViewer())
                    {
                        LogManager.WriteLog("Report data fetched successfully from database", LogManager.enumLogLevel.Info);
                        if (_BatchID > 0)
                        {
                            cReportViewer.ShowCollectionReport(_BatchID, 0);
                        }
                        cReportViewer.Show();
                    }
                }

                LogManager.WriteLog("ShowCollectionReport  Successfull", LogManager.enumLogLevel.Info);
            }

            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
            }
        }