示例#1
0
        public static DataTable GetReportDataTable(String AReportType, Dictionary <String, TVariant> AParameters)
        {
            TLogging.SetStatusBarProcedure(WriteToStatusBar);
            DataTable ResultTbl = null;

            switch (AReportType)
            {
            /* GL Reports */

            case "BalanceSheet":

                FDbAdapter = new TReportingDbAdapter(true);       // Uses a separate DB Connection.

                ResultTbl = TFinanceReportingWebConnector.BalanceSheetTable(AParameters, FDbAdapter);
                break;

            case "FieldGifts":
                FDbAdapter = new TReportingDbAdapter(true);       // Uses a separate DB Connection.

                ResultTbl = TFinanceReportingWebConnector.KeyMinGiftsTable(AParameters, FDbAdapter);
                break;

            case "HOSA":
                FDbAdapter = new TReportingDbAdapter(true);       // Uses a separate DB Connection.

                ResultTbl = TFinanceReportingWebConnector.HosaGiftsTable(AParameters, FDbAdapter);
                break;

            case "Stewardship":
                FDbAdapter = new TReportingDbAdapter(true);       // Uses a separate DB Connection.

                ResultTbl = TFinanceReportingWebConnector.StewardshipTable(AParameters, FDbAdapter);
                break;

            case "Fees":
                FDbAdapter = new TReportingDbAdapter(true);       // Uses a separate DB Connection.

                ResultTbl = TFinanceReportingWebConnector.FeesTable(AParameters, FDbAdapter);
                break;

            case "StewardshipForPeriod":
                FDbAdapter = new TReportingDbAdapter(true);       // Uses a separate DB Connection.

                ResultTbl = TFinanceReportingWebConnector.StewardshipForPeriodTable(AParameters, FDbAdapter);
                break;

            case "IncomeExpense":
                FDbAdapter = new TReportingDbAdapter(true);       // Uses a separate DB Connection.

                ResultTbl = TFinanceReportingWebConnector.IncomeExpenseTable(AParameters, FDbAdapter);
                break;

            case "AFO":
                FDbAdapter = new TReportingDbAdapter(true);       // Uses a separate DB Connection.

                ResultTbl = TFinanceReportingWebConnector.AFOTable(AParameters, FDbAdapter);
                break;

            case "Executive Summary":
                FDbAdapter = new TReportingDbAdapter(true);       // Uses a separate DB Connection.

                ResultTbl = TFinanceReportingWebConnector.ExecutiveSummaryTable(AParameters, FDbAdapter);
                break;

            case "TrialBalance":
                FDbAdapter = new TReportingDbAdapter(false);

                ResultTbl = TFinanceReportingWebConnector.TrialBalanceTable(AParameters, FDbAdapter);
                break;

            case "SurplusDeficit":
                FDbAdapter = new TReportingDbAdapter(true);       // Uses a separate DB Connection.

                ResultTbl = TFinanceReportingWebConnector.SurplusDeficitTable(AParameters, FDbAdapter);
                break;

            /* Gift Reports */

            case "GiftBatchDetail":
                FDbAdapter = new TReportingDbAdapter(true);       // Uses a separate DB Connection.

                ResultTbl = TFinanceReportingWebConnector.GiftBatchDetailTable(AParameters, FDbAdapter);
                break;

            case "RecipientTaxDeductPct":
                FDbAdapter = new TReportingDbAdapter(true);       // Uses a separate DB Connection.

                ResultTbl = TFinanceReportingWebConnector.RecipientTaxDeductPctTable(AParameters, FDbAdapter);
                break;

            case "FieldLeaderGiftSummary":
                FDbAdapter = new TReportingDbAdapter(true);       // Uses a separate DB Connection.

                ResultTbl = TFinanceReportingWebConnector.FieldLeaderGiftSummary(AParameters, FDbAdapter);
                break;

            case "TotalGiftsThroughField":
                FDbAdapter = new TReportingDbAdapter(true);       // Uses a separate DB Connection.

                ResultTbl = TFinanceReportingWebConnector.TotalGiftsThroughField(AParameters, FDbAdapter);
                break;

            case "MotivationResponse":
                FDbAdapter = new TReportingDbAdapter(true);       // Uses a separate DB Connection.

                ResultTbl = TFinanceReportingWebConnector.MotivationResponse(AParameters, FDbAdapter);
                break;

            case "DonorGiftsToField":
                FDbAdapter = new TReportingDbAdapter(true);       // Uses a separate DB Connection.
                ResultTbl  = TFinanceReportingWebConnector.DonorGiftsToField(AParameters, FDbAdapter);
                break;

            case "GiftDestination":
                FDbAdapter = new TReportingDbAdapter(false);
                ResultTbl  = TFinanceReportingWebConnector.GiftDestination(AParameters, FDbAdapter);
                break;

            case "TotalForRecipients":
                FDbAdapter = new TReportingDbAdapter(false);
                ResultTbl  = TFinanceReportingWebConnector.TotalForRecipients(AParameters, FDbAdapter);
                break;

            /* Financial Development */

            case "SYBUNT":
                FDbAdapter = new TReportingDbAdapter(true);       // Uses a separate DB Connection.
                ResultTbl  = TFinanceReportingWebConnector.SYBUNTTable(AParameters, FDbAdapter);
                break;

            case "GiftsOverMinimum":
                FDbAdapter = new TReportingDbAdapter(true);       // Uses a separate DB Connection.
                ResultTbl  = TFinanceReportingWebConnector.GiftsOverMinimum(AParameters, FDbAdapter);
                break;

            default:
                TLogging.Log("GetDatatableThread unknown ReportType: " + AReportType);
                break;
            }

            if (FDbAdapter != null)
            {
                FDbAdapter.CloseConnection();

                if (FDbAdapter.IsCancelled)
                {
                    ResultTbl = null;
                }
            }

            return(ResultTbl);
        }