コード例 #1
0
        UPMGroup GroupFromParticipantControl()
        {
            UPMRepeatableEditGroup repeatableEditGroup = new UPMRepeatableEditGroup(this.TabIdentifierForRecordIdentification(this.LinkRecordIdentification));

            repeatableEditGroup.LabelText         = this.TabLabel();
            repeatableEditGroup.AddGroupLabelText = upText_AddNewGroup;
            repeatableEditGroup.AddingEnabled     = this.AddRecordEnabled;
            foreach (UPCRMRepParticipant participant in this.ParticipantsControl.Participants)
            {
                string           repIdString           = participant.Key;
                UPMIdentifier    participantIdentifier = UPMStringIdentifier.IdentifierWithStringId(repIdString);
                UPMStandardGroup group = new UPMStandardGroup(participantIdentifier);
                NSNumber         num   = participant.Options.ObjectForKey("must");
                group.Deletable = this.DeleteRecordEnabled && !num.IntegerValue;
                UPMDependsEditField editField = this.CreateEditFieldWithParticipantIdentifierEditGroup(participantIdentifier, group);
                editField.MainField.FieldValue = participant.RepIdString;
                if (this.ParticipantsControl.HasRepAcceptance && participant.CanChangeAcceptanceState)
                {
                    editField.DependField.FieldValue = participant.AcceptanceText;
                }
                else
                {
                    editField.DependField.FieldValue = null;
                }

                editField.DependField2.FieldValue = participant.RequirementText;
                group.AddField(editField);
                repeatableEditGroup.AddGroup(group);
                this.AddGroupForKey(group, repIdString);
            }
            this.Group           = repeatableEditGroup;
            this.ControllerState = UPGroupModelControllerStateFinished;
            return(repeatableEditGroup);
        }
コード例 #2
0
        /// <summary>
        /// Handles adding new item to repeatable edit group
        /// </summary>
        /// <param name="repeatableEditGroup">Repeatable edit group for adding new item</param>
        /// <inheritdoc />
        public override void UserWillInsertNewGroupInRepeatableEditGroup(UPMRepeatableEditGroup repeatableEditGroup)
        {
            Dictionary <string, string> childInitialValues = null;
            string key = this.ChildGroupKey;

            if (key.StartsWith("."))
            {
                key = $"#{key.Substring(1)}";
            }

            List <Dictionary <string, string> > childInitialValueArray = this.EditPageContext.InitialValues.ValueOrDefault(key) as List <Dictionary <string, string> >;

            if (childInitialValueArray?.Count > 0)
            {
                childInitialValues = childInitialValueArray[0];
            }

            UPMStandardGroup group = this.CreateNewGroup(childInitialValues);

            if (group != null)
            {
                repeatableEditGroup.AddChild(group);
            }

            if (this.MaxChildren > 0 && repeatableEditGroup.Groups.Count >= this.MaxChildren)
            {
                repeatableEditGroup.AddingEnabled = false;
            }
        }
        private static void ProccessStandardGroup(UPMStandardGroup standardGroup, UPConfigFieldControlField documentFieldConfig, string documentKey, string recordIdentification)
        {
            var fieldAttributes = documentFieldConfig?.Attributes;
            var attribute       = fieldAttributes?.AttributForId((int)FieldAttr.Image);

            if (attribute?.ValueOptionsForKey("previewWidth") != null &&
                attribute.ValueOptionsForKey("previewHeight") != null)
            {
                var width  = attribute.ValueOptionsForKey("previewWidth");
                var height = attribute.ValueOptionsForKey("previewHeight");

                standardGroup.ImageDocumentMaxSize = new Size(
                    width.ToInt(),
                    height.ToInt());
            }

            var documentManager = new DocumentManager();
            var documentData    = documentManager.DocumentForKey(documentKey);
            var imageDocument   = documentData != null
                ? new UPMDocument(documentData)
                : new UPMDocument(
                new RecordIdentifier(recordIdentification),
                null,
                null,
                null,
                null,
                ServerSession.CurrentSession.DocumentRequestUrlForDocumentKey(documentKey),
                null,
                null,
                null,
                null);

            standardGroup.ImageDocument = imageDocument;
        }
        /// <summary>
        /// Applies the context.
        /// </summary>
        /// <param name="dictionary">The dictionary.</param>
        /// <returns></returns>
        public override UPMGroup ApplyContext(Dictionary <string, object> dictionary)
        {
            UPMStandardGroup detailGroup = new UPMStandardGroup(this.ExplicitTabIdentifier);

            detailGroup.LabelText = this.FormItem.Label;
            UPMStringField field = new UPMStringField(this.ExplicitTabIdentifier)
            {
                LabelText   = "ViewName",
                StringValue = this.ViewReference.ViewName
            };

            detailGroup.AddChild(field);
            foreach (ReferenceArgument arg in this.FormItem.ViewReference.Arguments.Values)
            {
                field = new UPMStringField(this.ExplicitTabIdentifier)
                {
                    LabelText   = arg.Name,
                    StringValue = arg.Value
                };
                detailGroup.AddChild(field);
            }

            this.ControllerState = GroupModelControllerState.Finished;
            this.Group           = detailGroup;
            return(detailGroup);
        }
