Exemplo n.º 1
0
        private UPMEditField CreateMainEditFieldWithParticipantIdentifierEditGroup(IIdentifier participantIdentifier, UPMGroup editGroup)
        {
            var field = new UPMRepEditField(participantIdentifier)
            {
                Group = editGroup,
                GroupModelController = this,
                MultiSelectMode      = false,
                HelpIdentifier       = StringIdentifier.IdentifierWithStringId("RepPartitipant")
            };

            var repType          = UPCRMReps.RepTypeFromString(this.ParticipantsField.Field.RepType);
            var possibleValues   = UPCRMDataStore.DefaultStore.Reps.AllRepsOfTypes(repType);
            var explicitKeyOrder = UPCRMDataStore.DefaultStore.Reps.AllRepIdsOfTypes(repType);
            var repContainer     = UPRepsService.CreateRepContainerForRepType(repType);

            field.RepContainer = repContainer;

            // Adding all rep values from UPCRMDataStore to the PossibleValues list.
            foreach (var obj in possibleValues)
            {
                var possibleValue = new UPMCatalogPossibleValue();
                var valueField    = new UPMStringField(StringIdentifier.IdentifierWithStringId("x"));
                var rep           = obj;
                valueField.StringValue        = rep.RepName;
                possibleValue.TitleLabelField = valueField;
                possibleValue.Key             = rep.RepId;
                field.AddPossibleValue(possibleValue);
            }

            field.NullValueKey     = "0";
            field.ExplicitKeyOrder = explicitKeyOrder;

            return(field);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Offlines the request did fail with error.
        /// </summary>
        /// <param name="request">The request.</param>
        /// <param name="context">The context.</param>
        /// <param name="error">The error.</param>
        public void OfflineRequestDidFailWithError(UPOfflineRecordRequest request, object context, Exception error)
        {
            this.waitForSave = false;
            this.EnableActionItemsDisableActionItems(this.LeftNavigationBarItems, this.RightNaviagtionBarItems);

            Page           page = (Page)this.TopLevelElement;
            UPMStringField errorMessageField = new UPMStringField(StringIdentifier.IdentifierWithStringId("errorField"))
            {
                StringValue = LocalizedString.TextErrorCouldNotBeSaved
            };

            UPMStringField detailErrorMessageField = new UPMStringField(StringIdentifier.IdentifierWithStringId("detailErrorField"))
            {
                StringValue = LocalizedString.Localize(LocalizationKeys.TextGroupErrors, LocalizationKeys.KeyErrorsCouldNotBeSavedDetailMessage)
            };

            UPMErrorStatus errorStatus = new UPMErrorStatus(StringIdentifier.IdentifierWithStringId("error"))
            {
                MessageField       = errorMessageField,
                DetailMessageField = detailErrorMessageField
            };

            page.Status = errorStatus;
            this.InformAboutDidFailTopLevelElement(page);
        }
        /// <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);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="UPMCalendarGroup"/> class.
        /// </summary>
        /// <param name="identifier">
        /// The identifier.
        /// </param>
        public UPMCalendarGroup(IIdentifier identifier)
            : base(identifier)
        {
            UPMStringField field = new UPMStringField(identifier);

            this.AddChild(field);
        }
        /// <summary>
        /// The create edit field.
        /// </summary>
        /// <returns>
        /// The <see cref="UPMEditField"/>.
        /// </returns>
        public override UPMEditField CreateEditField()
        {
            UPMRepEditField field            = new UPMRepEditField(this.FieldIdentifier);
            UPCRMRepType    repType          = UPCRMReps.RepTypeFromString(this.FieldConfig.Field.RepType);
            var             possibleValues   = UPCRMDataStore.DefaultStore.Reps.AllRepsOfTypes(repType);
            var             explicitKeyOrder = UPCRMDataStore.DefaultStore.Reps.AllRepIdsOfTypes(repType);
            var             repContainer     = UPRepsService.CreateRepContainerForRepType(repType);

            field.RepContainer = repContainer;

            // Adding all rep values from UPCRMDataStore to the PossibleValues list.
            foreach (var obj in possibleValues)
            {
                UPMCatalogPossibleValue possibleValue = new UPMCatalogPossibleValue();
                UPMStringField          valueField    = new UPMStringField(StringIdentifier.IdentifierWithStringId("x"));
                UPCRMRep rep = obj;
                valueField.StringValue        = rep.RepName;
                possibleValue.TitleLabelField = valueField;
                possibleValue.Key             = rep.RepId;
                field.AddPossibleValue(possibleValue);
            }

            field.SetFieldValue(this.OriginalValue);
            field.NullValueKey     = "0";
            field.ExplicitKeyOrder = explicitKeyOrder;
            this.ApplyAttributesOnEditFieldConfig(field, this.FieldConfig);

            return(field);
        }
        private static List <UPMField> CreateFieldArray(UPMGridPage searchPage, List <object> columnInfoArray)
        {
            var fieldArray = new List <UPMField>();
            var i          = 0;

            foreach (AnalysisDrillThruColumn col in columnInfoArray)
            {
                var fieldType = col.SourceField.CrmFieldInfo.FieldType;
                if (fieldType == "F" || fieldType == "L" || fieldType == "S")
                {
                    searchPage.SetColumnInfoAtIndexDataTypeSpecialSort(i, UPMColumnDataType.Numeric, false);
                }
                else if (fieldType == "D")
                {
                    searchPage.SetColumnInfoAtIndexDataTypeSpecialSort(i, UPMColumnDataType.Date, false);
                }

                var field = new UPMStringField(StringIdentifier.IdentifierWithStringId($"col {++i}"))
                {
                    StringValue = col.DataSourceField.Label
                };
                fieldArray.Add(field);
            }

            return(fieldArray);
        }
        private void Save(object actionDictionary)
        {
            List <UPCRMRecord> changedRecords = null;
            UPObjectives       objectives     = null;

            foreach (UPPageModelController modelController in this.PageModelControllers)
            {
                var objectivesEditPageModelController = modelController as ObjectivesEditPageModelController;
                if (objectivesEditPageModelController != null)
                {
                    changedRecords = objectivesEditPageModelController.ChangedRecords();
                    objectives     = objectivesEditPageModelController.ObjectivesCore;
                }
            }

            if (changedRecords == null)
            {
                this.NoChangesWhileSaving();
                return;
            }

            UPMProgressStatus stillLoadingError = new UPMProgressStatus(StringIdentifier.IdentifierWithStringId("savingIdentifier"));
            UPMStringField    statusField       = new UPMStringField(StringIdentifier.IdentifierWithStringId("statusFieldIdentifier"));

            statusField.FieldValue = LocalizedString.TextWaitForChanges;
            stillLoadingError.StatusMessageField = statusField;
            this.Organizer.Status = stillLoadingError;
            this.InformAboutDidChangeTopLevelElement(this.TopLevelElement, this.TopLevelElement, null, null);
            objectives.OfflineRequest.StartRequest(UPOfflineRequestMode.OnlineConfirm, changedRecords, this);
        }
        private static void UpdateField(UPMStringField field, FieldAttributes fieldAttributes, UPConfigFieldControlField fieldConfig, string fieldValue)
        {
            if (fieldConfig.Attributes.ExtendedOptionIsSet("newLine"))
            {
                field.NewLine = true;
            }

            var    multilineInGridMaxRows = 2;
            object migmrAsObject          = fieldAttributes.ExtendedOptions.ValueOrDefault("multiLineMaxRows");

            if (migmrAsObject != null)
            {
                multilineInGridMaxRows = int.Parse((string)migmrAsObject);
                multilineInGridMaxRows = Math.Max(2, multilineInGridMaxRows);
            }

            field.MultilineInGridMaxRows = multilineInGridMaxRows;
            field.StripNewLines          = fieldAttributes.NoMultiLine;
            var htmlField = fieldConfig.Field.FieldInfo?.HtmlField == true;

            field.StringValue = htmlField ? fieldValue.StripHtml() : fieldValue;

            if (!fieldAttributes.NoLabel)
            {
                field.LabelText = fieldConfig.Label;
            }
        }
Exemplo n.º 9
0
        /// <summary>
        /// Saves the specified action dictionary.
        /// </summary>
        /// <param name="actionDictionary">The action dictionary.</param>
        public override void Save(object actionDictionary)
        {
            this.DisableAllActionItems(true);
            Dictionary <string, UPEditFieldContext> changedFields = this.ChangedFields();

            if (changedFields == null || changedFields.Count == 0)
            {
                this.ModelControllerDelegate.PopToPreviousContentViewController();
                return;
            }

            ServiceInfo serviceInfo = ServerSession.CurrentSession.ServiceInfoForServiceName("ChangeConfiguration");
            ChangeConfigurationServerOperation request = new ChangeConfigurationServerOperation(changedFields, this);

            if (string.CompareOrdinal(serviceInfo.Version, "1.1") <= 0)
            {
                UPMProgressStatus stillLoadingError = new UPMProgressStatus(StringIdentifier.IdentifierWithStringId("savingIdentifier"));
                UPMStringField    statusField       = new UPMStringField(StringIdentifier.IdentifierWithStringId("statusFieldIdentifier"));
                statusField.FieldValue = LocalizedString.Localize(LocalizationKeys.TextGroupProcesses, LocalizationKeys.KeyProcessesEditSavingChangesProgressMessage);
                stillLoadingError.StatusMessageField = statusField;
                this.Organizer.Status = stillLoadingError;
                this.InformAboutDidChangeTopLevelElement(this.TopLevelElement, this.TopLevelElement, null, null);
                ServerSession.CurrentSession.ExecuteRequest(request);
            }
            else
            {
                request.StoreWebConfigParametersLocally();
                UPChangeManager.CurrentChangeManager.RegisterChanges(new List <IIdentifier> {
                    StringIdentifier.IdentifierWithStringId("Configuration")
                });
                this.ModelControllerDelegate.PopToPreviousContentViewController();
            }
        }
        private void AddCategoryActionsToRow(UPMResultRow row)
        {
            var      categories      = this.Analysis.CategoryDictionary.Values;
            UPMGroup detailGroupCol1 = new UPMGroup(StringIdentifier.IdentifierWithStringId("det1"));

            foreach (AnalysisCategory category in categories)
            {
                UPMStringField field = new UPMStringField(null)
                {
                    LabelText   = category.Key,
                    StringValue = category.Label
                };

                detailGroupCol1.AddField(field);
            }

            row.AddDetailGroup(detailGroupCol1);
            UPMGroup detailGroupCol2 = new UPMGroup(StringIdentifier.IdentifierWithStringId("det2"));

            row.AddDetailGroup(detailGroupCol2);
            foreach (var analysisResultColumn in this.AnalysisSettings.ResultColumns)
            {
                UPMStringField field = new UPMStringField(null)
                {
                    LabelText   = analysisResultColumn.Key,
                    StringValue = analysisResultColumn.Label
                };
                detailGroupCol2.AddField(field);
            }
        }
Exemplo n.º 11
0
        // functionName == nil => all Fields
        private static List <UPMStringField> FieldsForResultRow(UPCRMResultRow row, string functionName, int tabIndex, bool addHidden)
        {
            List <UPMStringField> fields             = new List <UPMStringField>();
            FieldControlTab       sourceFieldControl = row.Result.MetaInfo.SourceFieldControl.TabAtIndex(tabIndex);
            int offset     = tabIndex == 0 ? 0 : row.Result.MetaInfo.SourceFieldControl.TabAtIndex(0).Fields.Count;
            int fieldCount = tabIndex == 0 ? sourceFieldControl.Fields.Count : row.NumberOfColumns;

            for (int rowFieldIndex = 0; rowFieldIndex < fieldCount;)
            {
                string fieldFunctionNames = sourceFieldControl.FieldAtIndex(rowFieldIndex)?.Function ?? string.Empty;
                var    functionNames      = fieldFunctionNames.Split(',').ToList();
                functionNames = functionNames.Count == 0 ? new List <string> {
                    string.Empty
                } : functionNames;
                UPConfigFieldControlField configField = sourceFieldControl.FieldAtIndex(rowFieldIndex);
                FieldAttributes           attributes  = configField?.Attributes;
                bool found = false;
                foreach (string fieldFunctionName in functionNames)
                {
                    if (functionName == null || fieldFunctionName.StartsWith(functionName))
                    {
                        UPMStringField stringField = new UPMStringField(new FieldIdentifier(row.RecordIdentificationAtIndex(0), configField.Field.FieldIdentification));
                        stringField.Hidden = attributes.Hide;
                        if (attributes.FieldCount > 0)
                        {
                            List <string> combineFields = new List <string>();
                            for (int fieldIndex = 0; fieldIndex < attributes.FieldCount; fieldIndex++)
                            {
                                combineFields.Add(row.ValueAtIndex(rowFieldIndex + offset));
                                rowFieldIndex++;
                            }

                            stringField.StringValue = attributes.FormatValues(combineFields);
                        }
                        else
                        {
                            stringField.StringValue = row.ValueAtIndex(rowFieldIndex + offset);
                            rowFieldIndex++;
                        }

                        if (addHidden || !stringField.Hidden)
                        {
                            fields.Add(stringField);
                        }

                        found = true;
                    }
                }

                if (!found)
                {
                    rowFieldIndex++;
                }
            }

            return(fields);
        }
Exemplo n.º 12
0
        private void ApplyLoadingStatusOnOrganizer(UPMOrganizer organizer)
        {
            UPMProgressStatus progressStatus = new UPMProgressStatus(StringIdentifier.IdentifierWithStringId("loadingIdentifier"));
            UPMStringField    statusField    = new UPMStringField(StringIdentifier.IdentifierWithStringId("statusFieldIdentifier"));

            statusField.FieldValue            = LocalizedString.TextLoadingData;
            progressStatus.StatusMessageField = statusField;
            organizer.Status = progressStatus;
        }
Exemplo n.º 13
0
        private void ApplyLoadingStatusOnPage(Page page)
        {
            UPMProgressStatus stillLoadingError = new UPMProgressStatus(StringIdentifier.IdentifierWithStringId("loadingIdentifier"));
            UPMStringField    statusField       = new UPMStringField(StringIdentifier.IdentifierWithStringId("statusFieldIdentifier"));

            statusField.StringValue = LocalizedString.TextLoadingData;
            stillLoadingError.StatusMessageField = statusField;
            page.Status = stillLoadingError;
        }
        /// <summary>
        /// Creates the field.
        /// </summary>
        /// <returns>
        /// The <see cref="UPMField"/>.
        /// </returns>
        public override UPMField CreateField()
        {
            var stringField = new UPMStringField(this.FieldIdentifier)
            {
                EditFieldContext = this
            };

            return(stringField);
        }
        private static UPMStringField CreateStringField(FieldIdentifier fieldIdentifier, FieldAttributes fieldAttributes, string fieldValue)
        {
            var field = new UPMStringField(fieldIdentifier)
            {
                StripNewLines = fieldAttributes.NoMultiLine,
                StringValue   = fieldValue
            };

            return(field);
        }
        /// <summary>
        /// Creates the edit field.
        /// </summary>
        /// <returns>
        /// The <see cref="UPMEditField"/>.
        /// </returns>
        public override UPMEditField CreateEditField()
        {
            var field             = new UPMCatalogSelectorEditField(this.FieldIdentifier);
            var dict              = this.FieldConfig.Attributes.Selector;
            var descriptionFormat = dict?.ValueOrDefault("DescriptionFormat") as string;
            var detailsFormat     = dict?.ValueOrDefault("DetailsFormat") as string;

            foreach (var p in this.selector.PossibleValues)
            {
                var possibleValue = new UPMCatalogPossibleValue {
                    Key = p.Key
                };

                var valueField = new UPMStringField(StringIdentifier.IdentifierWithStringId($"titleLabel-{p.Key}"));

                var selectorOption = p.Value;
                valueField.StringValue        = selectorOption.Name;
                possibleValue.TitleLabelField = valueField;
                if (!string.IsNullOrEmpty(descriptionFormat))
                {
                    var title2 = selectorOption.LabelWithFormat(descriptionFormat);
                    if (!string.IsNullOrEmpty(title2))
                    {
                        var title2Field =
                            new UPMStringField(StringIdentifier.IdentifierWithStringId($"title2Label-{p.Key}"))
                        {
                            StringValue = title2
                        };

                        possibleValue.TitleLabel2Field = title2Field;
                    }
                }

                if (!string.IsNullOrEmpty(detailsFormat))
                {
                    var details      = selectorOption.LabelWithFormat(detailsFormat);
                    var detailsField =
                        new UPMStringField(StringIdentifier.IdentifierWithStringId($"detailLabel-{p.Key}"))
                    {
                        StringValue = details
                    };

                    possibleValue.DetailLabelField = detailsField;
                }

                field.AddPossibleValue(possibleValue);
            }

            field.ExplicitKeyOrder = this.selector.ExplicitKeyOrder;
            field.NullValueKey     = "0";
            field.ContinuousUpdate = true;
            field.Selector         = this.selector;
            this.ApplyAttributesOnEditFieldConfig(field, this.FieldConfig);
            return(field);
        }
Exemplo n.º 17
0
        /// <inheritdoc/>
        public override void ApplyLoadingStatusOnPage(Page page)
        {
            UPMProgressStatus loadinfStatus = new UPMProgressStatus(StringIdentifier.IdentifierWithStringId("loadingIdentifier"));
            UPMStringField    statusField   = new UPMStringField(StringIdentifier.IdentifierWithStringId("statusFieldIdentifier"))
            {
                FieldValue = LocalizedString.TextLoadingData
            };

            loadinfStatus.StatusMessageField = statusField;
            page.Status = loadinfStatus;
        }
        private UPMGroup CreateMultilineGroup(string recordIdentification, UPMStringField field, UPConfigFieldControlField fieldConfig)
        {
            var multilineGroup = new UPMMultilineGroup(this.TabIdentifierForRecordIdentification(recordIdentification))
            {
                LabelText            = this.TabLabel,
                MultilineStringField = field,
                Html = fieldConfig.Field.FieldInfo.HtmlField
            };

            return(multilineGroup);
        }
Exemplo n.º 19
0
        /// <summary>
        /// Adds the no conflicts found page.
        /// </summary>
        /// <param name="conflictPage">The conflict page.</param>
        public void AddNoConflictsFoundPage(UPMSyncConflictsPage conflictPage)
        {
            UPMInfoMessageStatus infoMessageStatus = new UPMInfoMessageStatus(StringIdentifier.IdentifierWithStringId("noConflictsFoundIdentifier"));
            UPMStringField       statusField       = new UPMStringField(StringIdentifier.IdentifierWithStringId("noConflictsFoundFieldIdentifier"));

            statusField.FieldValue = LocalizedString.Localize(
                LocalizationKeys.TextGroupBasic,
                this.ShowAllOfflineRequests ? LocalizationKeys.KeyBasicSyncConflictsNoOfflineRecordsFound : LocalizationKeys.KeyBasicSyncConflictsNoConflictsFound);

            infoMessageStatus.DetailMessageField = statusField;
            conflictPage.Status = infoMessageStatus;
        }
        /// <summary>
        /// Applies the loading status on page.
        /// </summary>
        /// <param name="page">The page.</param>
        public virtual void ApplyLoadingStatusOnPage(Page page)
        {
            var stillLoadingError = new UPMProgressStatus(StringIdentifier.IdentifierWithStringId("loadingIdentifier"));

            var statusField = new UPMStringField(StringIdentifier.IdentifierWithStringId("statusFieldIdentifier"))
            {
                FieldValue = LocalizedString.TextLoadingData
            };

            stillLoadingError.StatusMessageField = statusField;
            page.Status = stillLoadingError;
        }
Exemplo n.º 21
0
        /// <summary>
        /// Builds the page.
        /// </summary>
        public void BuildPage()
        {
            UPMSyncConflictsPage page           = new UPMSyncConflictsPage(StringIdentifier.IdentifierWithStringId("SyncConflictsPage"));
            UPMProgressStatus    progressStatus = new UPMProgressStatus(StringIdentifier.IdentifierWithStringId("savingIdentifier"));
            UPMStringField       statusField    = new UPMStringField(StringIdentifier.IdentifierWithStringId("statusFieldIdentifier"));

            statusField.FieldValue            = LocalizedString.TextLoadingData;
            progressStatus.StatusMessageField = statusField;
            page.Status          = progressStatus;
            page.Invalid         = true;
            this.TopLevelElement = page;
        }
        private List <UPMField> CreateFieldArray()
        {
            var fieldArray = new List <UPMField>();

            var stringField = new UPMStringField(StringIdentifier.IdentifierWithStringId("analysis"))
            {
                StringValue = this.Analysis.Configuration.UnitName
            };

            fieldArray.Add(stringField);

            return(fieldArray);
        }
Exemplo n.º 23
0
        private UPMCharacteristicsPage PageForOverview(Page page)
        {
            UPMCharacteristicsPage newPage = (UPMCharacteristicsPage)this.InstantiatePage();

            newPage.IsReadOnly = true;
            foreach (UPMCharacteristicsItemGroup group in page.Children)
            {
                UPMCharacteristicsItemGroup newGroup = new UPMCharacteristicsItemGroup(group.Identifier);
                newGroup.GroupNameField             = new UPMStringField(group.GroupNameField.Identifier);
                newGroup.GroupNameField.StringValue = group.GroupNameField.StringValue;
                newGroup.ShowExpanded = true;
                newGroup.GroupType    = group.GroupType;

                foreach (UPMCharacteristicsItem item in group.Children)
                {
                    if (item.SelectedField.BoolValue)
                    {
                        UPMCharacteristicsItem newItem = new UPMCharacteristicsItem(item.Identifier)
                        {
                            ItemNameField = new UPMStringField(item.ItemNameField.Identifier),
                            SelectedField = new UPMBooleanEditField(item.SelectedField.Identifier)
                        };
                        newItem.ItemNameField.StringValue = item.ItemNameField.StringValue;
                        newItem.SelectedField.BoolValue   = true;

                        List <UPMField> additionalFields = new List <UPMField>();
                        foreach (UPMEditField editField in item.EditFields)
                        {
                            UPMField newField = new UPMStringField(editField.Identifier);
                            newField.LabelText = editField.LabelText;
                            if (!editField.Empty)
                            {
                                newField.FieldValue = editField.StringDisplayValue;
                                additionalFields.Add(newField);
                            }
                        }

                        newItem.EditFields = additionalFields;
                        newGroup.AddChild(newItem);
                    }
                }

                if (newGroup.Children.Count > 0)
                {
                    newPage.AddChild(newGroup);
                }
            }

            return(newPage);
        }
        /// <summary>
        /// Loads the node sub nodes.
        /// </summary>
        public override void LoadNodeSubNodes()
        {
            this.tmpGroupNode = null;
            string recordIdentification = this.RootNode.GroupNode
                ? ((RecordIdentifier)this.RootNode.Parent.Identifier).RecordIdentification
                : ((RecordIdentifier)this.RootNode.Identifier).RecordIdentification;

            if ((this.childrenTreeConfig.Flags & UPConfigTreeViewTableFlags.HideGroupNode) > 0 || this.RootNode.GroupNode)
            {
                UPContainerMetaInfo query = this.CreateQueryWithRecordIdentifier(recordIdentification);
                if (query != null)
                {
                    query.Find(this.requestOption, this);
                }
                else
                {
                    SimpleIoc.Default.GetInstance <ILogger>().LogWarn("Nodes not loaded. SearchAndList missing?");
                    this.TheDelegate.NodesLoadFailedError(this, null);
                }
            }
            else
            {
                // Create static Group Nodes
                IConfigurationUnitStore configStore = ConfigurationUnitStore.DefaultStore;

                // Create Node
                // id ParentNodeId + SearchAndListName
                string idString = $"Node {this.childrenTreeConfig.SearchAndListName}, {recordIdentification}";
                this.tmpGroupNode        = new UPMCoINode(StringIdentifier.IdentifierWithStringId(idString));
                this.tmpGroupNode.Parent = this.RootNode;
                UPMStringField titleField = new UPMStringField(StringIdentifier.IdentifierWithStringId($"Title {this.childrenTreeConfig.SearchAndListName}"));
                titleField.StringValue = this.childrenTreeConfig.Label;
                List <UPMStringField> fields = new List <UPMStringField> {
                    titleField
                };
                this.tmpGroupNode.Fields     = fields;
                this.tmpGroupNode.InfoFields = fields;
                this.tmpGroupNode.GroupNode  = true;
                //this.tmpGroupNode.Icon = UIImage.UpImageWithFileName(configStore.InfoAreaConfigById(this.childrenTreeConfig.InfoAreaId).ImageName);  // CRM-5007

                // load next Level directly to avoid Empty Static Nodes
                CoITreeNodeLoader loader = new CoITreeNodeLoader(this.tmpGroupNode, this.childrenTreeConfig, this.viewReference, 0, this.vistedNodes, this.nodeConfigMapping, this.recordIdentifierInfoAreaConfigMapping);
                loader.Mode        = CoINodeLoaderMode.InitialLoad;
                loader.TheDelegate = this;
                this.subNodeLoader.Add(loader);
                this.pendingCount++;
                loader.LoadNodeSubNodes();
            }
        }
        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);
        }
