本文整理汇总了C#中Cebos.Veyron.Library.Process.Publisher.Definitions.IProcessDefinition.GetProcessNameByFieldName方法的典型用法代码示例。如果您正苦于以下问题:C# IProcessDefinition.GetProcessNameByFieldName方法的具体用法?C# IProcessDefinition.GetProcessNameByFieldName怎么用?C# IProcessDefinition.GetProcessNameByFieldName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cebos.Veyron.Library.Process.Publisher.Definitions.IProcessDefinition
的用法示例。
在下文中一共展示了IProcessDefinition.GetProcessNameByFieldName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddEditableRootOnChildChangedMethodBody
/// <summary>
/// Adds the editable root on child changed method body.
/// </summary>
/// <param name="assemblyCode">The assembly code.</param>
/// <param name="process">The process.</param>
protected override void AddEditableRootOnChildChangedMethodBody(StringBuilder assemblyCode, IProcessDefinition process)
{
base.AddEditableRootOnChildChangedMethodBody(assemblyCode, process);
foreach (var field in process.RootTable.FieldList.Where(f => !f.AllowLocalizedData))
{
if (field.IsCalculated)
{
var sourceFields = new HashSet<string>(ExpressionService.GetExpressionSourceFields(field.CalculatedExpression));
if (sourceFields.Count > 0)
{
assemblyCode.AppendFormat(
@"
if (Has{0}Changed(e))
{{
UpdateCalculatedProperty({0}Property, {0}Expression);
}}
", field.SystemName);
}
}
else if (field.HasDefaultExpression)
{
var sourceFields = new HashSet<string>(ExpressionService.GetExpressionSourceFields(field.DefaultValueExpression));
if (sourceFields.Count > 0)
{
assemblyCode.AppendFormat(@"
if (this.IsNew && Has{0}Changed(e))
{{
UpdateCalculatedProperty({0}Property, {0}Expression);
}}
", field.SystemName);
}
}
// add crossrefs filters
if (field.ColumnType == ColumnTypes.Reference)
{
// check if we have a filter
var filterFields = GetCrossRefFilterFields(field);
if (filterFields == null || filterFields.Length == 0)
continue;
assemblyCode.AppendFormat(
@"
if (e.ChildObject is IDynamicObject && this.IsAncestorOf((IDynamicObject)e.ChildObject))
{{
");
foreach (var filterField in filterFields)
{
var filterFieldProcessName = process.GetProcessNameByFieldName(filterField);
if (!string.IsNullOrWhiteSpace(filterFieldProcessName))
assemblyCode.AppendFormat(
@"
if (e != null && e.PropertyChangedArgs != null && e.PropertyChangedArgs.PropertyName == ""{0}"")
{{
BusinessRules.CheckRules({1}Edit.{0}Property);
}}
",
filterField,
filterFieldProcessName);
}
assemblyCode.AppendFormat(@"
}}
");
}
// add Display List filters
if (field.ColumnType == ColumnTypes.DisplayList)
{
// check if we have a filter
var filterFields = GetCrossRefFilterFields(field);
if (filterFields == null || filterFields.Length == 0)
continue;
assemblyCode.AppendFormat(
@" if (e.ChildObject is IDynamicObject && this.IsAncestorOf((IDynamicObject)e.ChildObject))
{{");
foreach (var filterField in filterFields)
{
var filterFieldProcessName = process.GetProcessNameByFieldName(filterField);
if (!string.IsNullOrWhiteSpace(filterFieldProcessName))
assemblyCode.AppendFormat(
@"
if (e != null && e.PropertyChangedArgs != null && e.PropertyChangedArgs.PropertyName == ""{0}"")
{{
{1} = null;
}}
",
//.........这里部分代码省略.........