本文整理汇总了C#中Period.Output方法的典型用法代码示例。如果您正苦于以下问题:C# Period.Output方法的具体用法?C# Period.Output怎么用?C# Period.Output使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Period
的用法示例。
在下文中一共展示了Period.Output方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CalculateAction
//Calcuation Controller Action
public void CalculateAction(List<CategoryViewModel> jCategory)
{
foreach (var group in jCategory)
{
foreach (var item in group.Functions)
{
if (item.Function == "Input")
{
item.Output = InputFunctions.Output(item.Type, item.Output);
OutputList.Add(new OutputList { ID = Convert.ToString(item.ID), Field = item.Name, Value = item.Output, Group = group.Name });
}
else
{
//Logic check at Column Level
string colLogic = null;
bool colLogicParse = true;
if(group.Logic != null)
{
foreach (var bit in group.Logic)
{
var grouplastLogic = group.Logic.Last();
string grouplastLogicOperator = grouplastLogic.Operator;
Logic Logic = new Logic();
colLogic = Logic.Output(jCategory, bit, group.ID, 0);
Expression ex = new Expression(colLogic);
try
{
colLogicParse = Convert.ToBoolean(ex.Evaluate());
}
catch (Exception exception)
{
logger.Error(exception);
throw new HttpException(exception.ToString());
}
if (grouplastLogicOperator == "AND" && colLogicParse == false)
{
break;
}
else if (grouplastLogicOperator == "OR" && colLogicParse == true)
{
colLogicParse = true;
break;
}
}
}
if (item.Parameter.Count > 0)
{
string logic = null;
bool logicparse = true;
string MathString = null;
bool PowOpen = false;
//Logic check at column level
if (colLogicParse == true)
{
foreach (var bit in item.Logic)
{
var lastLogic = item.Logic.Last();
string lastLogicOperator = lastLogic.Operator;
Logic Logic = new Logic();
logic = Logic.Output(jCategory, bit, group.ID, item.ID);
Expression ex = new Expression(logic);
try
{
logicparse = Convert.ToBoolean(ex.Evaluate());
}
catch (Exception exception)
{
logger.Error(exception);
throw new HttpException(exception.ToString());
}
if (lastLogicOperator == "AND" && logicparse == false)
{
break;
}
else if (lastLogicOperator == "OR" && logicparse == true)
{
logicparse = true;
break;
}
}
}
else
{
logicparse = false;
}
//Run code if logic if met at column and row level
if (logicparse == true)
{
int paramCount = 1;
foreach (var param in item.Parameter)
{
string jparameters = Newtonsoft.Json.JsonConvert.SerializeObject(param);
logger.Debug("Column Name(" + group.ID + ") - " + group.Name + " || Row Name(" + item.ID +") - " + item.Name);
if (item.Function == "Maths")
//.........这里部分代码省略.........