本文整理汇总了C#中Ict.Petra.Shared.MReporting.TParameterList.Copy方法的典型用法代码示例。如果您正苦于以下问题:C# TParameterList.Copy方法的具体用法?C# TParameterList.Copy怎么用?C# TParameterList.Copy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ict.Petra.Shared.MReporting.TParameterList
的用法示例。
在下文中一共展示了TParameterList.Copy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitMultiPeriodColumns
/// <summary>
/// This procedure uses the calculation columns,
/// and splits them each up into 12 columns, for each period
///
/// </summary>
/// <returns>void</returns>
protected void InitMultiPeriodColumns()
{
System.Int32 MaxDisplayColumns;
System.Int32 NumberColumns;
System.Int32 Counter;
System.Int32 Month;
System.Int32 NewColumn;
TParameterList TempParameters;
String Formula;
System.Int32 CurrentPos;
System.Int32 NumberPos;
System.Int32 ColumnNumber;
String Numberstring;
// then each column must be written back, 12 times
// the references must be changed to other columns
// what about ledger sums, etc?
MaxDisplayColumns = Parameters.Get("MaxDisplayColumns").ToInt();
NumberColumns = MaxDisplayColumns;
while (Parameters.Exists("param_calculation", NumberColumns))
{
NumberColumns = NumberColumns + 1;
}
// the current column calculation settings must be saved somewhere
TempParameters = new TParameterList();
for (Counter = 0; Counter <= NumberColumns - 1; Counter++)
{
TempParameters.Copy(Parameters, Counter, -1, eParameterFit.eBestFit, -1);
}
// clear the current column settings
for (Counter = 0; Counter <= NumberColumns - 1; Counter++)
{
Parameters.RemoveColumn(Counter);
}
for (Counter = 0; Counter <= NumberColumns - 1; Counter++)
{
//TODO: Calendar vs Financial Date Handling - Check if this should use number of financial perids and not month
for (Month = 1; Month <= 12; Month++)
{
NewColumn = Counter * 13 + Month - 1;
Parameters.Copy(TempParameters, Counter, -1, eParameterFit.eExact, NewColumn);
Parameters.Add("param_column_period_i", new TVariant(Month), NewColumn);
Parameters.Add("param_start_period_i", new TVariant(Month), NewColumn);
Parameters.Add("param_end_period_i", new TVariant(Month), NewColumn);
Parameters.Add("param_ytd", new TVariant(false), NewColumn);
if (Parameters.Exists("FirstColumn", NewColumn))
{
Parameters.Add("FirstColumn", new TVariant(Parameters.Get("FirstColumn", NewColumn).ToInt() * 13 + Month - 1), NewColumn);
}
if (Parameters.Exists("SecondColumn", NewColumn))
{
Parameters.Add("SecondColumn", new TVariant(Parameters.Get("SecondColumn", NewColumn).ToInt() * 13 + Month - 1), NewColumn);
}
if (Parameters.Exists("param_formula", NewColumn))
{
Formula = Parameters.Get("param_formula", NewColumn).ToString();
// replace column(x) with column(mul(13,x))
CurrentPos = 0;
CurrentPos = Formula.ToLower().IndexOf("column(", CurrentPos);
while (CurrentPos != -1)
{
NumberPos = CurrentPos + ("column(").Length;
Numberstring = Formula.Substring(NumberPos, Formula.IndexOf(')', NumberPos) - NumberPos);
ColumnNumber = Convert.ToInt32(Numberstring);
Formula =
Formula.Substring(0,
NumberPos) + "mul(13," + ColumnNumber.ToString() + ')' + Formula.Substring(Formula.IndexOf(')', NumberPos));
CurrentPos = Formula.ToLower().IndexOf("column(", CurrentPos + 1);
}
Parameters.Add("param_formula", new TVariant(Formula), NewColumn);
}
}
//TODO: Calendar vs Financial Date Handling - Check if this should use financial year/periods and not assume calendar
// the ytd column
NewColumn = Counter * 13 + 12;
Parameters.Copy(TempParameters, Counter, -1, eParameterFit.eExact, NewColumn);
Parameters.Add("param_column_period_i", new TVariant(12), NewColumn);
Parameters.Add("param_ytd", new TVariant(true), NewColumn);
// TODO: also apply the formula/ reference changes to columns!!!!
}
//.........这里部分代码省略.........
示例2: 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;
}