コード例 #1
0
        /// <summary>
        /// Sets the fields from field control.
        /// </summary>
        /// <param name="fieldControl">The field control.</param>
        public void SetFieldsFromFieldControl(FieldControl fieldControl)
        {
            UPConfigFieldControlField field = fieldControl.FieldWithFunction("Requirement");

            if (field != null)
            {
                this.RequirementField = field.Field;
            }

            field = fieldControl.FieldWithFunction("Acceptance");

            if (field != null)
            {
                this.AcceptanceField = field.Field;
            }
        }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UPCRMParticipants"/> class.
        /// </summary>
        /// <param name="viewReference">The view reference.</param>
        /// <param name="rootInfoAreaId">The root information area identifier.</param>
        /// <param name="linkParticipantsInfoAreaId">The link participants information area identifier.</param>
        /// <param name="linkParticipantsLinkId">The link participants link identifier.</param>
        /// <param name="recordIdentification">The record identification.</param>
        /// <param name="theDelegate">The delegate.</param>
        public UPCRMParticipants(ViewReference viewReference, string rootInfoAreaId, string linkParticipantsInfoAreaId, int linkParticipantsLinkId, string recordIdentification, UPCRMParticipantsDelegate theDelegate)
        {
            this.RecordIdentification = recordIdentification;
            this.TheDelegate          = theDelegate;

            this.RootInfoAreaId = rootInfoAreaId ?? recordIdentification.InfoAreaId();

            if (string.IsNullOrEmpty(this.RootInfoAreaId))
            {
                this.RootInfoAreaId = "MA";
            }

            this.linkParticipantsInfoAreaId = linkParticipantsInfoAreaId;
            this.linkParticipantsLinkId     = linkParticipantsLinkId;

            if (viewReference == null)
            {
                Menu menu = ConfigurationUnitStore.DefaultStore.MenuByName($"Configuration:{this.RootInfoAreaId}Participants");
                this.ViewReference = menu?.ViewReference;
            }
            else
            {
                this.ViewReference = viewReference;
            }

            this.RepParticipantsRequestOption = UPCRMDataStore.RequestOptionFromString(this.ViewReference?.ContextValueForKey("RepAcceptanceRequestOption"), UPRequestOption.FastestAvailable);
            this.AcceptanceFieldId            = -1;
            string configName = this.ViewReference?.ContextValueForKey("RepAcceptanceConfigName");

            if (!string.IsNullOrEmpty(configName))
            {
                IConfigurationUnitStore configStore   = ConfigurationUnitStore.DefaultStore;
                SearchAndList           searchAndList = configStore.SearchAndListByName(configName);

                if (!string.IsNullOrEmpty(searchAndList.FieldGroupName))
                {
                    configName = searchAndList.FieldGroupName;
                }

                FieldControl fieldControl = configStore.FieldControlByNameFromGroup("Edit", configName) ??
                                            configStore.FieldControlByNameFromGroup("List", configName);

                if (fieldControl != null)
                {
                    UPConfigFieldControlField field = fieldControl.FieldWithFunction(Constants.UPRepAcceptanceFunctionName_Acceptance);
                    if (field != null)
                    {
                        this.AcceptanceFieldId = field.FieldId;
                    }

                    this.RepAcceptanceInfoAreaId = fieldControl.InfoAreaId;
                }
            }
        }
コード例 #3
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
        }