コード例 #5
0
        private UPMGroup GroupFromParticipantControl()
        {
            var repeatableEditGroup = new UPMRepeatableEditGroup(this.TabIdentifierForRecordIdentification(this.LinkRecordIdentification))
            {
                LabelText         = this.TabLabel,
                AddGroupLabelText = LocalizedString.TextAddNewGroup,
                AddingEnabled     = this.AddRecordEnabled
            };

            if (this.ParticipantsControl.Participants.Count > 0)
            {
                UPCRMRepParticipant sparticipant           = (UPCRMRepParticipant)this.ParticipantsControl.Participants[0];
                IIdentifier         sparticipantIdentifier = StringIdentifier.IdentifierWithStringId(sparticipant.Key);
                var group = new UPMStandardGroup(sparticipantIdentifier);


                foreach (UPCRMRepParticipant participant in this.ParticipantsControl.Participants)
                {
                    var         repIdString           = participant.Key;
                    IIdentifier participantIdentifier = StringIdentifier.IdentifierWithStringId(repIdString);
                    //var group = new UPMStandardGroup(participantIdentifier);

                    var num = participant.Options.ValueOrDefault("must") as string;
                    group.Deletable = this.DeleteRecordEnabled && Convert.ToInt32(num) == 0;

                    var editField = this.CreateEditFieldWithParticipantIdentifierEditGroup(participantIdentifier, group);
                    editField.MainField.FieldValue = participant.RepIdString;

                    if (this.ParticipantsControl.HasRepAcceptance && participant.CanChangeAcceptanceState)
                    {
                        editField.DependField.FieldValue = participant.AcceptanceText;
                    }
                    else
                    {
                        editField.DependField.FieldValue = null;
                    }

                    editField.DependField2.FieldValue = participant.RequirementText;
                    group.AddField(editField);
                }

                repeatableEditGroup.AddChild(group);
                this.AddGroupForKey(group, sparticipant.Key);
            }
            else
            {
                IIdentifier sparticipantIdentifier = StringIdentifier.IdentifierWithStringId("00000");
                var         group     = new UPMStandardGroup(sparticipantIdentifier);
                var         editField = this.CreateEditFieldWithParticipantIdentifierEditGroup(sparticipantIdentifier, group);
                group.AddField(editField);
                repeatableEditGroup.AddChild(group);
                this.AddGroupForKey(group, "00000");
            }

            this.Group           = repeatableEditGroup;
            this.ControllerState = GroupModelControllerState.Finished;
            return(repeatableEditGroup);
        }
        private UPMGroup GroupFromParticipantControl()
        {
            UPMRepeatableEditGroup repeatableEditGroup = new UPMRepeatableEditGroup(this.TabIdentifierForRecordIdentification(this.LinkRecordIdentification));

            repeatableEditGroup.LabelText = this.TabLabel;
            this.selectorArray            = new List <UPRecordSelector>();

            for (int fieldNumber = 0; fieldNumber < this.TabConfig.NumberOfFields; fieldNumber++)
            {
                UPConfigFieldControlField configFieldControlField = this.TabConfig.Fields[fieldNumber];
                var selector = configFieldControlField.Attributes.Selector;

                if (selector != null)
                {
                    var recordSelector = new UPRecordSelector("KP", null, -1, selector, null, this.ParticipantsField);
                    this.selectorArray.Add(recordSelector);
                }
            }

            if (this.selectorArray.Count < 1)
            {
                repeatableEditGroup.AddingEnabled = false;
                if (this.ParticipantsControl.Participants.Count < 1)
                {
                    this.Group           = null;
                    this.ControllerState = GroupModelControllerState.Empty;
                    return(null);
                }
            }
            else
            {
                repeatableEditGroup.AddGroupLabelText = LocalizedString.TextAddNewGroup;
                repeatableEditGroup.AddingEnabled     = this.AddRecordEnabled;
            }

            foreach (UPCRMLinkParticipant participant in this.ParticipantsControl.Participants)
            {
                string           recordIdentification  = participant.RecordIdentification;
                IIdentifier      participantIdentifier = new RecordIdentifier(recordIdentification);
                UPMStandardGroup group = new UPMStandardGroup(participantIdentifier);
                string           num   = participant.Options.ValueOrDefault("must") as string;
                group.Deletable = !participant.MayNotBeDeleted && this.DeleteRecordEnabled && num.ToInt() == 0;
                UPMDependsEditField editField = this.CreateEditFieldWithParticipantIdentifierEditGroup(participantIdentifier, group);
                editField.MainField.FieldValue = participant.Name;
                ((UPMParticipantsRecordSelectorEditField)editField.MainField).Participant = participant;
                editField.DependField.FieldValue  = participant.AcceptanceText;
                editField.DependField2.FieldValue = participant.RequirementText;
                bool editOfflineRecord = ConfigurationUnitStore.DefaultStore.ConfigValueIsSetDefaultValue("RecordSelect.EditOfflineRecord", false);
                editField.Deletable = !participant.IsOfflineEmptyParticipant || editOfflineRecord;
                group.AddField(editField);
                repeatableEditGroup.AddChild(group);
                this.AddGroupForKey(group, participant.Key);
            }

            this.Group           = repeatableEditGroup;
            this.ControllerState = GroupModelControllerState.Finished;
            return(repeatableEditGroup);
        }
        /// <inheritdoc/>
        public override UPMStandardGroup CreateNewGroup(Dictionary <string, string> initialValues)
        {
            var participant = this.ParticipantsControl.AddNewLinkParticipant();

            participant.Options   = this.firstItemOptions;
            this.firstItemOptions = null;
            var requirementKey = initialValues.ValueOrDefault("Requirement");
            var acceptanceKey  = initialValues.ValueOrDefault("Acceptance");

            if (!string.IsNullOrEmpty(requirementKey))
            {
                var v = initialValues[requirementKey];
                if (!string.IsNullOrEmpty(v))
                {
                    participant.RequirementText = v;
                }
            }

            if (!string.IsNullOrEmpty(acceptanceKey))
            {
                var v = initialValues[acceptanceKey];
                if (!string.IsNullOrEmpty(v))
                {
                    participant.AcceptanceText = v;
                }
            }

            IIdentifier participantIdentifier = StringIdentifier.IdentifierWithStringId(participant.Key);
            var         group = new UPMStandardGroup(participantIdentifier);

            group.Deletable = true;

            if (this.isFirst)
            {
                this.isFirst = false;
                if (this.fixedFirstParticipant)
                {
                    group.Deletable = false;
                }
            }

            var editField = this.CreateEditFieldWithParticipantIdentifierEditGroup(participantIdentifier, group);

            editField.MainField.FieldValue    = participant.Name;
            editField.DependField2.FieldValue = participant.RequirementText;
            editField.DependField.FieldValue  = participant.CanChangeAcceptanceState ? participant.AcceptanceText : string.Empty;
            group.AddField(editField);
            this.AddGroupForKey(group, participant.Key);
            return(group);
        }
        private UPMGroup AddFieldToDetailGroup(UPMGroup detailGroup, FieldAttributes fieldAttributes, UPMStringField field, string recordIdentification)
        {
            SetAttributesOnField(fieldAttributes, field);
            if (detailGroup == null)
            {
                detailGroup = new UPMStandardGroup(this.TabIdentifierForRecordIdentification(recordIdentification));
                ((UPMStandardGroup)detailGroup).ColumnStyle = this.columnStyle;
                detailGroup.LabelText = this.TabLabel;
            }

            detailGroup.AddField(field);

            return(detailGroup);
        }
        private UPMGroup AddFieldToDetailGroup(UPMGroup detailGroup, FieldIdentifier fieldIdentifier, string recordIdentification)
        {
            if (detailGroup == null)
            {
                detailGroup = new UPMStandardGroup(this.TabIdentifierForRecordIdentification(recordIdentification));
                ((UPMStandardGroup)detailGroup).ColumnStyle = this.columnStyle;
                detailGroup.LabelText = this.TabLabel;
            }

            var field = new UPMStringField(fieldIdentifier);

            detailGroup.AddField(field);

            return(detailGroup);
        }
        /// <summary>
        /// Adds the groups with initial values.
        /// </summary>
        /// <param name="_initialValues">The initial values.</param>
        public override void AddGroupsWithInitialValues(List <Dictionary <string, object> > _initialValues)
        {
            UPMRepeatableEditGroup repeatableEditGroup = (UPMRepeatableEditGroup)this.Group;

            foreach (var initialValuesForGroup in _initialValues)
            {
                UPMStandardGroup group = null;
                string           key   = (initialValuesForGroup[".Key"] as List <string>)?[0];

                if (!string.IsNullOrEmpty(key))
                {
                    group = this.groupForKey[key];
                    UPChildEditContext childEditContext = this.ChildEditContextForGroup(group);
                    if (childEditContext != null && repeatableEditGroup.Groups.Contains(group))
                    {
                        this.UpdateChildEditContext(childEditContext, initialValuesForGroup);
                        return;
                    }
                    else
                    {
                        group = null;
                    }
                }

                if (group == null)
                {
                    group = this.CreateNewGroup(initialValuesForGroup);
                    if (group != null)
                    {
                        repeatableEditGroup.AddChild(group);
                        if (!string.IsNullOrEmpty(key))
                        {
                            if (this.groupForKey != null)
                            {
                                this.groupForKey.SetObjectForKey(group, key);
                            }
                            else
                            {
                                this.groupForKey = new Dictionary <string, UPMStandardGroup> {
                                    { key, group }
                                };
                            }
                        }
                    }
                }
            }
        }
        private static void AddFieldToGroup(UPMStandardGroup standardGroup, object field, UPChildEditContext childEditContext)
        {
            if (field is UPEditFieldContext)
            {
                var editFieldContext = (UPEditFieldContext)field;
                editFieldContext.ChildEditContext = childEditContext;

                foreach (var editField in editFieldContext.EditFields)
                {
                    editField.EditFieldsContext = childEditContext;
                    standardGroup.AddField(editField);
                }
            }
            else
            {
                standardGroup.AddField((UPMField)field);
            }
        }
        private UPMGroup AddFieldToDetailGroup(UPMGroup detailGroup, string recordIdentification, FieldIdentifier fieldIdentifier, FieldAttributes fieldAttributes)
        {
            if (detailGroup == null)
            {
                detailGroup = new UPMStandardGroup(this.TabIdentifierForRecordIdentification(recordIdentification));
                ((UPMStandardGroup)detailGroup).ColumnStyle = this.columnStyle;
                detailGroup.LabelText = this.TabLabel;
            }

            var field = new UPMStringField(fieldIdentifier)
            {
                StripNewLines = fieldAttributes.NoMultiLine
            };

            detailGroup.AddField(field);

            return(detailGroup);
        }