Exemplo n.º 26
0
        /// <summary>
        /// Saves the specified action dictionary.
        /// </summary>
        /// <param name="actionDictionary">The action dictionary.</param>
        public void Save(object actionDictionary)
        {
            List <UPCRMRecord> changedRecords  = null;
            UPCharacteristics  characteristics = null;

            foreach (UPPageModelController modelController in this.PageModelControllers)
            {
                var characteristicsEditPageModelController = modelController as UPCharacteristicsEditPageModelController;
                if (characteristicsEditPageModelController != null)
                {
                    changedRecords  = characteristicsEditPageModelController.ChangedRecords();
                    characteristics = characteristicsEditPageModelController.Characteristics;
                    break;
                }
            }

            if (this.conflictEditOfflineRequest != null)
            {
                bool onlineRequestNecessary = changedRecords?.Any(record => !(record.Deleted && record.IsNew)) ?? false;

                if (onlineRequestNecessary)
                {
                    this.conflictEditOfflineRequest.StartRequest(UPOfflineRequestMode.OnlineOnly, changedRecords, this);
                }
                else
                {
                    this.conflictEditOfflineRequest.DeleteRequest(true);
                    this.ModelControllerDelegate.PopToRootContentViewController();
                }

                return;
            }

            if (changedRecords == null || changedRecords.Count == 0)
            {
                this.NoChangesWhileSaving();
                return;
            }

            UPMProgressStatus stillLoadingError = new UPMProgressStatus(StringIdentifier.IdentifierWithStringId("savingIdentifier"));
            UPMStringField    statusField       = new UPMStringField(StringIdentifier.IdentifierWithStringId("statusFieldIdentifier"));

            statusField.FieldValue = LocalizedString.TextWaitForChanges;
            stillLoadingError.StatusMessageField = statusField;
            this.Organizer.Status = stillLoadingError;
            this.InformAboutDidChangeTopLevelElement(this.TopLevelElement, this.TopLevelElement, null, null);
            characteristics.OfflineRequest.StartRequest(UPOfflineRequestMode.OnlineConfirm, changedRecords, this);
        }
