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


C# TParameterList.Exists方法代码示例

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


在下文中一共展示了TParameterList.Exists方法的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: 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

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

示例4: AddAddressFilter

        /// <summary>
        /// extend query statement and query parameter list by address filter information given in extract parameters
        /// </summary>
        /// <param name="AParameters"></param>
        /// <param name="ASqlStmt"></param>
        /// <param name="AOdbcParameterList"></param>
        /// <returns>true if address tables and fields were added</returns>
        protected static bool AddAddressFilter(TParameterList AParameters, ref string ASqlStmt,
            ref List <OdbcParameter>AOdbcParameterList)
        {
            string WhereClause = "";
            string TableNames = "";
            string FieldNames = "";
            string OrderByClause = "";
            string StringValue;
            DateTime DateValue;
            bool LocationTableNeeded = false;
            bool PartnerLocationTableNeeded = false;
            bool AddressFilterAdded = false;

            // add check for mailing addresses only
            if (AParameters.Exists("param_mailing_addresses_only"))
            {
                if (AParameters.Get("param_mailing_addresses_only").ToBool())
                {
                    WhereClause = WhereClause + " AND pub_p_partner_location.p_send_mail_l";
                    PartnerLocationTableNeeded = true;
                }
            }

            // add city statement (allow any city that begins with search string)
            if (AParameters.Exists("param_city"))
            {
                StringValue = AParameters.Get("param_city").ToString();

                if ((StringValue.Trim().Length > 0) && (StringValue != "*"))
                {
                    AOdbcParameterList.Add(new OdbcParameter("param_city", OdbcType.VarChar)
                        {
                            Value = StringValue + "%"
                        });
                    WhereClause = WhereClause + " AND pub_p_location.p_city_c LIKE ?";
                    LocationTableNeeded = true;
                }
            }

            // add county statement (allow any county that begins with search string)
            if (AParameters.Exists("param_county"))
            {
                StringValue = AParameters.Get("param_county").ToString();

                if ((StringValue.Trim().Length > 0) && (StringValue != "*"))
                {
                    AOdbcParameterList.Add(new OdbcParameter("param_county", OdbcType.VarChar)
                        {
                            Value = StringValue + "%"
                        });
                    WhereClause = WhereClause + " AND pub_p_location.p_county_c LIKE ?";
                    LocationTableNeeded = true;
                }
            }

            // add statement for country
            if (AParameters.Exists("param_country"))
            {
                StringValue = AParameters.Get("param_country").ToString();

                if (StringValue.Trim().Length > 0)
                {
                    AOdbcParameterList.Add(new OdbcParameter("param_country", OdbcType.VarChar)
                        {
                            Value = StringValue
                        });
                    WhereClause = WhereClause + " AND pub_p_location.p_country_code_c = ?";
                    LocationTableNeeded = true;
                }
            }

            // postcode filter will be applied after the data is obtained
            if (AParameters.Exists("param_region") || AParameters.Exists("param_postcode_from") || AParameters.Exists("param_postcode_to"))
            {
                LocationTableNeeded = true;
            }

            // add date clause if address should only be valid at a certain date
            if (AParameters.Exists("param_only_addresses_valid_on")
                && (AParameters.Get("param_only_addresses_valid_on").ToBool()))
            {
                if (AParameters.Exists("param_address_date_valid_on")
                    && !AParameters.Get("param_address_date_valid_on").IsZeroOrNull())
                {
                    DateValue = AParameters.Get("param_address_date_valid_on").ToDate();
                }
                else
                {
                    // if date not given then use "Today"
                    DateValue = DateTime.Today;
                }

                AOdbcParameterList.Add(new OdbcParameter("param_address_date_valid_on_1", OdbcType.Date)
//.........这里部分代码省略.........
开发者ID:js1987,项目名称:openpetragit,代码行数:101,代码来源:ExtractBase.cs

示例5: PostcodeFilter

        /// <summary>
        /// Filter data by postcode (if applicable)
        /// </summary>
        /// <param name="APartnerkeys"></param>
        /// <param name="AAddressFilterAdded"></param>
        /// <param name="AParameters"></param>
        /// <param name="ATransaction"></param>
        public static void PostcodeFilter(ref DataTable APartnerkeys,
            ref bool AAddressFilterAdded,
            TParameterList AParameters,
            TDBTransaction ATransaction)
        {
            // if filter exists
            if ((AParameters.Exists("param_region") && !string.IsNullOrEmpty(AParameters.Get("param_region").ToString()))
                || (AParameters.Exists("param_postcode_from") && !string.IsNullOrEmpty(AParameters.Get("param_postcode_from").ToString()))
                || (AParameters.Exists("param_postcode_to") && !string.IsNullOrEmpty(AParameters.Get("param_postcode_to").ToString())))
            {
                DataTable partnerkeysCopy = APartnerkeys.Copy();
                int i = 0;

                foreach (DataRow Row in partnerkeysCopy.Rows)
                {
                    // get postcode for current partner's location
                    PLocationRow LocationRow = (PLocationRow)PLocationAccess.LoadByPrimaryKey(
                        Convert.ToInt64(Row["p_site_key_n"]), Convert.ToInt32(Row["p_location_key_i"]),
                        ATransaction)[0];

                    if (!AddressMeetsPostCodeCriteriaOrEmpty(LocationRow.PostalCode,
                            AParameters.Get("param_region").ToString(),
                            AParameters.Get("param_postcode_from").ToString(),
                            AParameters.Get("param_postcode_to").ToString()))
                    {
                        // remove record if it is excluded by the filter
                        APartnerkeys.Rows.RemoveAt(i);
                    }
                    else
                    {
                        i++;
                    }
                }

                AAddressFilterAdded = true;
            }
        }
开发者ID:js1987,项目名称:openpetragit,代码行数:44,代码来源:ExtractBase.cs

示例6: CalculateBirthdays

        /// <summary>
        /// get all partners that we want to display on the current birthday report
        /// </summary>
        public static DataTable CalculateBirthdays(TParameterList AParameters, TResultList AResults)
        {
            SortedList <string, string>Defines = new SortedList <string, string>();
            List <OdbcParameter>SqlParameterList = new List <OdbcParameter>();

            try
            {
                // prepare the sql statement parameters
                if (AParameters.Exists("FamilyKey"))
                {
                    SqlParameterList.Add(new OdbcParameter("FamilyKey", OdbcType.Decimal)
                        {
                            Value = AParameters.Get("FamilyKey").ToDecimal()
                        });
                    Defines.Add("BYFAMILYKEY", string.Empty);
                }
                else
                {
                    AddPartnerSelectionParametersToSqlQuery(AParameters, Defines, SqlParameterList);
                }

                if (AParameters.Get("param_chkSelectTypes").ToBool() == true)
                {
                    string[] types = AParameters.Get("param_typecode").ToString().Split(new char[] { ',' });
                    string FilterForTypes = string.Empty;

                    foreach (string type in types)
                    {
                        if (FilterForTypes.Length > 0)
                        {
                            FilterForTypes += " OR ";
                        }

                        FilterForTypes += "pptype.p_type_code_c = ?";

                        SqlParameterList.Add(new OdbcParameter("typecode" + FilterForTypes.Length, OdbcType.VarChar)
                            {
                                Value = type
                            });
                    }

                    Defines.Add("SELECTTYPES", "(" + FilterForTypes + ")");
                }

                if (AParameters.Get("param_chkUseDate").ToBool() == true)
                {
                    DateTime FromDate = AParameters.Get("param_dtpFromDate").ToDate();
                    DateTime ToDate = AParameters.Get("param_dtpToDate").ToDate();

                    if (FromDate.DayOfYear < ToDate.DayOfYear)
                    {
                        Defines.Add("WITHDATERANGE", string.Empty);
                        SqlParameterList.Add(new OdbcParameter("startdate", OdbcType.Date)
                            {
                                Value = FromDate
                            });
                        SqlParameterList.Add(new OdbcParameter("enddate", OdbcType.Date)
                            {
                                Value = ToDate
                            });
                    }
                    else
                    {
                        Defines.Add("WITHOUTDATERANGE", string.Empty);
                        SqlParameterList.Add(new OdbcParameter("enddate", OdbcType.Date)
                            {
                                Value = ToDate
                            });
                        SqlParameterList.Add(new OdbcParameter("startdate", OdbcType.Date)
                            {
                                Value = FromDate
                            });
                    }
                }
            }
            catch (Exception e)
            {
                TLogging.Log("problem while preparing sql statement for birthday report: " + e.ToString());
                return null;
            }

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

            try
            {
                // now run the database query
                TLogging.Log("Getting the data from the database...", TLoggingType.ToStatusBar);
                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;
                }
//.........这里部分代码省略.........
开发者ID:Davincier,项目名称:openpetra,代码行数:101,代码来源:ReportBirthday.cs

示例7: SetControls

        /// <summary>
        /// Sets the selected values in the controls, using the parameters loaded from a file
        ///
        /// </summary>
        /// <param name="AParameters"></param>
        /// <returns>void</returns>
        public void SetControls(TParameterList AParameters)
        {
            Int32 StoredVal = 0;

            if (FLedgerNumber == -1)
            {
                // we will wait until the ledger number has been set
                return;
            }

            //TODO: Calendar vs Financial Date Handling - Check if below has assumed a 12 period financial year
            // TODO
            //          int DiffPeriod = 0;//(System.Int32)CbB_YearEndsOn.SelectedItem;
            //            DiffPeriod = DiffPeriod - 12;
            //            ACalculator.AddParameter("param_diff_period_i", DiffPeriod);

            cmbAccountHierarchy.SetSelectedString(AParameters.Get("param_account_hierarchy_c").ToString());
            cmbCurrency.SetSelectedString(AParameters.Get("param_currency").ToString());
            cmbPeriodYear.SetSelectedInt32(AParameters.Get("param_year_i").ToInt());
            cmbQuarterYear.SetSelectedInt32(AParameters.Get("param_year_i").ToInt());
            cmbBreakdownYear.SetSelectedInt32(AParameters.Get("param_year_i").ToInt());

            rbtQuarter.Checked = AParameters.Get("param_quarter").ToBool();
            rbtDate.Checked = AParameters.Get("param_date_checked").ToBool();
            rbtPeriod.Checked = AParameters.Get("param_period").ToBool();
            rbtBreakdown.Checked = AParameters.Get("param_period_breakdown").ToBool();

            if (!rbtPeriod.Checked && !rbtDate.Checked && !rbtQuarter.Checked && !rbtBreakdown.Checked)
            {
                rbtPeriod.Checked = true;
            }

            StoredVal = Math.Max((AParameters.Get("param_end_period_i").ToInt() / 3), 1);
            txtQuarter.Text = StoredVal.ToString();

            if (AParameters.Get("param_start_period_i").ToString().Length == 0)
            {
                txtStartPeriod.Text = FLedgerRow.CurrentPeriod.ToString();
            }
            else
            {
                StoredVal = Math.Max(AParameters.Get("param_start_period_i").ToInt(), 1);
                txtStartPeriod.Text = StoredVal.ToString();
            }

            if (AParameters.Get("param_end_period_i").ToString().Length == 0)
            {
                txtEndPeriod.Text = FLedgerRow.CurrentPeriod.ToString();
            }
            else
            {
                StoredVal = Math.Max(AParameters.Get("param_end_period_i").ToInt(), 1);
                txtEndPeriod.Text = StoredVal.ToString();
            }

            if (cmbPeriodYear.SelectedIndex == -1)
            {
                cmbPeriodYear.SetSelectedInt32(FLedgerRow.CurrentFinancialYear);
            }

            if (cmbQuarterYear.SelectedIndex == -1)
            {
                cmbQuarterYear.SetSelectedInt32(FLedgerRow.CurrentFinancialYear);
            }

            if (cmbBreakdownYear.SelectedIndex == -1)
            {
                cmbBreakdownYear.SetSelectedInt32(FLedgerRow.CurrentFinancialYear);
            }

            if (AParameters.Exists("param_start_date"))
            {
                dtpStartDate.Date = AParameters.Get("param_start_date").ToDate();
                dtpEndDate.Date = AParameters.Get("param_end_date").ToDate();
            }
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:82,代码来源:UC_GeneralSettings.ManualCode.cs

示例8: SetControls

 /// <summary>
 /// initialise the controls using the parameters
 /// </summary>
 /// <param name="AParameters"></param>
 public void SetControls(TParameterList AParameters)
 {
     for (Int32 counter = 0; counter < NUMBER_SORTBY; counter += 1)
     {
         if (AParameters.Exists("orderby" + counter.ToString()))
         {
             FSortByComboboxes[counter].SetSelectedString(AParameters.Get("orderby" + counter.ToString()).ToString());
         }
     }
 }
开发者ID:Davincier,项目名称:openpetra,代码行数:14,代码来源:UC_Sorting.ManualCode.cs

示例9: 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)
        {
            string WhereClause = "";
            string TableNames = "";
            string StringValue;

            // add parameters to sql parameter list

            // Partner Class
            ASQLParameterList.Add(new OdbcParameter("param_partner_class_unset", OdbcType.Bit)
                {
                    Value = AParameters.Get("param_partner_class").IsZeroOrNull()
                });
            ASQLParameterList.Add(new OdbcParameter("param_partner_class", OdbcType.VarChar)
                {
                    Value = AParameters.Get("param_partner_class").ToString()
                });

            // Language Code
            ASQLParameterList.Add(new OdbcParameter("param_language_unset", OdbcType.Bit)
                {
                    Value = AParameters.Get("param_language").IsZeroOrNull()
                });
            ASQLParameterList.Add(new OdbcParameter("param_language", OdbcType.VarChar)
                {
                    Value = AParameters.Get("param_language").ToString()
                });

            // Active Partners and No Solicitations
            ASQLParameterList.Add(new OdbcParameter("param_active", OdbcType.Bit)
                {
                    Value = AParameters.Get("param_active").ToBool()
                });
            ASQLParameterList.Add(new OdbcParameter("param_exclude_no_solicitations", OdbcType.Bit)
                {
                    Value = AParameters.Get("param_exclude_no_solicitations").ToBool()
                });

            // User that created/modified the record
            ASQLParameterList.Add(new OdbcParameter("param_user_created_unset", OdbcType.Bit)
                {
                    Value = AParameters.Get("param_user_created").IsZeroOrNull()
                });
            ASQLParameterList.Add(new OdbcParameter("param_user_created", OdbcType.VarChar)
                {
                    Value = AParameters.Get("param_user_created").ToString()
                });
            ASQLParameterList.Add(new OdbcParameter("param_user_modified_unset", OdbcType.Bit)
                {
                    Value = AParameters.Get("param_user_modified").IsZeroOrNull()
                });
            ASQLParameterList.Add(new OdbcParameter("param_user_modified", OdbcType.VarChar)
                {
                    Value = AParameters.Get("param_user_modified").ToString()
                });

            // Date range for creation and modification of record
            ASQLParameterList.Add(new OdbcParameter("param_date_created_from_unset", OdbcType.Bit)
                {
                    Value = AParameters.Get("param_date_created_from").IsZeroOrNull()
                });
            ASQLParameterList.Add(new OdbcParameter("param_date_created_from", OdbcType.Date)
                {
                    Value = AParameters.Get("param_date_created_from").ToDate()
                });
            ASQLParameterList.Add(new OdbcParameter("param_date_created_to_unset", OdbcType.Bit)
                {
                    Value = AParameters.Get("param_date_created_to").IsZeroOrNull()
                });
            ASQLParameterList.Add(new OdbcParameter("param_date_created_to", OdbcType.Date)
                {
                    Value = AParameters.Get("param_date_created_to").ToDate()
                });
            ASQLParameterList.Add(new OdbcParameter("param_date_modified_from_unset", OdbcType.Bit)
                {
                    Value = AParameters.Get("param_date_modified_from").IsZeroOrNull()
                });
            ASQLParameterList.Add(new OdbcParameter("param_date_modified_from", OdbcType.Date)
                {
                    Value = AParameters.Get("param_date_modified_from").ToDate()
                });
            ASQLParameterList.Add(new OdbcParameter("param_date_modified_to_unset", OdbcType.Bit)
                {
                    Value = AParameters.Get("param_date_modified_to").IsZeroOrNull()
                });
            ASQLParameterList.Add(new OdbcParameter("param_date_modified_to", OdbcType.Date)
                {
                    Value = AParameters.Get("param_date_modified_to").ToDate()
                });

            // add statement for church denomination
            if (AParameters.Exists("param_denomination"))
            {
                StringValue = AParameters.Get("param_denomination").ToString();
//.........这里部分代码省略.........
开发者ID:js1987,项目名称:openpetragit,代码行数:101,代码来源:ExtractPartnerByGeneralCriteria.cs

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

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

示例12: SetControls

        /// <summary>
        /// initialise the controls using the parameters
        /// </summary>
        /// <param name="AParameters"></param>
        public void SetControls(TParameterList AParameters)
        {
            rbtPartner.Checked = (AParameters.Get("param_selection").ToString() == "one partner");
            rbtExtract.Checked = (AParameters.Get("param_selection").ToString() == "an extract");
            rbtCurrentStaff.Checked = (AParameters.Get("param_selection").ToString() == "all current staff");
            rbtAllStaff.Checked = (AParameters.Get("param_selection").ToString() == "all staff");

            txtPartnerKey.Text = AParameters.Get("param_partnerkey").ToString();
            txtExtract.Text = AParameters.Get("param_extract").ToString();

            if (AParameters.Exists("param_currenstaffdate"))
            {
                dtpCurrentStaff.Date = AParameters.Get("param_currentstaffdate").ToDate();
            }
            else
            {
                dtpCurrentStaff.Date = DateTime.Today;
            }
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:23,代码来源:UC_PartnerSelection.ManualCode.cs

示例13: SetControls

        /// <summary>
        /// initialise the controls using the parameters
        /// </summary>
        /// <param name="AParameters"></param>
        public void SetControls(TParameterList AParameters)
        {
            if (AParameters.Get("param_conferenceselection").ToString() == "one conference")
            {
                rbtConference.Checked = true;
            }
            else if (AParameters.Get("param_conferenceselection").ToString() == "all conferences")
            {
                rbtAllConferences.Checked = true;
            }

            String AttendeeSelection = AParameters.Get("param_attendeeselection").ToString();

            if (AttendeeSelection == "all attendees")
            {
                rbtAllAttendees.Checked = true;
            }
            else if (AttendeeSelection == "from extract")
            {
                rbtExtract.Checked = true;
            }
            else if (AttendeeSelection == "one attendee")
            {
                rbtOneAttendee.Checked = true;
            }

            txtOneAttendee.Text = AParameters.Get("param_partnerkey").ToString();

            if (AParameters.Exists("param_conferencekey") && (txtConference.Text == ""))
            {
                txtConference.Text = AParameters.Get("param_conferencekey").ToString();
            }

            txtExtract.Text = AParameters.Get("param_extractname").ToString();
        }
开发者ID:js1987,项目名称:openpetragit,代码行数:39,代码来源:UC_ConferenceSelection.ManualCode.cs

示例14: String

        /// <summary>
        /// This returns the resultlist as lines for a CSV file
        /// </summary>
        /// <param name="AParameters"></param>
        /// <param name="separator">if this has the value FIND_BEST_SEPARATOR,
        /// then first the parameters will be checked for CSV_separator, and if that parameter does not exist,
        /// then the CurrentCulture is checked, for the local language settings</param>
        /// <param name="ADebugging">if true, thent the currency and date values are written encoded, not localized</param>
        /// <param name="AExportOnlyLowestLevel">if true, only the lowest level of AParameters are exported (level with higest depth)
        /// otherwise all levels in AParameter are exported</param>
        /// <returns>the lines to be written to the CSV file</returns>
        public List <string>WriteCSVInternal(TParameterList AParameters,
            string separator = "FIND_BEST_SEPARATOR",
            Boolean ADebugging = false,
            Boolean AExportOnlyLowestLevel = false)
        {
            List <string>lines = new List <string>();
            int i;
            string strLine;
            ArrayList sortedList;
            bool display;
            bool useIndented;
            TParameterList FormattedParameters;
            TResultList FormattedResult;

            // myEncoding: Encoding;
            // bytes: array of byte;
            if (separator == "FIND_BEST_SEPARATOR")
            {
                if (AParameters.Exists("CSV_separator"))
                {
                    separator = AParameters.Get("CSV_separator").ToString();

                    if (separator.ToUpper() == "TAB")
                    {
                        separator = new String((char)9, 1);
                    }
                    else if (separator.ToUpper() == "SPACE")
                    {
                        separator = " ";
                    }
                }
                else
                {
                    separator = CultureInfo.CurrentCulture.TextInfo.ListSeparator;
                }
            }

            if (ADebugging == false)
            {
                FormattedParameters = AParameters.ConvertToFormattedStrings("CSV");
                FormattedResult = ConvertToFormattedStrings(FormattedParameters, "CSV");
            }
            else
            {
                FormattedParameters = AParameters;
                FormattedResult = this;
            }

            // write headings
            strLine = "";

            // for debugging:
            // strLine = StringHelper.AddCSV(strLine, "masterRow", separator);
            // strLine = StringHelper.AddCSV(strLine, "childRow", separator);
            // strLine = StringHelper.AddCSV(strLine, "depth", separator);

            strLine = StringHelper.AddCSV(strLine, "id", separator);

            if (FormattedParameters.Exists("ControlSource", ReportingConsts.HEADERPAGELEFT1,
                    -1, eParameterFit.eBestFit))
            {
                strLine = StringHelper.AddCSV(strLine, FormattedParameters.Get("ControlSource",
                        ReportingConsts.HEADERPAGELEFT1,
                        -1, eParameterFit.eBestFit).ToString(), separator);
            }

            if (FormattedParameters.Exists("ControlSource", ReportingConsts.HEADERPAGELEFT2,
                    -1, eParameterFit.eBestFit))
            {
                strLine = StringHelper.AddCSV(strLine, FormattedParameters.Get("ControlSource",
                        ReportingConsts.HEADERPAGELEFT2,
                        -1, eParameterFit.eBestFit).ToString(), separator);
            }

            if (FormattedParameters.Exists("ControlSource", ReportingConsts.HEADERCOLUMN,
                    -1, eParameterFit.eBestFit))
            {
                strLine = StringHelper.AddCSV(strLine, "header 1", separator);
                strLine = StringHelper.AddCSV(strLine, "header 0", separator);
            }

            useIndented = false;

            for (i = 0; i <= FormattedParameters.Get("lowestLevel").ToInt(); i++)
            {
                if (FormattedParameters.Exists("indented", ReportingConsts.ALLCOLUMNS, i, eParameterFit.eBestFit))
                {
                    useIndented = true;
                }
//.........这里部分代码省略.........
开发者ID:Davincier,项目名称:openpetra,代码行数:101,代码来源:Result.cs

示例15: ConvertToFormattedStrings

        /// <summary>
        /// This formats the dates for different output, for example printing
        /// </summary>
        /// <param name="AParameters">the current parameters, environmnent variables, for formatting</param>
        /// <param name="AOutputType">if this is 'Localized' then the dates are formatted in the format DD-MMM-YYYY</param>
        /// <returns>s a new copy of the result, with the correct formatting
        /// </returns>
        public TResultList ConvertToFormattedStrings(TParameterList AParameters, String AOutputType)
        {
            TResultList ReturnValue = new TResultList(this);
            Int32 i;

            foreach (TResult r in ReturnValue.results)
            {
                for (i = 0; i <= 1; i++)
                {
                    r.header[i] = new TVariant(r.header[i].ToFormattedString("", AOutputType));
                }

                for (i = 0; i <= 1; i++)
                {
                    r.descr[i] = new TVariant(r.descr[i].ToFormattedString("", AOutputType));
                }

                for (i = 0; i < r.column.Length; i++)
                {
                    if (r.column[i].TypeVariant == eVariantTypes.eString)
                    {
                        r.column[i] = new TVariant(r.column[i].ToString(), true);
                    }
                    else
                    {
                        // format thousands only or without decimals
                        if (StringHelper.IsCurrencyFormatString(r.column[i].FormatString) && AParameters.Exists("param_currency_format"))
                        {
                            r.column[i] = new TVariant(r.column[i].ToFormattedString(AParameters.Get(
                                        "param_currency_format").ToString(), AOutputType), true);
                        }
                        else
                        {
                            r.column[i] = new TVariant(r.column[i].ToFormattedString("", AOutputType), true);
                        }
                    }
                }
            }

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


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