private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);

            ACalc.AddParameter("param_all_partners", rbtAllPartners.Checked);
            ACalc.AddParameter("param_extract", rbtExtract.Checked);

            if (rbtExtract.Checked)
            {
                ACalc.AddParameter("param_extract_name", txtExtract.Text);
            }

            if ((txtThisYear.Text != "0")
                && (txtLastYear.Text != "0"))
            {
                int LastYear = Convert.ToInt32(txtLastYear.Text);
                int ThisYear = Convert.ToInt32(txtThisYear.Text);

                if (LastYear >= ThisYear)
                {
                    TVerificationResult VerificationResult = new TVerificationResult(
                        Catalog.GetString("Wrong year entered."),
                        Catalog.GetString("'Gift given in year' must be less than 'No gifts in year'"),
                        TResultSeverity.Resv_Critical);
                    FPetraUtilsObject.AddVerificationResult(VerificationResult);
                }

                //TODO: Calendar vs Financial Date Handling - Confirm if year end is assumed wrongly, i.e. financial year end does not necessarily = calendar year end
                ACalc.AddParameter("param_this_year_start_date", new DateTime(ThisYear, 1, 1));
                ACalc.AddParameter("param_this_year_end_date", new DateTime(ThisYear, 12, 31));
                ACalc.AddParameter("param_last_year_start_date", new DateTime(LastYear - 1, 1, 1));
                ACalc.AddParameter("param_last_year_end_date", new DateTime(LastYear - 1, 12, 31));
            }
        }
 /// <summary>
 /// Reads the selected values from the controls, and stores them into the parameter system of FCalculator
 /// </summary>
 /// <param name="ACalc"></param>
 /// <param name="AReportAction"></param>
 public void ReadControls(TRptCalculator ACalc, TReportActionEnum AReportAction)
 {
     ACalc.AddParameter("param_active", this.chkActivePartners.Checked);
     ACalc.AddParameter("param_mailing_addresses_only", this.chkMailingAddressesOnly.Checked);
     ACalc.AddParameter("param_families_only", this.chkFamiliesOnly.Checked);
     ACalc.AddParameter("param_exclude_no_solicitations", this.chkExcludeNoSolicitations.Checked);
 }
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            int MinAge = Convert.ToInt32(txtFromYears.Text);     // 0
            int MaxAge = Convert.ToInt32(txtToYears.Text);     // 17
            DateTime EarliestBirthday;
            DateTime LatestBirthday;

            DateTime StartDate = DateTime.Today;
            DateTime EndDate = DateTime.Today;
            DateTime EarliestArrivalDate = DateTime.Today;
            DateTime LatestDepartureDate = DateTime.Today;
            bool IsSuccessful;

            if (ucoConferenceSelection.AllConferenceSelected)
            {
                IsSuccessful = TRemote.MConference.WebConnectors.GetEarliestAndLatestDate(-1,
                    out EarliestArrivalDate, out LatestDepartureDate, out StartDate, out EndDate);
            }
            else
            {
                long ConferenceKey = Convert.ToInt64(ucoConferenceSelection.ConferenceKey);

                IsSuccessful = TRemote.MConference.WebConnectors.GetEarliestAndLatestDate(ConferenceKey,
                    out EarliestArrivalDate, out LatestDepartureDate, out StartDate, out EndDate);
            }

            if (IsSuccessful)
            {
                EarliestBirthday = StartDate.AddYears(-MaxAge - 1);
                LatestBirthday = EndDate.AddYears(-MinAge);

                ACalc.AddParameter("param_earliest_birthday", EarliestBirthday.Date);
                ACalc.AddParameter("param_latest_birthday", LatestBirthday.Date);
            }
        }
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);
            ACalc.AddParameter("param_extract_name", txtExtract.Text);

            if ((AReportAction == TReportActionEnum.raGenerate)
                && rbtExtract.Checked
                && (txtExtract.Text.Length == 0))
            {
                TVerificationResult VerificationResult = new TVerificationResult(
                    Catalog.GetString("No recipient selected."),
                    Catalog.GetString("Please select a recipient."),
                    TResultSeverity.Resv_Critical);

                FPetraUtilsObject.AddVerificationResult(VerificationResult);
            }

            int MaxColumns = ACalc.GetParameters().Get("MaxDisplayColumns").ToInt();

            for (int Counter = 0; Counter <= MaxColumns; ++Counter)
            {
                String ColumnName = ACalc.GetParameters().Get("param_calculation", Counter, 0).ToString();

                if (ColumnName == "Gift Amount")
                {
                    ACalc.AddParameter("param_gift_amount_column", Counter);
                }
            }
        }
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            if ((AReportAction == TReportActionEnum.raGenerate)
                && (dtpFromDate.Date > dtpToDate.Date))
            {
                TVerificationResult VerificationResult = new TVerificationResult(
                    Catalog.GetString("From date is later than to date."),
                    Catalog.GetString("Please change from date or to date."),
                    TResultSeverity.Resv_Critical);
                FPetraUtilsObject.AddVerificationResult(VerificationResult);
            }

            ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);
            ACalc.AddParameter("TransactionCount", 0);
            ACalc.AddParameter("TransactionCountAccount", 0);
            ACalc.AddParameter("SumDebitAccount", 0);
            ACalc.AddParameter("SumCreditAccount", 0);

            int MaxColumns = ACalc.GetParameters().Get("MaxDisplayColumns").ToInt();

            for (int Counter = 0; Counter <= MaxColumns; ++Counter)
            {
                String ColumnName = ACalc.GetParameters().Get("param_calculation", Counter, 0).ToString();

                if (ColumnName == "Debits")
                {
                    ACalc.AddParameter("param_debit_column", Counter);
                }

                if (ColumnName == "Credits")
                {
                    ACalc.AddParameter("param_credit_column", Counter);
                }
            }
        }
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);

            ACalc.AddParameter("param_cost_centre_breakdown", false);
            ACalc.AddParameter("param_cost_centre_summary", false);
            ACalc.AddParameter("param_cost_centre_codes", "");
            ACalc.AddParameter("param_costcentreoptions", "AccountLevel");
        }
 private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
 {
     ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);
     ACalc.AddParameter("param_with_analysis_attributes", true);
     ACalc.AddColumnLayout(6, 23, 0, 3);
     ACalc.AddColumnLayout(7, 26, 0, 3);
     ACalc.SetMaxDisplayColumns(8);
     ACalc.AddColumnCalculation(6, "AnalysisType");
     ACalc.AddColumnCalculation(7, "AnalysisValue");
 }
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            if ((AReportAction == TReportActionEnum.raGenerate)
                && (dtpFromDate.Date > dtpToDate.Date))
            {
                TVerificationResult VerificationResult = new TVerificationResult(
                    Catalog.GetString("From date is later than to date."),
                    Catalog.GetString("Please change from date or to date."),
                    TResultSeverity.Resv_Critical);
                FPetraUtilsObject.AddVerificationResult(VerificationResult);
            }

            ACalc.AddParameter("param_currency", "Base");
            ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);
            // Set the values for accumulating the costs to 0
            ACalc.AddParameter("CostCentreCredit", 0);
            ACalc.AddParameter("CostCentreDebit", 0);
            ACalc.AddParameter("AccountCodeCredit", 0);
            ACalc.AddParameter("AccountCodeDebit", 0);
            ACalc.AddParameter("TotalCredit", 0);
            ACalc.AddParameter("TotalDebit", 0);

            int MaxColumns = ACalc.GetParameters().Get("MaxDisplayColumns").ToInt();

            // we need to know some indices of the columns
            for (int Counter = 0; Counter < MaxColumns; ++Counter)
            {
                String ColumnName = "param_column_" + ACalc.GetParameters().Get("param_calculation", Counter, 0).ToString();
                ACalc.AddParameter(ColumnName, Counter);
            }
        }