コード例 #13
0
        UPMStandardGroup CreateNewGroup(NSDictionary initialValues)
        {
            UPCRMRepParticipant participant = this.ParticipantsControl.AddNewRepParticipant();

            participant.Options = firstItemOptions;
            firstItemOptions    = null;
            UPMIdentifier    participantIdentifier = UPMStringIdentifier.IdentifierWithStringId(participant.Key);
            UPMStandardGroup group = new UPMStandardGroup(participantIdentifier);

            group.Deletable = true;
            UPMDependsEditField editField = this.CreateEditFieldWithParticipantIdentifierEditGroup(participantIdentifier, group);

            editField.MainField.FieldValue    = participant.RepIdString;
            editField.DependField.FieldValue  = string.Empty;
            editField.DependField2.FieldValue = participant.RequirementText;
            group.AddField(editField);
            this.AddGroupForKey(group, participant.Key);
            return(group);
        }
コード例 #14
0
        /// <inheritdoc/>
        public override UPMStandardGroup CreateNewGroup(Dictionary <string, string> initialValues)
        {
            var participant = this.ParticipantsControl.AddNewRepParticipant();

            participant.Options   = this.firstItemOptions;
            this.firstItemOptions = null;

            IIdentifier participantIdentifier = StringIdentifier.IdentifierWithStringId(participant.Key);
            var         group = new UPMStandardGroup(participantIdentifier);

            group.Deletable = true;

            var editField = this.CreateEditFieldWithParticipantIdentifierEditGroup(participantIdentifier, group);

            editField.MainField.FieldValue    = participant.RepIdString;
            editField.DependField.FieldValue  = null;
            editField.DependField2.FieldValue = participant.RequirementText;
            group.AddField(editField);
            this.AddGroupForKey(group, participant.Key);

            return(group);
        }
        /// <summary>
        /// Handles adding new item to repeatable edit group
        /// </summary>
        /// <param name="repeatableEditGroup">Repeatable edit group for adding new item</param>
        public override void UserWillInsertNewGroupInRepeatableEditGroup(UPMRepeatableEditGroup repeatableEditGroup)
        {
            string key = $"#{this.ChildInfoAreaId}.{(this.LinkId < 0 ? 0 : this.LinkId)}";
            var    childInitialValueArray = this.EditPageContext.InitialValues[key] as List <Dictionary <string, object> >;
            Dictionary <string, object> childInitialValues = null;

            if (childInitialValueArray?.Count > 0)
            {
                childInitialValues = childInitialValueArray[0];
            }

            UPMStandardGroup group = this.CreateNewGroup(childInitialValues);

            if (group != null)
            {
                repeatableEditGroup.AddChild(group);
            }

            if (this.MaxChildren > 0 && repeatableEditGroup.Groups.Count >= this.MaxChildren)
            {
                repeatableEditGroup.AddingEnabled = false;
            }
        }
        private void AddRecordsToGroup(
            UPMRepeatableEditGroup repeatableEditGroup,
            int count,
            UPCRMResult childResult,
            Dictionary <string, UPCRMRecord> changedRecords,
            FieldControlTab childFieldControlTab)
        {
            for (var i = 0; i < count; i++)
            {
                var childRow         = (UPCRMResultRow)childResult.ResultRowAtIndex(i);
                var childEditContext = new UPChildEditContext(childRow, this.NextPostfix);
                var changedRecord    = changedRecords.ValueOrDefault(childRow.RootRecordId);
                var initialRecords   = changedRecord != null ? new List <UPCRMRecord> {
                    changedRecord
                } : null;

                var editFieldContextArray = this.EditContextsForResultRow(childRow, childFieldControlTab, childEditContext.EditFieldContext, null, childEditContext.FieldLabelPostfix, initialRecords);
                var editFieldCount        = editFieldContextArray.Count;
                if (editFieldCount > 0)
                {
                    var standardGroup = new UPMStandardGroup(new RecordIdentifier(childRow.RootRecordIdentification))
                    {
                        Deletable = this.DeleteRecordEnabled
                    };
                    childEditContext.Group = standardGroup;
                    this.AddChildRecordContext(childEditContext);
                    for (var j = 0; j < editFieldCount; j++)
                    {
                        var field = editFieldContextArray[j];
                        AddFieldToGroup(standardGroup, field, childEditContext);
                    }

                    childEditContext.HandleDependentFields();
                    repeatableEditGroup.AddChild(standardGroup);
                }
            }
        }
        /// <summary>
        /// Applies the result row.
        /// </summary>
        /// <param name="row">The row.</param>
        /// <returns></returns>
        public override UPMGroup ApplyResultRow(UPCRMResultRow row)
        {
            IConfigurationUnitStore configStore = ConfigurationUnitStore.DefaultStore;
            bool             hideEmptyFields    = configStore.ConfigValueIsSet("SettingsView.HideEmptyFields");
            UPMStandardGroup detailGroup        = null;
            int fieldCount = this.LayoutTab.FieldCount;

            for (int j = 0; j < fieldCount; j++)
            {
                WebConfigLayoutField fieldDef        = this.LayoutTab.FieldAtIndex(j);
                IIdentifier          fieldIdentifier = StringIdentifier.IdentifierWithStringId(fieldDef.ValueName);
                string fieldValue    = configStore.ConfigValue(fieldDef.ValueName);
                bool   hasFieldValue = !string.IsNullOrEmpty(fieldValue);

                if (!hasFieldValue && hideEmptyFields)
                {
                    continue;
                }

                var field = new UPMStringField(fieldIdentifier)
                {
                    StringValue = fieldDef.DisplayValueForValue(fieldValue),
                    LabelText   = fieldDef.Label
                };
                if (detailGroup == null)
                {
                    detailGroup           = new UPMStandardGroup(StringIdentifier.IdentifierWithStringId($"{this.Layout.UnitName}_{this.TabIndex}"));
                    detailGroup.LabelText = this.TabLabel;
                }

                detailGroup.AddField(field);
            }

            this.Group           = detailGroup;
            this.ControllerState = (detailGroup == null) ? GroupModelControllerState.Empty : GroupModelControllerState.Finished;
            return(detailGroup);
        }