Exemplo n.º 27
0
 /// <summary>
 /// Sets the message details.
 /// </summary>
 /// <param name="message">
 /// The message.
 /// </param>
 /// <param name="details">
 /// The details.
 /// </param>
 public void SetMessageDetails(string message, string details)
 {
     this.MessageField = new UPMStringField(this.Identifier)
     {
         StringValue = message
     };
     if (!string.IsNullOrEmpty(details))
     {
         this.Children.Clear();
         this.DetailMessageField = new UPMStringField(this.Identifier)
         {
             StringValue = details
         };
         this.Children.Add(this.DetailMessageField);
     }
 }
Exemplo n.º 28
0
        /// <summary>
        /// Updates the ek event values.
        /// </summary>
        public void UpdateEKEventValues()
        {
            UPResultRowEventStoreFormatter formatter = new UPResultRowEventStoreFormatter();
            List <string>   stringArray = null; // formatter.ListFieldValuesFromEvent(this.IPadCalendarItem);
            List <UPMField> listFields  = new List <UPMField>(stringArray.Count);

            foreach (string s in stringArray)
            {
                UPMStringField textField = new UPMStringField(StringIdentifier.IdentifierWithStringId("Field"));
                textField.FieldValue = s;
                listFields.Add(textField);
            }

            this.Fields  = listFields;
            this.Invalid = false;
        }