Exemplo n.º 9
0
 private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
 {
     ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);
     ACalc.AddColumnLayout(0, 8, 0, 3);
     ACalc.AddColumnLayout(1, 11, 0, 3);
     ACalc.AddColumnLayout(2, 14, 0, 7);
     ACalc.SetMaxDisplayColumns(3);
     ACalc.AddColumnCalculation(0, "Debit");
     ACalc.AddColumnCalculation(1, "Credit");
     ACalc.AddParameter("param_daterange", "false");
 }
Exemplo n.º 10
0
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);
            ACalc.AddParameter("param_with_analysis_attributes", false);

            // if rbtSortByCostCentre is checked then these parameters are added in generated code
            if (!rbtSortByCostCentre.Checked)
            {
                ACalc.AddParameter("param_paginate", false);
                ACalc.AddParameter("param_auto_email", false);
            }
        }
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            ACalc.AddColumnLayout(0, 8, 0, 3);
            ACalc.AddColumnLayout(1, 11, 0, 3);
            ACalc.SetMaxDisplayColumns(2);
            ACalc.AddColumnCalculation(0, "Debit");
            ACalc.AddColumnCalculation(1, "Credit");

            ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);
            ACalc.AddParameter("param_with_analysis_attributes", false);
            ACalc.AddParameter("param_depth", "summary");
            ACalc.AddParameter("param_sortby", "Cost Centre");
        }
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            if (dtpReportDate.ValidDate(true))
            {
                ACalc.AddParameter("param_dtpReportDate", this.dtpReportDate.Date);
            }

            if (rbtArrival.Checked)
            {
                ACalc.AddParameter("param_reportday", "Arrival");
            }
            else if (rbtDeparture.Checked)
            {
                ACalc.AddParameter("param_reportday", "Departure");
            }
        }
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);
            ACalc.AddParameter("param_recipient_key_n", txtPartnerKey.Text);

            if ((AReportAction == TReportActionEnum.raGenerate)
                && (txtPartnerKey.Text == "0000000000"))
            {
                TVerificationResult VerificationResult = new TVerificationResult(
                    Catalog.GetString("No recipient selected."),
                    Catalog.GetString("Please select a recipient."),
                    TResultSeverity.Resv_Critical);

                FPetraUtilsObject.AddVerificationResult(VerificationResult);
            }
        }
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            ACalc.AddParameter("ControlSource", "", ReportingConsts.HEADERCOLUMN);

            // TODO: If you want to export only the lines with relevant data and not the higher level lines
            // in csv export then enable this line
            // ACalc.AddParameter("csv_export_only_lowest_level", true);
        }
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);
            ACalc.AddParameter("param_recipientkey", txtRecipient.Text);
            ACalc.AddParameter("param_extract_name", txtExtract.Text);

            if (dtpToDate.Date.HasValue)
            {
                Int32 ToDateYear = dtpToDate.Date.Value.Year;
                DateTime FromDateThisYear = new DateTime(ToDateYear, 1, 1);
                DateTime ToDatePreviousYear = new DateTime(ToDateYear - 1, 12, 31);
                DateTime FromDatePreviousYear = new DateTime(ToDateYear - 1, 1, 1);

                ACalc.AddParameter("param_from_date_this_year", FromDateThisYear);
                ACalc.AddParameter("param_to_date_previous_year", ToDatePreviousYear);
                ACalc.AddParameter("param_from_date_previous_year", FromDatePreviousYear);
            }

            int MaxColumns = ACalc.GetParameters().Get("MaxDisplayColumns").ToInt();

            for (int Counter = 0; Counter <= MaxColumns; ++Counter)
            {
                String ColumnName = ACalc.GetParameters().Get("param_calculation", Counter, 0).ToString();

                if (ColumnName == "Gift Amount")
                {
                    ACalc.AddParameter("param_gift_amount_column", Counter);
                }
            }
        }
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);
            ACalc.AddParameter("param_recipientkey", txtRecipient.Text);
            ACalc.AddParameter("param_extract_name", txtExtract.Text);

            if (dtpToDate.Date.HasValue)
            {
                Int32 ToDateYear = dtpToDate.Date.Value.Year;
                //TODO: Calendar vs Financial Date Handling - Confirm that these should not be ledger dates, i.e. allowing for >12 periods and non-calendar period boundaries
                DateTime FromDateThisYear = new DateTime(ToDateYear, 1, 1);
                DateTime ToDatePreviousYear = new DateTime(ToDateYear - 1, 12, 31);
                DateTime FromDatePreviousYear = new DateTime(ToDateYear - 1, 1, 1);

                ACalc.AddParameter("param_from_date_this_year", FromDateThisYear);
                ACalc.AddParameter("param_to_date_previous_year", ToDatePreviousYear);
                ACalc.AddParameter("param_from_date_previous_year", FromDatePreviousYear);
            }

            int MaxColumns = ACalc.GetParameters().Get("MaxDisplayColumns").ToInt();

            for (int Counter = 0; Counter <= MaxColumns; ++Counter)
            {
                String ColumnName = ACalc.GetParameters().Get("param_calculation", Counter, 0).ToString();

                if (ColumnName == "Gift Amount")
                {
                    ACalc.AddParameter("param_gift_amount_column", Counter);
                }
            }
        }
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);

            ACalc.AddParameter("param_quarter", false);
            ACalc.AddParameter("param_start_period_i", 1);
            ACalc.AddParameter("param_end_period_i", 12);
            ACalc.AddParameter("param_ytd", true);
            ACalc.AddParameter("param_multiperiod", true);
            ACalc.AddParameter("ColumnWidth", 1.4, 0);
            ACalc.AddParameter("ColumnPositionIndented", 0.3, 0);
        }
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);

            ACalc.AddParameter("param_quarter", false);
            ACalc.AddParameter("param_start_period_i", 1);
            //TODO: Calendar vs Financial Date Handling - Confirm that below is correct, i.e. has a 12 period financial year been assumed
            ACalc.AddParameter("param_end_period_i", 12);
            ACalc.AddParameter("param_ytd", true);
            ACalc.AddParameter("param_multiperiod", true);
            ACalc.AddParameter("ColumnWidth", 1.4, 0);
            ACalc.AddParameter("ColumnPositionIndented", 0.3, 0);
        }
        /// <summary>
        /// read the values from the controls and give them to the calculator
        /// </summary>
        /// <param name="ACalculator"></param>
        /// <param name="AReportAction"></param>
        public void ReadControls(TRptCalculator ACalculator, TReportActionEnum AReportAction)
        {
            if (chkHideEmptyLines.Checked)
            {
                ACalculator.AddParameter("param_hide_empty_lines", "true");
            }
            else
            {
                ACalculator.AddParameter("param_hide_empty_lines", "false");
            }

            if (chkPrintTwoLines.Checked)
            {
                ACalculator.AddParameter("param_print_two_lines", "true");
                // we can't sort with two lines
                ACalculator.RemoveParameter("param_sortby_columns");
            }
            else
            {
                ACalculator.AddParameter("param_print_two_lines", "false");
            }
        }
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            if (txtMinAmount.NumberValueInt > txtMaxAmount.NumberValueInt)
            {
                TVerificationResult VerificationResult = new TVerificationResult(
                    Catalog.GetString("Gift Limit wrong."),
                    Catalog.GetString("Minimum Amount can't be greater than Maximum Amount."),
                    TResultSeverity.Resv_Critical);
                FPetraUtilsObject.AddVerificationResult(VerificationResult);
            }

            ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);
            ACalc.AddParameter("param_donorkey", txtDonor.Text);
            ACalc.AddParameter("param_extract_name", txtExtract.Text);

            //TODO: Calendar vs Financial Date Handling - Confirm that these should not be ledger dates, i.e. allowing for >12 periods and non-calendar period boundaries
            DateTime FromDateThisYear = new DateTime(DateTime.Today.Year, 1, 1);
            DateTime ToDatePreviousYear = new DateTime(DateTime.Today.Year - 1, 12, 31);
            DateTime FromDatePreviousYear = new DateTime(DateTime.Today.Year - 1, 1, 1);

            ACalc.AddParameter("param_to_date_this_year", DateTime.Today);
            ACalc.AddParameter("param_from_date_this_year", FromDateThisYear);
            ACalc.AddParameter("param_to_date_previous_year", ToDatePreviousYear);
            ACalc.AddParameter("param_from_date_previous_year", FromDatePreviousYear);

            ACalc.AddParameter("DonorAddress", "");

            int MaxColumns = ACalc.GetParameters().Get("MaxDisplayColumns").ToInt();

            for (int Counter = 0; Counter <= MaxColumns; ++Counter)
            {
                String ColumnName = ACalc.GetParameters().Get("param_calculation", Counter, 0).ToString();

                if (ColumnName == "Gift Amount")
                {
                    ACalc.AddParameter("param_gift_amount_column", Counter);
                }
            }
        }
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);

            int MaxColumns = ACalc.GetParameters().Get("MaxDisplayColumns").ToInt();

            for (int Counter = 0; Counter <= MaxColumns; ++Counter)
            {
                String ColumnName = ACalc.GetParameters().Get("param_calculation", Counter, 0).ToString();

                if (ColumnName == "Gift Amount")
                {
                    ACalc.AddParameter("param_gift_amount_column", Counter);
                }
            }
        }
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            if (chkOnlyTravelDay.Checked)
            {
                if (!dtpTravelDay.ValidDate(false))
                {
                    TVerificationResult VerificationResult = new TVerificationResult(
                        Catalog.GetString("Please insert a valid date in the \"Travel Selection\" Settings."),
                        Catalog.GetString("No valid date."),
                        TResultSeverity.Resv_Critical);
                    FPetraUtilsObject.AddVerificationResult(VerificationResult);
                }

                ACalc.AddParameter("param_dtpTravelDay", this.dtpTravelDay.Date);
            }
        }
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);
            ACalc.AddParameter("param_currency", "base");
            ACalc.AddParameter("param_ytd", "mixed");
            ACalc.AddParameter("param_start_period_i", txtEndPeriod.Text);

            if (rbtQuarter.Checked)
            {
                ACalc.AddParameter("param_end_period_i", (Convert.ToInt16(txtQuarter.Text) * 3).ToString());
            }

            ACalc.AddParameter("param_explicit_motivation", "");
            ACalc.AddParameter("param_exclude_motivation", "");
            //ACalc.AddParameter("param_selectedAreasFunds", );
        }