コード例 #18
0
        /// <summary>
        /// Applies the result row.
        /// </summary>
        /// <param name="row">The row.</param>
        /// <returns></returns>
        public override UPMGroup ApplyResultRow(UPCRMResultRow row)
        {
            IConfigurationUnitStore configStore = ConfigurationUnitStore.DefaultStore;
            UPMStandardGroup        detailGroup = null;
            int fieldCount = this.LayoutTab.FieldCount;
            List <UPEditFieldContext> editFieldContextArray = new List <UPEditFieldContext>(fieldCount);

            for (int j = 0; j < fieldCount; j++)
            {
                WebConfigLayoutField fieldDef        = this.LayoutTab.FieldAtIndex(j);
                IIdentifier          fieldIdentifier = StringIdentifier.IdentifierWithStringId(fieldDef.ValueName);
                string             fieldValue        = configStore.ConfigValue(fieldDef.ValueName);
                UPEditFieldContext editFieldContext  = UPEditFieldContext.FieldContextForWebConfigParameterFieldIdentifierValue(fieldDef, fieldIdentifier, fieldValue);
                if (editFieldContext == null)
                {
                    continue;
                }

                editFieldContextArray.Add(editFieldContext);
                if (detailGroup == null)
                {
                    detailGroup           = new UPMStandardGroup(StringIdentifier.IdentifierWithStringId($"{this.Layout.UnitName}_{this.TabIndex}"));
                    detailGroup.LabelText = this.TabLabel;
                }

                foreach (UPMEditField editField in editFieldContext.EditFields)
                {
                    detailGroup.AddField(editField);
                }
            }

            this.EditFieldContexts = editFieldContextArray;
            this.Group             = detailGroup;
            this.ControllerState   = (detailGroup == null) ? GroupModelControllerState.Empty : GroupModelControllerState.Finished;
            return(detailGroup);
        }
