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


C# IProcessDefinition.GetProcessNameByFieldName方法代码示例

本文整理汇总了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;
                }}
",
//.........这里部分代码省略.........
开发者ID:mparsin,项目名称:Elements,代码行数:101,代码来源:ServerAssemblyGenerator.cs


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