Exemplo n.º 24
0
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);
            ACalc.AddColumnLayout(0, 8, 0, 3);
            ACalc.AddColumnLayout(1, 11, 0, 3);
            ACalc.AddColumnLayout(2, 14, 0, 7);
            ACalc.SetMaxDisplayColumns(3);
            ACalc.AddColumnCalculation(0, "Debit");
            ACalc.AddColumnCalculation(1, "Credit");
            ACalc.AddColumnCalculation(2, "Transaction Narrative");
            ACalc.AddParameter("param_daterange", "false");
            ACalc.AddParameter("param_rgrAccounts", "AllAccounts");
            ACalc.AddParameter("param_rgrCostCentres", "CostCentreList");
            // TODO need to allow to specify an ICH run number
            ACalc.AddParameter("param_ich_number", 0);

            ACalc.AddStringParameter("param_cost_centre_codes", clbCostCentres.GetCheckedStringList(true));
        }
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);

            int MaxColumns = ACalc.GetParameters().Get("MaxDisplayColumns").ToInt();

            for (int Counter = 0; Counter <= MaxColumns; ++Counter)
            {
                String ColumnName = ACalc.GetParameters().Get("param_calculation", Counter, 0).ToString();

                if (ColumnName == "Total Gifts")
                {
                    ACalc.AddParameter("param_gift_amount_column", Counter);
                }
            }

            // this parameter is added incorrectly by the generated code
            ACalc.RemoveParameter("param_minimum_amount");
            ACalc.AddParameter("param_minimum_amount", this.txtMinimumAmount.NumberValueDecimal);
        }
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);
            Int32 FilterByPaymentNum = 0;

            if ((txtPaymentNumFrom.Text != "") && (txtPaymentNumTo.Text != ""))
            {
                FilterByPaymentNum = 1;
            }

            Int32 FilterByDate = 0;

            if ((dtpPaymentDateFrom.Text != "") && (dtpPaymentDateTo.Text != ""))
            {
                FilterByDate = 1;
            }

            ACalc.AddParameter("param_filter_by_date", FilterByDate);
            ACalc.AddParameter("param_filter_by_payment_num", FilterByPaymentNum);
            DefineReportColumns(ACalc);
        }
        /// <summary>
        /// Reads the selected values from the controls, and stores them into the parameter system of FCalculator
        /// </summary>
        /// <param name="ACalc"></param>
        /// <param name="AReportAction"></param>
        public void ReadControls(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            ACalc.AddParameter("param_city", this.txtCity.Text);
            ACalc.AddParameter("param_county", this.txtCounty.Text);
            ACalc.AddParameter("param_postcode_from", this.txtPostCodeFrom.Text);
            ACalc.AddParameter("param_postcode_to", this.txtPostCodeTo.Text);
            ACalc.AddParameter("param_region", this.cmbRegion.GetSelectedString());
            ACalc.AddParameter("param_country", this.cmbCountry.GetSelectedString());

            // manually add validity date here until we introduce a checkbox and/or date field in control
            ACalc.AddParameter("param_only_addresses_valid_on", this.chkCurrentAddressesOnly.Checked);
            ACalc.AddParameter("param_address_date_valid_on", DateTime.Today);

            if (!chkCurrentAddressesOnly.Checked)
            {
                // make sure that date values are only added as parameters if fields are visible
                if (dtpAddressStartFrom.Visible)
                {
                    ACalc.AddParameter("param_address_start_from", this.dtpAddressStartFrom.Date);
                }

                if (dtpAddressStartTo.Visible)
                {
                    ACalc.AddParameter("param_address_start_to", this.dtpAddressStartTo.Date);
                }

                if (dtpAddressEndFrom.Visible)
                {
                    ACalc.AddParameter("param_address_end_from", this.dtpAddressEndFrom.Date);
                }

                if (dtpAddressEndTo.Visible)
                {
                    ACalc.AddParameter("param_address_end_to", this.dtpAddressEndTo.Date);
                }
            }
        }