コード例 #19
0
        /// <summary>
        /// Makes the system information group.
        /// </summary>
        /// <returns></returns>
        public UPMGroup MakeSystemInfoGroup()
        {
            return(null);

#if PORTING
            IConfigurationUnitStore configStore = ConfigurationUnitStore.DefaultStore;
            bool             hideEmptyFields    = configStore.ConfigValueIsSet("SettingsView.HideEmptyFields");
            UPMStandardGroup detailGroup        = new UPMStandardGroup(StringIdentifier.IdentifierWithStringId("systeminfo_1"));

            UPSystemInfo  systemInfo    = new UPSystemInfo();
            NSDictionary  infos         = this.GetFunctionNameDictionaryForSystemInfo(systemInfo);
            FieldControl  listControl   = null;
            ViewReference systemViewRef = new ViewReference(new List <object> {
                "fieldgroup", "SYSTEMINFO"
            }, "SystemInfoView");
            string fieldGroup = systemViewRef.ContextValueForKey("fieldgroup");
            if (fieldGroup != null)
            {
                listControl = configStore.FieldControlByNameFromGroup("List", fieldGroup);
                int row = 0;
                foreach (UPConfigFieldControlField field in listControl.Fields)
                {
                    string functionName          = field.Function;
                    string label                 = field.Label;
                    string functionNameLowerCase = functionName.ToLower();
                    if (infos.ObjectForKey(functionNameLowerCase) != null)
                    {
                        IIdentifier fieldIdentifier = StringIdentifier.IdentifierWithStringId($"Id_{functionName}");
                        string      fieldValue      = infos[functionNameLowerCase];
                        if (!string.IsNullOrEmpty(fieldValue) || !hideEmptyFields)
                        {
                            UPMStringField stringField = new UPMStringField(fieldIdentifier);
                            stringField.StringValue = fieldValue;
                            stringField.LabelText   = label;
                            if (functionName == "webversion" && ServerSession.CurrentSession().IsEnterprise)
                            {
                                stringField.StringValue = $"{fieldValue} Enterprise";
                            }

                            detailGroup.AddField(stringField);
                        }
                    }

                    row++;
                }
            }

            if (systemInfo.WebconfigParameter())
            {
                foreach (UPConfigWebConfigLayoutField configField in systemInfo.WebconfigParameter().AllValues())
                {
                    IIdentifier fieldIdentifier = StringIdentifier.IdentifierWithStringId(NSString.StringWithFormat("Id_%@", configField.ValueName()));
                    string      label           = configField.ValueName();
                    if (listControl != null)
                    {
                        UPConfigFieldControlField field = listControl.FieldWithFunction(configField.ValueName());
                        if (!string.IsNullOrEmpty(field?.Label))
                        {
                            label = field.Label;
                        }
                    }

                    UPMStringField field = new UPMStringField(fieldIdentifier);
                    field.StringValue = configField.Value();
                    field.LabelText   = label;
                    detailGroup.AddField(field);
                }
            }

            return(detailGroup);
#endif
        }
        private UPChildEditContext ChildEditContextForGroup(UPMStandardGroup group)
        {
            UPChildEditContext context = this.AddedChildEditContexts.FirstOrDefault(x => x.Group == group);

            return(context ?? this.ChildEditContexts.Values.FirstOrDefault(x => x.Group == group));
        }
        private UPMStandardGroup CreateNewGroupRecordAsNew(Dictionary <string, object> parentInitialValues, UPCRMRecord record, bool asNew)
        {
            UPContainerMetaInfo metaInfo = new UPContainerMetaInfo(this.ChildFieldControl);
            UPCRMResult         result   = !string.IsNullOrEmpty(record?.RecordId) ? metaInfo.NewRecordWithRecordId(record.RecordId) : metaInfo.NewRecord();

            UPCRMResultRow     childRow         = (UPCRMResultRow)result.ResultRowAtIndex(0);
            UPChildEditContext childEditContext = new UPChildEditContext(childRow, this.NextPostfix);

            if (asNew)
            {
                childEditContext.SetAsNew();
            }

            if (record != null)
            {
                childEditContext.AddChangedLinksFromRecordParentLink(record, null);
            }

            FieldControlTab childFieldControlTab = this.ChildFieldControl.TabAtIndex(0);

            this.combinedInitialValues = null;
            if (this.initialValues != null)
            {
                if (parentInitialValues != null)
                {
                    Dictionary <string, object> combined = new Dictionary <string, object>(this.initialValues);
                    foreach (var item in parentInitialValues)
                    {
                        combined[item.Key] = item.Value;
                    }

                    this.combinedInitialValues = combined;
                }
                else
                {
                    this.combinedInitialValues = this.initialValues;
                }
            }
            else
            {
                this.combinedInitialValues = parentInitialValues;
            }

            List <UPCRMRecord> initialRecords = record != null ? new List <UPCRMRecord> {
                record
            } : null;

            List <object> editFieldContextArray = this.EditContextsFor(childRow, childFieldControlTab,
                                                                       childEditContext.EditFieldContext, this.combinedInitialValues, initialRecords);
            int editFieldCount = editFieldContextArray.Count;

            if (editFieldCount > 0)
            {
                UPMStandardGroup group = new UPMStandardGroup(new RecordIdentifier(childRow.RootRecordIdentification));
                group.Deletable        = true;
                childEditContext.Group = group;
                this.AddChildRecordContext(childEditContext);
                for (int j = 0; j < editFieldCount; j++)
                {
                    UPEditFieldContext editFieldContext = editFieldContextArray[j] as UPEditFieldContext;
                    if (editFieldContext != null)
                    {
                        editFieldContext.ChildEditContext  = childEditContext;
                        editFieldContext.FieldLabelPostfix = childEditContext.FieldLabelPostfix;
                        List <UPMEditField> editFields = editFieldContext.EditFields;
                        if (editFields.Count > 0)
                        {
                            foreach (UPMEditField editField in editFields)
                            {
                                editField.EditFieldsContext = childEditContext;
                                group.AddField(editField);
                            }
                        }
                        else
                        {
                            UPMField field = editFieldContext.Field;
                            if (field != null)
                            {
                                group.AddField(field);
                            }
                        }
                    }
                    else
                    {
                        group.AddField((UPMField)editFieldContextArray[j]);
                    }
                }

                childEditContext.HandleDependentFields();
                return(group);
            }

            return(null);
        }