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


C# TParameterList.Add方法代码示例

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


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

示例1: TestGeneralParametersProcessing

        public void TestGeneralParametersProcessing()
        {
            TParameterList parameters = new TParameterList();

            TVariant value = new TVariant();

            value.ApplyFormatString("Currency");
            Assert.AreEqual("0", value.ToFormattedString(), "null value for currency should be 0");
            value = new TVariant(value.ToFormattedString());
            parameters.Add("amountdue", value, -1, 2, null, null, ReportingConsts.CALCULATIONPARAMETERS);
            parameters.Save("testDebug.csv", true);
            Assert.AreEqual(true, parameters.Exists("amountdue", -1, 1, eParameterFit.eBestFitEvenLowerLevel), "can find added parameter");
            Assert.AreEqual("0", parameters.Get("amountdue", -1, 2,
                    eParameterFit.eBestFit).ToFormattedString(), "currency parameter is stored not correctly");
            //Assert.AreEqual("0", parameters.Get("amountdue", -1, 1, eParameterFit.eBestFit).ToFormattedString(), "currency parameter is stored not correctly");
            Assert.AreEqual("0", parameters.Get("amountdue", -1, 1,
                    eParameterFit.eBestFitEvenLowerLevel).ToFormattedString(), "currency parameter cannot be accessed from level up");

            parameters.Add("IntegerList", "300,400");
            parameters.Save("test.csv", false);
            parameters.Load(Path.GetFullPath("test.csv"));
            Assert.AreEqual("eString:300,400", parameters.Get(
                    "IntegerList").EncodeToString(), "integers separated by comma should be treated as string");
            parameters.Save("test2.csv", true);
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:25,代码来源:testParameters.cs

示例2: RunOnceOnActivationManual

        private void RunOnceOnActivationManual()
        {
            if (CalledFromExtracts)
            {
                tabReportSettings.Controls.Remove(tpgColumns);
            }

            var addressSettings = new TParameterList();
            addressSettings.Add("param_active", true);
            addressSettings.Add("param_mailing_addresses_only", true);
            addressSettings.Add("param_families_only", false);
            addressSettings.Add("param_exclude_no_solicitations", true);
            ucoChkFilter.SetControls(addressSettings);
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:14,代码来源:PartnerByContactLog.ManualCode.cs

示例3: InitialiseData

        /// <summary>
        /// Initialisation
        /// </summary>
        public void InitialiseData(TFrmPetraReportingUtils APetraUtilsObject)
        {
            FUpdatingRelationColumns = false;

            FPetraUtilsObject = APetraUtilsObject;

            FColumnParameters = new TParameterList();
            FColumnParameters.Add("MaxDisplayColumns", 0);
            FPetraUtilsObject.FMaxDisplayColumns = 0;

            FDuringApplyOrCancel = false;

            FSelectedColumn = -1;

            grdColumns.SortableHeaders = false;
            grdColumns.SelectionMode = SourceGrid.GridSelectionMode.Column;
            grdColumns.AutoStretchColumnsToFitWidth = false;

            /* Hook up event that fires when a different row is selected */
            grdColumns.Selection.FocusColumnEntered += new ColumnEventHandler(this.GrdColumns_FocusColumnEntered);
            grdColumns.Selection.CellLostFocus += new ChangeActivePositionEventHandler(this.GrdColumns_CellLostFocus);
            grdColumns.Selection.CellGotFocus += new ChangeActivePositionEventHandler(this.GrdColumns_CellGotFocus);


            btnApply.Enabled = false;
            btnCancel.Enabled = false;
            rbtFromGL.Checked = true;
            rbtFromGL.Enabled = false;
            rbtCalculateExisting.Enabled = false;
            cmbYearSelection.Enabled = false;
            chkYTD.Enabled = false;
            clbLedger.Enabled = false;
        }
开发者ID:js1987,项目名称:openpetragit,代码行数:36,代码来源:UC_FinanceColumns.ManualCode.cs

示例4: SetParameters

        /// <summary>
        /// Used for passing a Partner's partner key to the screen before the screen is actually shown.
        /// </summary>
        /// <param name="APartnerKey">PartnerKey of the Partner to print.</param>
        public void SetParameters(Int64 APartnerKey)
        {
            TParameterList Parameters = new TParameterList();

            Parameters.Add("param_selection", "one partner");
            Parameters.Add("param_partnerkey", APartnerKey);
            this.ucoPartnerSelection.SetControls(Parameters);
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:12,代码来源:PrintPartner.ManualCode.cs

示例5: GiftStatementParameters

        // parameters to be passed to Gift Statement screens
        private TParameterList GiftStatementParameters(TFrmDonorGiftStatement ADonor = null)
        {
            TParameterList ReturnValue = new TParameterList();

            // if btnDonorGiftStatement was clicked
            if (ADonor != null)
            {
                ReturnValue.Add("param_donor", "One Donor");
                ReturnValue.Add("param_donorkey", FDonorKey);

                TRptCalculator Calc = new TRptCalculator();
                ADonor.ReadControls(Calc, TReportActionEnum.raLoad);
                ReturnValue.Add("param_min_amount", Calc.GetParameters().GetParameter("param_min_amount").value);
                ReturnValue.Add("param_max_amount", Calc.GetParameters().GetParameter("param_max_amount").value);
            }
            else
            {
                ReturnValue.Add("param_recipient", "One Recipient");
                ReturnValue.Add("param_recipientkey", FRecipientKey);
            }

            DateTime FromDate = DateTime.MaxValue;
            DateTime ToDate = DateTime.MinValue;

            // if no dates are enter use the earliest and latest dates available in the dataset
            if (string.IsNullOrEmpty(FDateFrom) || string.IsNullOrEmpty(FDateTo))
            {
                foreach (DataRow Row in FMainDS.Tables[TEMP_TABLE_NAME].Rows)
                {
                    if ((DateTime)Row["DateEntered"] < FromDate)
                    {
                        FromDate = (DateTime)Row["DateEntered"];
                    }

                    if ((DateTime)Row["DateEntered"] > ToDate)
                    {
                        ToDate = (DateTime)Row["DateEntered"];
                    }
                }
            }

            if (!string.IsNullOrEmpty(FDateFrom))
            {
                ReturnValue.Add("param_from_date", Convert.ToDateTime(FDateFrom));
            }
            else
            {
                ReturnValue.Add("param_from_date", FromDate);
            }

            if (!string.IsNullOrEmpty(FDateTo))
            {
                ReturnValue.Add("param_to_date", Convert.ToDateTime(FDateTo));
            }
            else
            {
                ReturnValue.Add("param_to_date", ToDate);
            }

            return ReturnValue;
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:62,代码来源:DonorRecipientHistory.ManualCode.cs

示例6: CreateFamilyExtractForPersons

        public static Boolean CreateFamilyExtractForPersons(int ABaseExtractId, ref int AExtractId, String AExtractName, String AExtractDescription)
        {
            Boolean ResultValue = false;
            TParameterList ParameterList = new TParameterList();
            TResultList ResultList = new TResultList();

            ParameterList.Add("param_base_extract", ABaseExtractId);
            ParameterList.Add("param_extract_name", AExtractName);
            ParameterList.Add("param_extract_description", AExtractDescription);
            ResultValue = Ict.Petra.Server.MPartner.queries.QueryFamilyExtractForPersons.CalculateExtract
                              (ParameterList, ResultList, out AExtractId);

            return ResultValue;
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:14,代码来源:ExtractMaster.cs

示例7: SwitchColumn

        /// <summary>
        /// This procedure will switch the two columns
        /// </summary>
        /// <param name="AColumnParameters">List with the current columns</param>
        /// <param name="AFrom">Index of the column to move</param>
        /// <param name="ATo">Index of the new position of the column to move</param>
        /// <returns>void</returns>
        public static void SwitchColumn(ref TParameterList AColumnParameters, int AFrom, int ATo)
        {
            System.Int32 MaxDisplayColumns;
            System.Int32 Counter;
            System.Int32 ReferencedColumn;

            AColumnParameters.SwitchColumn(AFrom, ATo);

            /* switch the referenced columns in calculation */
            MaxDisplayColumns = AColumnParameters.Get("MaxDisplayColumns").ToInt();

            for (Counter = 0; Counter <= MaxDisplayColumns - 1; Counter += 1)
            {
                if (AColumnParameters.Exists("FirstColumn", Counter))
                {
                    ReferencedColumn = AColumnParameters.Get("FirstColumn", Counter).ToInt();

                    if (ReferencedColumn == AFrom)
                    {
                        ReferencedColumn = ATo;
                    }
                    else if (ReferencedColumn == ATo)
                    {
                        ReferencedColumn = AFrom;
                    }

                    AColumnParameters.Add("FirstColumn", new TVariant(ReferencedColumn), Counter);
                }

                if (AColumnParameters.Exists("SecondColumn", Counter))
                {
                    ReferencedColumn = AColumnParameters.Get("SecondColumn", Counter).ToInt();

                    if (ReferencedColumn == AFrom)
                    {
                        ReferencedColumn = ATo;
                    }
                    else if (ReferencedColumn == ATo)
                    {
                        ReferencedColumn = AFrom;
                    }

                    AColumnParameters.Add("SecondColumn", new TVariant(ReferencedColumn), Counter);
                }
            }
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:53,代码来源:UC_ColumnHelper.cs

示例8: CalculateReport

        /// <summary>
        /// calculate the report and save the result and returned parameters to file
        /// </summary>
        public static void CalculateReport(string AReportParameterXmlFile, TParameterList ASpecificParameters, int ALedgerNumber = -1)
        {
            // important: otherwise month names are in different language, etc
            Thread.CurrentThread.CurrentCulture = new CultureInfo("en-GB", false);

            TReportGeneratorUIConnector ReportGenerator = new TReportGeneratorUIConnector();
            TParameterList Parameters = new TParameterList();
            string resultFile = AReportParameterXmlFile.Replace(".xml", ".Results.xml");
            string parameterFile = AReportParameterXmlFile.Replace(".xml", ".Parameters.xml");
            Parameters.Load(AReportParameterXmlFile);

            if (ALedgerNumber != -1)
            {
                Parameters.Add("param_ledger_number_i", ALedgerNumber);
            }

            Parameters.Add(ASpecificParameters);

            ReportGenerator.Start(Parameters.ToDataTable());

            while (!ReportGenerator.Progress.JobFinished)
            {
                Thread.Sleep(500);
            }

            Assert.IsTrue(ReportGenerator.GetSuccess(), "Report did not run successfully");
            TResultList Results = new TResultList();

            Results.LoadFromDataTable(ReportGenerator.GetResult());
            Parameters.LoadFromDataTable(ReportGenerator.GetParameter());

            if (!Parameters.Exists("ControlSource", ReportingConsts.HEADERPAGELEFT1, -1, eParameterFit.eBestFit))
            {
                Parameters.Add("ControlSource", new TVariant("Left1"), ReportingConsts.HEADERPAGELEFT1);
            }

            if (!Parameters.Exists("ControlSource", ReportingConsts.HEADERPAGELEFT2, -1, eParameterFit.eBestFit))
            {
                Parameters.Add("ControlSource", new TVariant("Left2"), ReportingConsts.HEADERPAGELEFT2);
            }

            Parameters.Save(parameterFile, false);
            Results.WriteCSV(Parameters, resultFile, ",", false, false);
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:47,代码来源:ReportTesting.tools.cs

示例9: SetControls

        /// <summary>
        /// Sets the selected values in the controls, using the parameters loaded from a file
        ///
        /// </summary>
        /// <param name="AColumnParameters">List with the current columns</param>
        /// <param name="AParameters"></param>
        /// <returns>the MaxDisplayColumns number</returns>
        public static System.Int32 SetControls(ref TParameterList AColumnParameters, ref TParameterList AParameters)
        {
            System.Int32 MaxDisplayColumns = 0;

            /* copy values for columns to the current set of parameters */
            AColumnParameters.Clear();

            if (AParameters.Exists("MaxDisplayColumns"))
            {
                MaxDisplayColumns = AParameters.Get("MaxDisplayColumns").ToInt();
            }

            AColumnParameters.Add("MaxDisplayColumns", MaxDisplayColumns);

            for (int Counter = 0; Counter <= MaxDisplayColumns - 1; Counter += 1)
            {
                AColumnParameters.Copy(AParameters, Counter, -1, eParameterFit.eExact, Counter);
            }

            return MaxDisplayColumns;
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:28,代码来源:UC_ColumnHelper.cs

示例10: AddColumn

        /// <summary>
        /// Adds a new column to the column parameter list at the specified index.
        /// </summary>
        /// <param name="AColumnParameters">List with the current columns</param>
        /// <param name="AColumnIndex">Index where the new column is added</param>
        /// <returns>the MaxDisplayColumns number</returns>
        public static System.Int32 AddColumn(ref TParameterList AColumnParameters, int AColumnIndex)
        {
            System.Int32 NewColumn;
            System.Int32 NewMaxColumn;
            System.Int32 Counter;

            if (AColumnIndex == -1)
            {
                NewMaxColumn = AColumnParameters.Get("MaxDisplayColumns").ToInt();
                NewColumn = NewMaxColumn;
                AColumnParameters.Add("MaxDisplayColumns", NewColumn + 1);
            }
            else
            {
                NewColumn = AColumnIndex + 1;
                NewMaxColumn = AColumnParameters.Get("MaxDisplayColumns").ToInt() + 1;
                AColumnParameters.Add("MaxDisplayColumns", NewMaxColumn);

                /* need to move the columns to the right */
                for (Counter = NewMaxColumn - 1; Counter >= NewColumn + 1; Counter -= 1)
                {
                    AColumnParameters.MoveColumn(Counter - 1, Counter);
                }
            }

            return NewColumn;
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:33,代码来源:UC_ColumnHelper.cs

示例11: RemoveColumn

        /// <summary>
        /// Remove one colum from the parameter list.
        /// </summary>
        /// <param name="AColumnParameters">List with the current columns</param>
        /// <param name="AColumnIndex">Index of the column to remove</param>
        /// <returns>the MaxDisplayColumns number</returns>
        public static System.Int32 RemoveColumn(ref TParameterList AColumnParameters, int AColumnIndex)
        {
            AColumnParameters.RemoveColumn(AColumnIndex);

            /* need to move the following columns to the left */
            System.Int32 MaxColumn = AColumnParameters.Get("MaxDisplayColumns").ToInt() - 1;

            for (int Counter = AColumnIndex + 1; Counter <= MaxColumn; Counter += 1)
            {
                AColumnParameters.MoveColumn(Counter, Counter - 1);
            }

            AColumnParameters.Add("MaxDisplayColumns", MaxColumn);

            return MaxColumn;
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:22,代码来源:UC_ColumnHelper.cs

示例12: MenuItemClick

        /// <summary>
        /// todoComment
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void MenuItemClick(System.Object sender, System.EventArgs e)
        {
            Int32 columnCounter;
            String detailReportCSV;
            String action;
            String query;
            String LineCode;

            DataRowView[] TheDataRowViewArray;
            TResult SelectedResult;
            String paramName;
            String paramValue;
            String SettingsDirectory;
            MenuItem ClickedMenuItem = (MenuItem)sender;
            TheDataRowViewArray = FGridView.SelectedDataRowsAsDataRowView;

            if (TheDataRowViewArray.Length <= 0)
            {
                // no row is selected
                return;
            }

            LineCode = TheDataRowViewArray[0][0].ToString();
            SelectedResult = null;

            foreach (TResult r in results.GetResults())
            {
                if (r.code == LineCode)
                {
                    SelectedResult = r;
                }
            }

            detailReportCSV = (String)ClickedMenuItem.Tag;
            StringHelper.GetNextCSV(ref detailReportCSV, ",");

            // get rid of the name
            action = StringHelper.GetNextCSV(ref detailReportCSV, ",");

            if (action == "PartnerEditScreen")
            {
#if TODO
                // get the partner key
                Int64 PartnerKey = Convert.ToInt64(SelectedResult.column[Convert.ToInt32(detailReportCSV)].ToString());
                // TODO: open Partner Edit screen with the given partner key
#endif
            }
            else if (action.IndexOf(".xml") != -1)
            {
                query = StringHelper.GetNextCSV(ref detailReportCSV, ",");
                FDetailParameters = new TParameterList(FOrigParameters);
                FDetailParameters.Add("param_whereSQL", query);

                // get the parameter names and values
                while (detailReportCSV.Length > 0)
                {
                    paramName = StringHelper.GetNextCSV(ref detailReportCSV, ",");
                    paramValue = StringHelper.GetNextCSV(ref detailReportCSV, ",");
                    FDetailParameters.Add(paramName, new TVariant(paramValue));
                }

                // add the values of the selected column (in this example the first one)
                for (columnCounter = 0; columnCounter <= FDetailParameters.Get("MaxDisplayColumns").ToInt() - 1; columnCounter += 1)
                {
                    FDetailParameters.Add("param_" +
                        FDetailParameters.Get("param_calculation", columnCounter).ToString(), SelectedResult.column[columnCounter]);
                }

                // action is a link to a settings file; it contains e.g. xmlfiles, currentReport, and column settings
                // TParameterList.Load adds the new parameters to the existing parameters
                SettingsDirectory = TClientSettings.ReportingPathReportSettings;
                FDetailParameters.Load(SettingsDirectory + '/' + action);
                GenerateReportInThread();
            }
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:80,代码来源:GridPreview.cs

示例13: TestPartnerBySpecialTypes

        public void TestPartnerBySpecialTypes()
        {
            CommonNUnitFunctions.ResetDatabase();

            string testFile = "../../csharp/ICT/Testing/lib/MPartner/server/Reporting/TestData/PartnerBySpecialTypes.xml";

            TParameterList SpecificParameters = new TParameterList();
            SpecificParameters.Add("param_address_date_valid_on", new TVariant(new DateTime(DateTime.Today.Year, 1, 1)));
            SpecificParameters.Add("param_explicit_specialtypes", new TVariant("LEDGER"));

            TReportTestingTools.CalculateReport(testFile, SpecificParameters);

            TReportTestingTools.TestResult(testFile);
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:14,代码来源:PartnerBySpecialTypes.test.cs


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