Exemplo n.º 29
0
        /// <summary>
        /// Pages for overview.
        /// </summary>
        /// <param name="page">The page.</param>
        /// <returns></returns>
        public Page PageForOverview(Page page)
        {
            Page newPage = this.InstantiatePage();

            if (this.portfolioGroup != null)
            {
                newPage.AddGroup(this.portfolioGroup);
            }

            foreach (UPMQuestionnaireGroup currentGroup in page.Groups)
            {
                UPMQuestionnaireGroup questionnaireGroup = new UPMQuestionnaireGroup(currentGroup.Identifier)
                {
                    LabelText = currentGroup.LabelText
                };
                bool insertGroup = false;
                foreach (UPMQuestionnaireQuestion currentQuestion in currentGroup.Questions)
                {
                    if (currentQuestion.Field.Empty)
                    {
                        continue;
                    }

                    insertGroup = true;
                    UPMEditField editField = (UPMEditField)currentQuestion.Field;
                    UPMField     field     = new UPMStringField(editField.Identifier)
                    {
                        LabelText = editField.LabelText
                    };
                    if (!editField.Empty)
                    {
                        field.FieldValue = editField.StringDisplayValue;
                    }

                    UPMQuestionnaireQuestion questionnaireQuestion = new UPMQuestionnaireQuestion(field);
                    questionnaireGroup.AddQuestion(questionnaireQuestion);
                }

                if (insertGroup)
                {
                    newPage.AddGroup(questionnaireGroup);
                }
            }

            return(newPage);
        }
        private static UPMStringField CreateStringField(FieldAttributes fieldAttributes, FieldIdentifier fieldIdentifier)
        {
            UPMStringField field;
            var            phoneInExtendedOptions = fieldAttributes?.ExtendedOptions?.ValueOrDefault("phone");

            if (phoneInExtendedOptions != null)
            {
                field = new UPMPhoneField(fieldIdentifier);
                ((UPMPhoneField)field).UseTelprompt = phoneInExtendedOptions == "telprompt";
            }
            else
            {
                field = new UPMStringField(fieldIdentifier);
            }

            return(field);
        }