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


C# TParameterList.Get方法代码示例

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


在下文中一共展示了TParameterList.Get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: SetControls

 /// <summary>
 /// Sets the selected values in the controls, using the parameters loaded from a file
 /// </summary>
 /// <param name="AParameters"></param>
 public void SetControls(TParameterList AParameters)
 {
     chkActivePartners.Checked = AParameters.Get("param_active").ToBool();
     chkMailingAddressesOnly.Checked = AParameters.Get("param_mailing_addresses_only").ToBool();
     chkFamiliesOnly.Checked = AParameters.Get("param_families_only").ToBool();
     chkExcludeNoSolicitations.Checked = AParameters.Get("param_exclude_no_solicitations").ToBool();
 }
开发者ID:Davincier,项目名称:openpetra,代码行数:11,代码来源:UC_ExtractChkFilter.ManualCode.cs

示例3: RetrieveParameters

        /// <summary>
        /// retrieve parameters from client sent in AParameters and build up AParameterList to run SQL query
        /// </summary>
        /// <param name="AParameters"></param>
        /// <param name="ASqlStmt"></param>
        /// <param name="ASQLParameterList"></param>
        protected override void RetrieveParameters(TParameterList AParameters, ref string ASqlStmt, ref List <OdbcParameter>ASQLParameterList)
        {
            ICollection <String>param_explicit_specialtypes;

            // prepare list of special types
            param_explicit_specialtypes = AParameters.Get("param_explicit_specialtypes").ToString().Split(new Char[] { ',', });

            if (param_explicit_specialtypes.Count == 0)
            {
                throw new NoNullAllowedException("At least one option must be checked.");
            }

            // now add parameters to sql parameter list
            ASQLParameterList.Add(TDbListParameterValue.OdbcListParameterValue("specialtype", OdbcType.VarChar, param_explicit_specialtypes));
            ASQLParameterList.Add(new OdbcParameter("param_dateFieldsIncluded", OdbcType.Bit)
                {
                    Value = !AParameters.Get("param_date_set").IsZeroOrNull()
                });
            ASQLParameterList.Add(new OdbcParameter("Date", OdbcType.Date)
                {
                    Value = AParameters.Get("param_date_set").ToDate()
                });
            ASQLParameterList.Add(new OdbcParameter("param_active", OdbcType.Bit)
                {
                    Value = AParameters.Get("param_active").ToBool()
                });
            ASQLParameterList.Add(new OdbcParameter("param_families_only", OdbcType.Bit)
                {
                    Value = AParameters.Get("param_families_only").ToBool()
                });
            ASQLParameterList.Add(new OdbcParameter("param_exclude_no_solicitations", OdbcType.Bit)
                {
                    Value = AParameters.Get("param_exclude_no_solicitations").ToBool()
                });
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:41,代码来源:ExtractPartnerBySpecialType.cs

示例4: SetControlsManual

 private void SetControlsManual(TParameterList AParameters)
 {
     // param_reportday defines if the report is run on arrival or departuer days.
     if (AParameters.Get("param_reportday").ToString() == "Arrival")
     {
         rbtArrival.Checked = true;
     }
     else if (AParameters.Get("param_reportday").ToString() == "Departure")
     {
         rbtDeparture.Checked = true;
     }
 }
开发者ID:Davincier,项目名称:openpetra,代码行数:12,代码来源:ArrivalListingReport.ManualCode.cs

示例5: RetrieveParameters

        /// <summary>
        /// retrieve parameters from client sent in AParameters and build up AParameterList to run SQL query
        /// </summary>
        /// <param name="AParameters"></param>
        /// <param name="ASqlStmt"></param>
        /// <param name="ASQLParameterList"></param>
        protected override void RetrieveParameters(TParameterList AParameters, ref string ASqlStmt, ref List <OdbcParameter>ASQLParameterList)
        {
            // prepare list of selected events
            List <String>param_events = new List <String>();

            foreach (TVariant choice in AParameters.Get("param_events").ToComposite())
            {
                param_events.Add(choice.ToString());
            }

            if (param_events.Count == 0)
            {
                throw new NoNullAllowedException("At least one event must be checked.");
            }

            // prepare list of selected event roles (comes all in one comma separated string)
            List <String>param_event_roles = new List <String>();

            if (AParameters.Exists("param_event_roles"))
            {
                param_event_roles = new List <String>(AParameters.Get("param_event_roles").ToString().Split(','));
            }

            if (param_event_roles.Count == 0)
            {
                throw new NoNullAllowedException("At least one event role must be checked.");
            }

            // now add parameters to sql parameter list
            ASQLParameterList.Add(TDbListParameterValue.OdbcListParameterValue("events", OdbcType.BigInt, param_events));
            ASQLParameterList.Add(TDbListParameterValue.OdbcListParameterValue("event_roles", OdbcType.VarChar, param_event_roles));
            ASQLParameterList.Add(new OdbcParameter("Accepted", OdbcType.Bit)
                {
                    Value = AParameters.Get("param_status_accepted").ToBool()
                });
            ASQLParameterList.Add(new OdbcParameter("Hold", OdbcType.Bit)
                {
                    Value = AParameters.Get("param_status_hold").ToBool()
                });
            ASQLParameterList.Add(new OdbcParameter("Enquiry", OdbcType.Bit)
                {
                    Value = AParameters.Get("param_status_enquiry").ToBool()
                });
            ASQLParameterList.Add(new OdbcParameter("Cancelled", OdbcType.Bit)
                {
                    Value = AParameters.Get("param_status_cancelled").ToBool()
                });
            ASQLParameterList.Add(new OdbcParameter("Rejected", OdbcType.Bit)
                {
                    Value = AParameters.Get("param_status_rejected").ToBool()
                });
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:58,代码来源:ExtractPartnerByEventRole.cs

示例6: RetrieveParameters

        /// <summary>
        /// retrieve parameters from client sent in AParameters and build up AParameterList to run SQL query
        /// </summary>
        /// <param name="AParameters"></param>
        /// <param name="ASqlStmt"></param>
        /// <param name="ASQLParameterList"></param>
        protected override void RetrieveParameters(TParameterList AParameters, ref string ASqlStmt, ref List <OdbcParameter>ASQLParameterList)
        {
            // prepare list of selected publications
            List <String>param_explicit_publication = new List <String>();

            foreach (TVariant choice in AParameters.Get("param_explicit_publication").ToComposite())
            {
                param_explicit_publication.Add(choice.ToString());
            }

            // now add parameters to sql parameter list
            ASQLParameterList.Add(TDbListParameterValue.OdbcListParameterValue("param_explicit_publication",
                    OdbcType.VarChar,
                    param_explicit_publication));

            ASQLParameterList.Add(new OdbcParameter("param_free_subscriptions_only", OdbcType.Bit)
                {
                    Value = AParameters.Get("param_free_subscriptions_only").ToBool()
                });

            ASQLParameterList.Add(new OdbcParameter("param_include_active_subscriptions_only", OdbcType.Bit)
                {
                    Value = AParameters.Get("param_include_active_subscriptions_only").ToBool()
                });

            ASQLParameterList.Add(new OdbcParameter("param_include_active_subscriptions_only", OdbcType.Bit)
                {
                    Value = AParameters.Get("param_include_active_subscriptions_only").ToBool()
                });

            ASQLParameterList.Add(new OdbcParameter("param_subscription_status", OdbcType.VarChar)
                {
                    Value = AParameters.Get("param_subscription_status").ToString()
                });

            ASQLParameterList.Add(new OdbcParameter("param_active", OdbcType.Bit)
                {
                    Value = AParameters.Get("param_active").ToBool()
                });
            ASQLParameterList.Add(new OdbcParameter("param_families_only", OdbcType.Bit)
                {
                    Value = AParameters.Get("param_families_only").ToBool()
                });
            ASQLParameterList.Add(new OdbcParameter("param_exclude_no_solicitations", OdbcType.Bit)
                {
                    Value = AParameters.Get("param_exclude_no_solicitations").ToBool()
                });
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:54,代码来源:ExtractPartnerBySubscription.cs

示例7: RetrieveParameters

 /// <summary>
 /// retrieve parameters from client sent in AParameters and build up AParameterList to run SQL query
 /// </summary>
 /// <param name="AParameters"></param>
 /// <param name="ASqlStmt"></param>
 /// <param name="ASQLParameterList"></param>
 protected override void RetrieveParameters(TParameterList AParameters, ref string ASqlStmt, ref List <OdbcParameter>ASQLParameterList)
 {
     // now add parameters to sql parameter list
     ASQLParameterList.Add(new OdbcParameter("city", OdbcType.VarChar)
         {
             Value = AParameters.Get("param_city").ToString()
         });
     ASQLParameterList.Add(new OdbcParameter("Date", OdbcType.Date)
         {
             Value = AParameters.Get("param_today").ToDate()
         });
     ASQLParameterList.Add(new OdbcParameter("Date", OdbcType.Date)
         {
             Value = AParameters.Get("param_today").ToDate()
         });
 }
开发者ID:Davincier,项目名称:openpetra,代码行数:22,代码来源:ExtractByPartnerCity.cs

示例8: RetrieveParameters

 /// <summary>
 /// retrieve parameters from client sent in AParameters and build up AParameterList to run SQL query
 /// </summary>
 /// <param name="AParameters"></param>
 /// <param name="ASqlStmt"></param>
 /// <param name="ASQLParameterList"></param>
 protected override void RetrieveParameters(TParameterList AParameters, ref string ASqlStmt, ref List <OdbcParameter>ASQLParameterList)
 {
     // now add parameters to sql parameter list
     ASQLParameterList.Add(new OdbcParameter("base_extract", OdbcType.Int)
         {
             Value = AParameters.Get("param_base_extract").ToString()
         });
 }
开发者ID:Davincier,项目名称:openpetra,代码行数:14,代码来源:ExtractFamilyMembers.cs

示例9: 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

示例10: RetrieveParameters

        /// <summary>
        /// retrieve parameters from client sent in AParameters and build up AParameterList to run SQL query
        /// </summary>
        /// <param name="AParameters"></param>
        /// <param name="ASqlStmt"></param>
        /// <param name="ASQLParameterList"></param>
        protected override void RetrieveParameters(TParameterList AParameters, ref string ASqlStmt, ref List <OdbcParameter>ASQLParameterList)
        {
            // prepare list of selected events
            List <String>param_events = new List <String>();

            foreach (TVariant choice in AParameters.Get("param_events").ToComposite())
            {
                param_events.Add(choice.ToString());
            }

            if (param_events.Count == 0)
            {
                throw new NoNullAllowedException("At least one option must be checked.");
            }

            // now add parameters to sql parameter list
            ASQLParameterList.Add(TDbListParameterValue.OdbcListParameterValue("events", OdbcType.BigInt, param_events));
            ASQLParameterList.Add(new OdbcParameter("Accepted", OdbcType.Bit)
                {
                    Value = AParameters.Get("param_status_accepted").ToBool()
                });
            ASQLParameterList.Add(new OdbcParameter("Hold", OdbcType.Bit)
                {
                    Value = AParameters.Get("param_status_hold").ToBool()
                });
            ASQLParameterList.Add(new OdbcParameter("Enquiry", OdbcType.Bit)
                {
                    Value = AParameters.Get("param_status_enquiry").ToBool()
                });
            ASQLParameterList.Add(new OdbcParameter("Cancelled", OdbcType.Bit)
                {
                    Value = AParameters.Get("param_status_cancelled").ToBool()
                });
            ASQLParameterList.Add(new OdbcParameter("Rejected", OdbcType.Bit)
                {
                    Value = AParameters.Get("param_status_rejected").ToBool()
                });
            ASQLParameterList.Add(new OdbcParameter("Active", OdbcType.Bit)
                {
                    Value = AParameters.Get("param_active").ToBool()
                });
            ASQLParameterList.Add(new OdbcParameter("Exclude_no_soliciations", OdbcType.Bit)
                {
                    Value = AParameters.Get("param_exclude_no_solicitations").ToBool()
                });
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:52,代码来源:ExtractByEvent.cs

示例11: SetControlsManual

        private void SetControlsManual(TParameterList AParameters)
        {
            String CountryCode = AParameters.Get("param_country_code").ToString();

            if ((CountryCode.Length > 0)
                && (CountryCode != "*"))
            {
                cmbCountry.SetSelectedString(CountryCode);
            }
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:10,代码来源:TotalGiftPerDonor.ManualCode.cs

示例12: CalculateExtract

        /// <summary>
        /// calculate an extract from a report: all partners in selected relationships with selected partner
        /// </summary>
        /// <param name="AParameters"></param>
        /// <param name="AResults"></param>
        /// <returns></returns>
        public static bool CalculateExtract(TParameterList AParameters, TResultList AResults)
        {
            string SqlStmt = "";

            if (AParameters.Get("param_selection").ToString() == "an extract")
            {
                SqlStmt = TDataBase.ReadSqlFile("Partner.Queries.ExtractFromExtractByPartnerRelationship.sql");
            }
            else if (AParameters.Get("param_selection").ToString() == "one partner")
            {
                SqlStmt = TDataBase.ReadSqlFile("Partner.Queries.ExtractByPartnerRelationship.sql");
            }
            else
            {
                throw new ArgumentException("Must supply an extract or partner key.");
            }

            // create a new object of this class and control extract calculation from base class
            QueryPartnerByRelationship ExtractQuery = new QueryPartnerByRelationship();

            return ExtractQuery.CalculateExtractInternal(AParameters, SqlStmt, AResults);
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:28,代码来源:ExtractPartnerByRelationship.cs

示例13: TReportPrinterLayout

        /// <summary>
        /// constructor
        /// </summary>
        /// <param name="AResult"></param>
        /// <param name="AParameters"></param>
        /// <param name="APrinter"></param>
        /// <param name="AWrapColumn">True: Wrap text in the column if it is to long. Otherwise cut it</param>
        public TReportPrinterLayout(TResultList AResult, TParameterList AParameters, TPrinter APrinter, bool AWrapColumn) : base(AResult, AParameters,
                                                                                                                                APrinter)
        {
            FWrapColumn = AWrapColumn;

            if (AParameters.Get("ReportWidth").ToDouble() > 20)
            {
                APrinter.Init(eOrientation.eLandscape, this, eMarginType.eDefaultMargins);
            }
            else
            {
                APrinter.Init(eOrientation.ePortrait, this, eMarginType.eDefaultMargins);
            }
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:21,代码来源:PrinterLayout.cs

示例14: RetrieveParameters

        /// <summary>
        /// retrieve parameters from client sent in AParameters and build up AParameterList to run SQL query
        /// </summary>
        /// <param name="AParameters"></param>
        /// <param name="ASqlStmt"></param>
        /// <param name="ASQLParameterList"></param>
        protected override void RetrieveParameters(TParameterList AParameters, ref string ASqlStmt, ref List <OdbcParameter>ASQLParameterList)
        {
            bool AllLedgers;

            ICollection <String>param_ledgers;

            AllLedgers = AParameters.Get("param_all_ledgers").ToBool();

            // now add parameters to sql parameter list
            ASQLParameterList.Add(new OdbcParameter("param_all_ledgers", OdbcType.Bit)
                {
                    Value = AllLedgers
                });

            if (AllLedgers)
            {
                // Add dummy value in case of an empty list so sql query does not fail.
                // This value is irrelevant in this case.
                ASQLParameterList.Add(new OdbcParameter("ledgers", OdbcType.BigInt)
                    {
                        Value = 0
                    });
            }
            else
            {
                // prepare list of ledgers
                param_ledgers = AParameters.Get("param_ledgers").ToString().Split(new Char[] { ',', });
                ASQLParameterList.Add(TDbListParameterValue.OdbcListParameterValue("ledgers", OdbcType.BigInt, param_ledgers));
            }

            ASQLParameterList.Add(new OdbcParameter("param_date_from_unset", OdbcType.Bit)
                {
                    Value = AParameters.Get("param_date_from").IsZeroOrNull()
                });
            ASQLParameterList.Add(new OdbcParameter("param_date_from", OdbcType.Date)
                {
                    Value = AParameters.Get("param_date_from").ToDate()
                });

            ASQLParameterList.Add(new OdbcParameter("param_date_to_unset", OdbcType.Bit)
                {
                    Value = AParameters.Get("param_date_to").IsZeroOrNull()
                });
            ASQLParameterList.Add(new OdbcParameter("param_date_to", OdbcType.Date)
                {
                    Value = AParameters.Get("param_date_to").ToDate()
                });
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:54,代码来源:ExtractRecipientByField.cs

示例15: GetFamilyKeys

        /// <summary>
        /// get the family keys of the specified persons
        /// </summary>
        /// <param name="AParameters"></param>
        /// <param name="AResults"></param>
        public static DataTable GetFamilyKeys(TParameterList AParameters, TResultList AResults)
        {
            SortedList <string, string>Defines = new SortedList <string, string>();
            List <OdbcParameter>SqlParameterList = new List <OdbcParameter>();

            try
            {
                // prepare the sql statement parameters
                AddPartnerSelectionParametersToSqlQuery(AParameters, Defines, SqlParameterList);
            }
            catch (Exception e)
            {
                TLogging.Log("problem while preparing sql statement for birthday report: " + e.ToString());
                return null;
            }

            string SqlStmt = TDataBase.ReadSqlFile("Personnel.Reports.GetFamilyKeyOfPerson.sql", Defines);
            Boolean NewTransaction;
            TDBTransaction Transaction = DBAccess.GDBAccessObj.GetNewOrExistingTransaction(IsolationLevel.ReadCommitted, out NewTransaction);

            try
            {
                // now run the database query
                DataTable resultTable = DBAccess.GDBAccessObj.SelectDT(SqlStmt, "result", Transaction,
                    SqlParameterList.ToArray());

                // if this is taking a long time, every now and again update the TLogging statusbar, and check for the cancel button
                if (AParameters.Get("CancelReportCalculation").ToBool() == true)
                {
                    return null;
                }

                return resultTable;
            }
            catch (Exception e)
            {
                TLogging.Log(e.ToString());
                return null;
            }
            finally
            {
                if (NewTransaction)
                {
                    DBAccess.GDBAccessObj.RollbackTransaction();
                }
            }
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:52,代码来源:ReportBirthday.cs


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