Exemplo n.º 28
0
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            if (AReportAction == TReportActionEnum.raGenerate)
            {
                TVerificationResult VerificationResult = null;
                long UnitKey = 0;

                try
                {
                    UnitKey = Convert.ToInt64(txtPartnerKey.Text);
                }
                catch (Exception)
                {
                    UnitKey = 0;
                }

                if (UnitKey == 0)
                {
                    VerificationResult = new TVerificationResult("Insert a valid Key.",
                        "No Unit Key selected!",
                        TResultSeverity.Resv_Critical);
                    FPetraUtilsObject.AddVerificationResult(VerificationResult);
                }
            }

            int ColumnCounter;

            ColumnCounter = 0;
            ACalc.AddParameter("param_calculation", "UnitKey", ColumnCounter);
            ACalc.AddParameter("ColumnWidth", "3", ColumnCounter);
            ++ColumnCounter;
            ACalc.AddParameter("param_calculation", "UnitType", ColumnCounter);
            ACalc.AddParameter("ColumnWidth", "4.5", ColumnCounter);
            ++ColumnCounter;
            ACalc.AddParameter("param_calculation", "UnitName", ColumnCounter);
            ACalc.AddParameter("ColumnWidth", "12", ColumnCounter);

            ACalc.SetMaxDisplayColumns(3);

            ACalc.AddParameter("param_txtUnitCode", txtPartnerKey.Text);
        }
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);
            ACalc.AddParameter("param_currency", "base");
            ACalc.AddParameter("param_ytd", "mixed");
            ACalc.AddParameter("param_currency", "base");
            ACalc.AddParameter("param_depth", "standard");

            String CountryCode = "*";

            if (chkOnlyFromCountry.Checked)
            {
                CountryCode = cmbCountry.GetSelectedString();

                if (CountryCode.Length == 0)
                {
                    CountryCode = "*";
                }
            }

            ACalc.AddParameter("param_country_code", CountryCode);
        }
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            if ((AReportAction == TReportActionEnum.raGenerate)
                && (rbtPartner.Checked && (txtRecipient.Text == "0000000000")))
            {
                TVerificationResult VerificationResult = new TVerificationResult(
                    Catalog.GetString("No recipient selected."),
                    Catalog.GetString("Please select a recipient."),
                    TResultSeverity.Resv_Critical);
                FPetraUtilsObject.AddVerificationResult(VerificationResult);
            }

            if ((AReportAction == TReportActionEnum.raGenerate)
                && rbtExtract.Checked
                && (txtExtract.Text == ""))
            {
                TVerificationResult VerificationMessage = new TVerificationResult(
                    Catalog.GetString("Enter an extract name."),
                    Catalog.GetString("No extract name entered!"), TResultSeverity.Resv_Critical);
                FPetraUtilsObject.AddVerificationResult(VerificationMessage);
            }

            if ((AReportAction == TReportActionEnum.raGenerate)
                && rbtSelectedFields.Checked
                && (clbFields.GetCheckedStringList().Length == 0))
            {
                TVerificationResult VerificationMessage = new TVerificationResult(
                    Catalog.GetString("Please select at least one field."),
                    Catalog.GetString("No fields selected!"), TResultSeverity.Resv_Critical);
                FPetraUtilsObject.AddVerificationResult(VerificationMessage);
            }

            if ((AReportAction == TReportActionEnum.raGenerate)
                && rbtSelectedTypes.Checked
                && (clbTypes.GetCheckedStringList().Length == 0))
            {
                TVerificationResult VerificationMessage = new TVerificationResult(
                    Catalog.GetString("Please select at least one type."),
                    Catalog.GetString("No types selected!"), TResultSeverity.Resv_Critical);
                FPetraUtilsObject.AddVerificationResult(VerificationMessage);
            }

            ACalc.AddParameter("param_recipient_key", txtRecipient.Text);
            ACalc.AddParameter("param_extract_name", txtExtract.Text);

            ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);

            //TODO: Calendar vs Financial Date Handling - Confirm that these should not be ledger dates, i.e. allowing for >12 periods and non-calendar period boundaries
            DateTime FromDateThisYear = new DateTime(DateTime.Today.Year, 1, 1);
            DateTime ToDatePreviousYear = new DateTime(DateTime.Today.Year - 1, 12, 31);
            DateTime FromDatePreviousYear = new DateTime(DateTime.Today.Year - 1, 1, 1);

            ACalc.AddParameter("Year0", DateTime.Today.Year);
            ACalc.AddParameter("Year1", DateTime.Today.Year - 1);
            ACalc.AddParameter("Year2", DateTime.Today.Year - 2);
            ACalc.AddParameter("Year3", DateTime.Today.Year - 3);

            ACalc.AddParameter("param_to_date_0", DateTime.Today);
            ACalc.AddParameter("param_from_date_0", FromDateThisYear);
            ACalc.AddParameter("param_to_date_1", ToDatePreviousYear);
            ACalc.AddParameter("param_from_date_1", FromDatePreviousYear);
            ACalc.AddParameter("param_to_date_2", ToDatePreviousYear.AddYears(-1));
            ACalc.AddParameter("param_from_date_2", FromDatePreviousYear.AddYears(-1));
            ACalc.AddParameter("param_to_date_3", ToDatePreviousYear.AddYears(-2));
            ACalc.AddParameter("param_from_date_3", FromDatePreviousYear.AddYears(-2));

            int ColumnCounter = 0;
            ACalc.AddParameter("param_calculation", "PartnerKey", ColumnCounter);
            ACalc.AddParameter("ColumnWidth", (float)2.5, ColumnCounter);
            ++ColumnCounter;
            ACalc.AddParameter("param_calculation", "DonorName", ColumnCounter);
            ACalc.AddParameter("ColumnWidth", (float)6.0, ColumnCounter);
            ++ColumnCounter;
            ACalc.AddParameter("param_calculation", "DonorClass", ColumnCounter);
            ACalc.AddParameter("ColumnWidth", (float)3.0, ColumnCounter);
            ++ColumnCounter;
            ACalc.AddParameter("param_calculation", "Year-0", ColumnCounter);
            ACalc.AddParameter("ColumnWidth", (float)2.0, ColumnCounter);
            ++ColumnCounter;
            ACalc.AddParameter("param_calculation", "Year-1", ColumnCounter);
            ACalc.AddParameter("ColumnWidth", (float)2.0, ColumnCounter);
            ++ColumnCounter;
            ACalc.AddParameter("param_calculation", "Year-2", ColumnCounter);
            ACalc.AddParameter("ColumnWidth", (float)2.0, ColumnCounter);
            ++ColumnCounter;
            ACalc.AddParameter("param_calculation", "Year-3", ColumnCounter);
            ACalc.AddParameter("ColumnWidth", (float)2.0, ColumnCounter);
            ++ColumnCounter;

            ACalc.SetMaxDisplayColumns(ColumnCounter);
        }