Beispiel #1
0
        private UPMResultSection GetResultSection(
            UPMSearchPage searchPage,
            UPCRMResult result,
            bool hasSections,
            bool optimizeForSpeed,
            out bool doContinue)
        {
            if (searchPage == null)
            {
                throw new ArgumentNullException(nameof(searchPage));
            }

            doContinue = true;

            UPMResultSection resultSection = null;

            if (!hasSections)
            {
                if (optimizeForSpeed)
                {
                    resultSection = new UPMResultSection(
                        StringIdentifier.IdentifierWithStringId(@"Result_Section_1"),
                        new UPResultRowProviderForCRMResult(result, this));
                    this.SearchPage.AddResultSection(resultSection);
                    doContinue = false;
                }

                resultSection = new UPMResultSection(StringIdentifier.IdentifierWithStringId(@"Result_Section_1"));
                this.SearchPage.AddResultSection(resultSection);
            }
            else
            {
                // Date or Catalog Field --> Kein Section Index
                searchPage.HideSectionIndex = this.ResultContext.SectionFieldComplete;
            }

            return(resultSection);
        }
Beispiel #2
0
        /// <summary>
        /// Tileses the did finish with success.
        /// </summary>
        /// <param name="crmTiles">The CRM tiles.</param>
        /// <param name="data">The data.</param>
        public void TilesDidFinishWithSuccess(UPCRMTiles crmTiles, object data)
        {
            this.Tiles = crmTiles;
            UPMOrganizer detailOrganizer = (UPMOrganizer)this.TopLevelElement;

            if (detailOrganizer.ExpandFound)
            {
                List <UPMTile> recordTiles = new List <UPMTile>();
                foreach (UPCRMTile tile in this.Tiles.Tiles)
                {
                    if (string.IsNullOrEmpty(tile.Value) && string.IsNullOrEmpty(tile.Text))
                    {
                        continue;
                    }

                    UPMTile tileElement = new UPMTile(StringIdentifier.IdentifierWithStringId("Tile"))
                    {
                        TextField = new UPMStringField(StringIdentifier.IdentifierWithStringId("TileText"))
                        {
                            StringValue = tile.Text
                        },
                        ValueField = new UPMStringField(StringIdentifier.IdentifierWithStringId("ValueText"))
                        {
                            StringValue = tile.Value
                        },
                        ImageName = tile.ImageName
                    };
                    recordTiles.Add(tileElement);
                }

                detailOrganizer.Tiles = recordTiles;
                this.InformAboutDidChangeTopLevelElement(this.Organizer, this.Organizer, null, UPChangeHints.ChangeHintsWithHint("RecordDataChanged"));
            }
            else
            {
                this.ContinueBuildDetailsOrganizerPageTilesLoaded();
            }
        }
Beispiel #3
0
        /// <summary>
        /// Adds row actions
        /// </summary>
        /// <param name="expand">Expand</param>
        /// <param name="resultRow">Result row</param>
        /// <param name="recordId">Record id</param>
        public override void AddRowActions(UPConfigExpand expand, UPMResultRow resultRow, string recordId)
        {
            base.AddRowActions(expand, resultRow, recordId);

            if (this.PreparedSearch.FilterBasedDecision != null)
            {
                var rowContext    = this.ResultContext.RowDictionary[resultRow.Key];
                var actionButtons = this.PreparedSearch.FilterBasedDecision.ButtonsForResultRow(rowContext.Row);

                if (actionButtons.Count > 0)
                {
                    foreach (UPConfigButton buttonDef in actionButtons)
                    {
                        string iconName   = string.Empty;
                        string buttonName = buttonDef.UnitName;

                        if (buttonDef.ViewReference != null)
                        {
                            var action = new UPMOrganizerAction(StringIdentifier.IdentifierWithStringId($"action.{buttonName}"));

                            var viewReference = buttonDef.ViewReference.ViewReferenceWith(recordId);
                            viewReference = viewReference.ViewReferenceWith(new Dictionary <string, object> {
                                { ".fromPopup", 1 }
                            });
                            action.ViewReference = viewReference;

                            if (!string.IsNullOrEmpty(iconName))
                            {
                                action.IconName = iconName;
                            }

                            action.LabelText = buttonDef.Label;
                            resultRow.AddDetailAction(action);
                        }
                    }
                }
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="UPInBoxPageModelController"/> class.
        /// </summary>
        /// <param name="viewReference">The view reference.</param>
        public UPInBoxPageModelController(ViewReference viewReference)
            : base(viewReference)
        {
            UPMInBoxPage page = new UPMInBoxPage(StringIdentifier.IdentifierWithStringId("Inbox"))
            {
                Invalid = true,
                SkipUploadIfPossible = viewReference.ContextValueIsSet("SkipUploadPageIfPossible")
            };

            this.removeUploadedFileFromInbox = viewReference.ContextValueIsSet("RemoveUploadedFile");
            this.TopLevelElement             = page;
            this.editFieldContexts           = new Dictionary <StringIdentifier, UPEditFieldContext>();
            IConfigurationUnitStore configStore      = ConfigurationUnitStore.DefaultStore;
            FieldControl            editFieldControl = configStore.FieldControlByNameFromGroup("Edit", viewReference.ContextValueForKey("UploadFields"));
            UPMGroup uploadFieldGroup = new UPMGroup(StringIdentifier.IdentifierWithStringId("uploadFieldGroup"));

            if (editFieldControl != null)
            {
                int numberOfFields = editFieldControl.NumberOfFields;
                for (int index = 0; index < numberOfFields; index++)
                {
                    UPConfigFieldControlField field                 = editFieldControl.FieldAtIndex(index);
                    StringIdentifier          fieldIdentifier       = StringIdentifier.IdentifierWithStringId($"Field {field.FieldId} {field.InfoAreaId}");
                    UPEditFieldContext        initialValueEditField = UPEditFieldContext.FieldContextFor(field, fieldIdentifier, null, (List <UPEditFieldContext>)null);
                    this.editFieldContexts[fieldIdentifier] = initialValueEditField;
                    if (field.Function == "Filename")
                    {
                        page.FileNameEditField = initialValueEditField.EditField;
                    }

                    uploadFieldGroup.AddField(initialValueEditField.EditField);
                }
            }

            this.recordIdentification = this.ViewReference.ContextValueForKey("RecordId");
            page.UploadFieldGroup     = uploadFieldGroup; // load directly
            this.UpdatedElement(page);
        }
Beispiel #5
0
        private static UPMContactTime CreateContactTime(string fromDateString, string toDateString, int weekDay, string timeType)
        {
            var today    = DateTime.Now;
            var hour     = fromDateString.HourFromCrmTime();
            var minute   = fromDateString.MinuteFromCrmTime();
            var fromDate = new DateTime(today.Year, today.Month, today.Day, hour, minute, 0);

            hour   = toDateString.HourFromCrmTime();
            minute = toDateString.MinuteFromCrmTime();
            var toDate   = new DateTime(today.Year, today.Month, today.Day, hour, minute, 0);
            var fromTime = new UPMDateTimeEditField(StringIdentifier.IdentifierWithStringId("fromTime"))
            {
                Type      = DateTimeType.Time,
                DateValue = fromDate
            };
            var toTime = new UPMDateTimeEditField(StringIdentifier.IdentifierWithStringId("toTime"))
            {
                Type      = DateTimeType.Time,
                DateValue = toDate
            };

            return(new UPMContactTime(weekDay, timeType, fromTime, toTime));
        }
Beispiel #6
0
        private UPMObjective CreateObjectiveIdentfier(UPObjectivesItem item, IIdentifier identifier)
        {
            UPMObjective objective = new UPMObjective(identifier);

            objective.ObjectiveItem = null;
            UPMStringField titleField = new UPMStringField(StringIdentifier.IdentifierWithStringId($"{identifier.IdentifierAsString}-title"));

            titleField.StringValue = item.TitleFieldValue;
            UPMStringField subtitleField = new UPMStringField(StringIdentifier.IdentifierWithStringId($"{identifier.IdentifierAsString}-subtitle"));

            subtitleField.StringValue = item.SubTitelFieldValue;
            UPMStringField dateField = new UPMStringField(StringIdentifier.IdentifierWithStringId($"{identifier.IdentifierAsString}-date"));

            dateField.StringValue = DateExtensions.LocalizedFormattedDate(item.Date);
            objective.AddMainField(titleField);
            objective.AddMainField(subtitleField);
            objective.AddMainField(dateField);
            objective.DoneField                   = new UPMBooleanEditField(StringIdentifier.IdentifierWithStringId($"{identifier.IdentifierAsString}-done"));
            objective.DoneField.BoolValue         = item.Completed;
            objective.CanBeDeletedField           = new UPMBooleanEditField(StringIdentifier.IdentifierWithStringId($"{identifier.IdentifierAsString}-canByDelete"));
            objective.CanBeDeletedField.BoolValue = item.CanBeDeleted;
            return(objective);
        }
Beispiel #7
0
        /// <summary>
        /// Creates the edit field.
        /// </summary>
        /// <returns>
        /// The <see cref="UPMEditField"/>.
        /// </returns>
        public override UPMEditField CreateEditField()
        {
            var field = new UPMCatalogEditField(this.FieldIdentifier);

            foreach (var option in this.options)
            {
                var possibleValue = new UPMCatalogPossibleValue
                {
                    Key             = option.Key,
                    TitleLabelField = new UPMStringField(StringIdentifier.IdentifierWithStringId("x"))
                    {
                        StringValue = option.Value
                    }
                };

                field.AddPossibleValue(possibleValue);
            }

            field.NullValueKey = string.Empty;
            this.ApplyAttributesOnEditFieldConfig(field, this.FieldConfig);

            return(field);
        }
        private static List <UPMField> CreateFieldArray(AnalysisRow row, IReadOnlyList <object> xColumnArray, bool keyAsRawString, int columnCount, int i)
        {
            var fieldArray = new List <UPMField>();
            var field      = new UPMStringField(StringIdentifier.IdentifierWithStringId($"row {i}"))
            {
                StringValue    = row.Label,
                RawStringValue = keyAsRawString ? row.Key : row.Label
            };

            fieldArray.Add(field);

            for (var j = 0; j < columnCount; j++)
            {
                var field2     = new UPMStringField(StringIdentifier.IdentifierWithStringId($"cell{i}_{j}"));
                var resultCell = row.Values[j] as AnalysisResultCell;
                if (resultCell == null)
                {
                    throw new InvalidOperationException("value must be AnalysisResultCell");
                }

                field2.StringValue    = resultCell.ToString();
                field2.RawStringValue = resultCell.Value.ToString();
                fieldArray.Add(field2);
                var numberOfXColumn = xColumnArray[j].ToInt();
                for (var k = 0; k < numberOfXColumn; k++)
                {
                    var xField = new UPMStringField(StringIdentifier.IdentifierWithStringId($"cell{i}_{j}_{k}"))
                    {
                        StringValue    = resultCell.StringXResultAtIndex(k),
                        RawStringValue = resultCell.RawStringXResultAtIndex(k)
                    };
                    fieldArray.Add(xField);
                }
            }

            return(fieldArray);
        }
        /// <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);
        }
        private UPMStringField CreateField(
            FieldAttributes fieldAttributes,
            FieldIdentifier fieldIdentifier,
            UPConfigFieldControlField fieldConfig,
            UPCRMResultRow resultRow,
            string recordIdentification,
            IConfigurationUnitStore configStore)
        {
            UPMStringField field = null;

            if (fieldAttributes.Email)
            {
                var linkEmailAction = new UPMAction(StringIdentifier.IdentifierWithStringId("linkEmailActionId"));
                linkEmailAction.SetTargetAction(this, (sender) =>
                {
                    var url           = "mailto://" + (sender as UPMEmailField)?.StringValue;
                    var deviceService = SimpleIoc.Default.GetInstance <IDeviceService>();
                    deviceService?.OpenUri(new Uri(url));
                });
                field = new UPMEmailField(fieldIdentifier, linkEmailAction);
            }
            else if (fieldAttributes.Phone)
            {
                field = CreatePhoneField(fieldAttributes, fieldIdentifier);
            }
            else if (fieldAttributes.Httplink)
            {
                field = this.CreateStringField(fieldConfig, fieldIdentifier, resultRow, recordIdentification, configStore);
            }
            else
            {
                field = CreateStringField(fieldAttributes, fieldIdentifier);
            }

            return(field);
        }
Beispiel #11
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);
        }
        private void ProcessResultRows(
            AnalysisRow row,
            List <object> columnInfoArray,
            UPMResultSection section,
            UPMGridPage searchPage,
            AnalysisResult analysisResult,
            Page oldPage)
        {
            var dataSource         = analysisResult.DataSource;
            var contextMenuOptions = GetContextMenuOptions(dataSource);
            var i = 0;

            foreach (ICrmDataSourceRow crmRow in row.ResultRows)
            {
                var identifier = StringIdentifier.IdentifierWithStringId($"row {i}");
                var listRow    = new UPMResultRow(identifier)
                {
                    Context = row
                };
                var fieldArray = new List <UPMField>();
                foreach (AnalysisDrillThruColumn col in columnInfoArray)
                {
                    var field = new UPMStringField(StringIdentifier.IdentifierWithStringId($"row {++i}"))
                    {
                        StringValue    = crmRow.ValueAtIndex(col.SourceField.QueryResultFieldIndex),
                        RawStringValue = crmRow.RawValueAtIndex(col.SourceField.QueryResultFieldIndex)
                    };
                    fieldArray.Add(field);
                }

                listRow.Fields = fieldArray;
                section.AddResultRow(listRow);
                ++i;
                this.ProcessSearchPage(searchPage, contextMenuOptions, crmRow, listRow, analysisResult, oldPage, i);
            }
        }
        private IIdentifier BuildIdentifier()
        {
            IIdentifier identifier;

            if (this.WebContentMetadata is UPWebContentMetadataClientReport)
            {
                UPWebContentMetadataClientReport clientReport = (UPWebContentMetadataClientReport)this.WebContentMetadata;
                IConfigurationUnitStore          configStore  = ConfigurationUnitStore.DefaultStore;
                List <string> usedInfoAreas = new List <string>();

                foreach (UPWebContentClientReport contentClientReport in clientReport.ClientReports)
                {
                    SearchAndList searchAndList = configStore.SearchAndListByName(contentClientReport.ConfigName);
                    FieldControl  fieldControl  = configStore.FieldControlByNameFromGroup("List", searchAndList == null ? contentClientReport.ConfigName : searchAndList.FieldGroupName);

                    foreach (UPConfigFieldControlField field in fieldControl.Fields)
                    {
                        if (!usedInfoAreas.Contains(field.InfoAreaId))
                        {
                            usedInfoAreas.Add(field.InfoAreaId);
                        }
                    }
                }

                List <IIdentifier> usedIdentifiers = new List <IIdentifier>();
                usedIdentifiers.AddRange(usedInfoAreas.Select(infoArea => StringIdentifier.IdentifierWithStringId($"{infoArea}.*")));

                identifier = usedIdentifiers.Count > 0 ? new MultipleIdentifier(usedIdentifiers) : this.BuildStandartIdentifier();
            }
            else
            {
                identifier = this.BuildStandartIdentifier();
            }

            return(identifier);
        }
Beispiel #14
0
        public Invoice(
            LocalCompany issuer,
            InvoiceHeader header,
            IEnumerable <Revenue> revenueItems,
            StringIdentifier invoiceIdentifier = null,
            InvoiceRegistrationNumber invoiceRegistrationNumber            = null,
            InvoiceRegistrationNumber cancelledByInvoiceRegistrationNumber = null,
            ForeignCompany counterpart     = null,
            IEnumerable <Payment> payments = null)
        {
            Issuer                              = issuer ?? throw new ArgumentNullException(nameof(issuer));
            Header                              = header ?? throw new ArgumentNullException(nameof(header));
            InvoiceIdentifier                   = invoiceIdentifier;
            InvoiceRegistrationNumber           = invoiceRegistrationNumber;
            CanceledByInvoiceRegistrationNumber = cancelledByInvoiceRegistrationNumber;
            Counterpart                         = counterpart;
            RevenueItems                        = revenueItems;
            Payments                            = payments;

            if (revenueItems.Count() == 0)
            {
                throw new ArgumentException($"Minimal count of {nameof(revenueItems)} is 1.");
            }
        }
        private void UpdatePageFromQueryResult(UPCRMResult result)
        {
            this.QueryResult = result;
            UPMGridPage      searchPage = (UPMGridPage)this.CreatePageInstance();
            Page             oldPage = this.Page;
            int              i, j;
            int              columnCount         = result.ColumnCount;
            StringIdentifier identifier          = StringIdentifier.IdentifierWithStringId("columnHeader");
            UPMResultSection section             = new UPMResultSection(identifier);
            UPMResultRow     columnHeaderListRow = new UPMResultRow(identifier);
            var              fieldArray          = new List <UPMField>();

            searchPage.FixedFirstColumn = false;
            searchPage.ShowMenu         = true;
            searchPage.SumRowAtEnd      = false;
            for (i = 0; i < columnCount; i++)
            {
                UPContainerFieldMetaInfo fieldMetaInfo = result.ColumnFieldMetaInfoAtIndex(i);
                string fieldType = fieldMetaInfo.CrmFieldInfo.FieldType;
                if (fieldType == "F" || fieldType == "L" || fieldType == "S")
                {
                    searchPage.SetColumnInfoAtIndexDataTypeSpecialSort(i, UPMColumnDataType.Numeric, false);
                }
                else if (fieldType == "D")
                {
                    searchPage.SetColumnInfoAtIndexDataTypeSpecialSort(i, UPMColumnDataType.Date, true);
                }

                UPMGridColumnHeaderStringField field = new UPMGridColumnHeaderStringField(StringIdentifier.IdentifierWithStringId($"col {i}"))
                {
                    StringValue = result.ColumnNameAtIndex(i)
                };
                fieldArray.Add(field);
            }

            columnHeaderListRow.Fields = fieldArray;
            section.AddResultRow(columnHeaderListRow);
            searchPage.AddResultSection(section);
            int           numberOfResultTables = result.NumberOfResultTables;
            List <object> contextMenuOptions   = new List <object>(numberOfResultTables);
            var           configStore          = ConfigurationUnitStore.DefaultStore;

            for (j = 0; j < numberOfResultTables; j++)
            {
                string infoAreaId    = result.ResultTableAtIndex(j).InfoAreaId;
                string infoAreaLabel = string.Empty;
                if (infoAreaId?.Length > 0)
                {
                    InfoArea       configInfoArea = configStore.InfoAreaConfigById(infoAreaId);
                    UPConfigExpand expand         = configStore.ExpandByName(infoAreaId);
                    FieldControl   fieldControl   = configStore.FieldControlByNameFromGroup("Details", expand.FieldGroupName);
                    if (configInfoArea != null && expand != null && fieldControl != null)
                    {
                        infoAreaLabel = LocalizedString.TextAnalysesShowParam.Replace("%@", configInfoArea.SingularName);
                    }
                }

                contextMenuOptions.Add(infoAreaLabel);
            }

            for (i = 0; i < result.RowCount; i++)
            {
                identifier = StringIdentifier.IdentifierWithStringId($"row {i}");
                var listRow = new UPMResultRow(identifier);
                var crmRow  = result.ResultRowAtIndex(i) as UPCRMResultRow;
                fieldArray = new List <UPMField>();
                var v = crmRow.Values();
                for (j = 0; j < v.Count; j++)
                {
                    UPMStringField field2 = new UPMStringField(StringIdentifier.IdentifierWithStringId($"cell{i}_{j}"))
                    {
                        StringValue    = v[j],
                        RawStringValue = crmRow.RawValueAtIndex(j)
                    };
                    fieldArray.Add(field2);
                }

                listRow.Fields = fieldArray;
                section.AddResultRow(listRow);
                for (j = 0; j < numberOfResultTables; j++)
                {
                    var label = contextMenuOptions[j] as string;
                    if (label.Length == 0)
                    {
                        continue;
                    }

                    string recordIdentification = crmRow.RecordIdentificationAtIndex(j);
                    if (recordIdentification?.Length > 0)
                    {
                        UPMOrganizerAnalysisShowRecordAction showRecordAction = new UPMOrganizerAnalysisShowRecordAction(StringIdentifier.IdentifierWithStringId($"action.row {i} record {j}"))
                        {
                            RecordIdentification = recordIdentification
                        };
                        showRecordAction.SetTargetAction(this, this.PerformShowRecordAction);
                        showRecordAction.LabelText = label;
                        listRow.AddDetailAction(showRecordAction);
                    }
                }
            }

            this.TopLevelElement = searchPage;
            this.InformAboutDidChangeTopLevelElement(oldPage, searchPage, null, null);
        }
Beispiel #16
0
        public override bool Equals(object o)
        {
            StringIdentifier other = o as StringIdentifier;

            return(other != null && _str.Equals(other._str));
        }
        private UPMGroup CreateGroup(string _recordIdentification)
        {
            UPMCharacteristicsGroup charakteristicsGroup = new UPMCharacteristicsGroup(StringIdentifier.IdentifierWithStringId(this.Characteristics.RecordIdentification));

            charakteristicsGroup.LabelText = this.TabLabel;
            int groupId = 0;
            int itemId  = 0;

            if (this.Characteristics.Groups != null)
            {
                foreach (UPCharacteristicsGroup crmCharacteristicsGroup in this.Characteristics.Groups)
                {
                    FieldIdentifier             fieldIdentifier          = FieldIdentifier.IdentifierWithRecordIdentificationFieldId(_recordIdentification, this.Characteristics.DestinationGroupField.Identification);
                    UPMCharacteristicsItemGroup characteristicsItemGroup = new UPMCharacteristicsItemGroup(StringIdentifier.IdentifierWithStringId($"Group{groupId}_{itemId}"));
                    characteristicsItemGroup.GroupNameField = new UPMStringField(fieldIdentifier);
                    SetAttributesOnField(this.Characteristics.DestinationGroupField.Attributes, characteristicsItemGroup.GroupNameField);
                    characteristicsItemGroup.GroupNameField.StringValue = crmCharacteristicsGroup.Label;
                    charakteristicsGroup.AddChild(characteristicsItemGroup);
                    foreach (UPCharacteristicsItem crmCharacteristicsItem in crmCharacteristicsGroup.Items)
                    {
                        fieldIdentifier = FieldIdentifier.IdentifierWithRecordIdentificationFieldId(_recordIdentification, this.Characteristics.DestinationItemField.Identification);
                        UPMCharacteristicsItem characteristicsItem = new UPMCharacteristicsItem(StringIdentifier.IdentifierWithStringId($"Item{groupId}_{itemId}"));
                        characteristicsItem.ItemNameField = new UPMStringField(fieldIdentifier);
                        SetAttributesOnField(this.Characteristics.DestinationItemField.Attributes, characteristicsItem.ItemNameField);
                        characteristicsItem.ItemNameField.StringValue = crmCharacteristicsItem.Label;
                        characteristicsItemGroup.AddChild(characteristicsItem);
                        List <UPMField> additionalFields = new List <UPMField>();
                        if (crmCharacteristicsItem.ShowAdditionalFields)
                        {
                            int i = 0;
                            foreach (UPConfigFieldControlField crmAdditionalField in crmCharacteristicsItem.AdditionalFields)
                            {
                                fieldIdentifier = FieldIdentifier.IdentifierWithRecordIdentificationFieldId(_recordIdentification, crmAdditionalField.Identification);
                                UPMStringField additionalField = new UPMStringField(fieldIdentifier);
                                if (!string.IsNullOrEmpty(crmCharacteristicsItem.Values[i]))
                                {
                                    SetAttributesOnField(crmAdditionalField.Attributes, additionalField);
                                    FieldAttributes fieldAttributes = crmAdditionalField.Attributes;
                                    if (!fieldAttributes.NoLabel)
                                    {
                                        additionalField.LabelText = crmAdditionalField.Field.Label;
                                    }

                                    additionalField.StringValue = crmCharacteristicsItem.Values[i];
                                    if (!string.IsNullOrEmpty(additionalField.StringValue))
                                    {
                                        additionalFields.Add(additionalField);
                                    }
                                }

                                i++;
                            }
                        }

                        characteristicsItem.EditFields = additionalFields;
                        itemId++;
                    }

                    groupId++;
                }
            }

            return(charakteristicsGroup);
        }
Beispiel #18
0
        private bool FillPageWithDocumentsResult(UPMDocumentPage page, UPCRMResult result)
        {
            int count = result?.RowCount ?? 0;

            if (count == 0)
            {
                return(false);
            }

            UPMDocumentSection lastSection = null;
            int groupingIndex = -1;

            for (int i = 0; i < result.ColumnCount; i++)
            {
                if (result.ColumnFieldMetaInfoAtIndex(i).FunctionName == "groupingKey")
                {
                    groupingIndex = i;
                    break;
                }
            }

            page.AvailableGrouping = groupingIndex != -1;
            DocumentInfoAreaManager documentInfoAreaManager         = new DocumentInfoAreaManager(this.preparedSearch.CombinedControl.InfoAreaId, this.preparedSearch.CombinedControl, null);
            Dictionary <string, UPMDocumentSection> groupDictionary = new Dictionary <string, UPMDocumentSection>();

            for (int i = 0; i < count; i++)
            {
                UPCRMResultRow resultRow    = (UPCRMResultRow)result.ResultRowAtIndex(i);
                DocumentData   documentData = documentInfoAreaManager.DocumentDataForResultRow(resultRow);
                string         groupValue   = string.Empty;
                if (groupingIndex != -1)
                {
                    groupValue = resultRow.ValueAtIndex(groupingIndex);
                }

                UPMDocumentSection section;
                bool isLastSection;
                if (string.IsNullOrEmpty(groupValue))
                {
                    groupValue    = "#";
                    isLastSection = true;
                    section       = lastSection;
                }
                else
                {
                    isLastSection = false;
                    section       = groupDictionary.ValueOrDefault(groupValue);
                }

                if (section == null)
                {
                    section = new UPMDocumentSection(StringIdentifier.IdentifierWithStringId(groupValue))
                    {
                        GroupName = new UPMStringField(StringIdentifier.IdentifierWithStringId(groupValue))
                        {
                            StringValue = groupValue
                        }
                    };
                    if (isLastSection)
                    {
                        lastSection = section; // Dont add to page here # should always be the last
                    }
                    else
                    {
                        groupDictionary.SetObjectForKey(section, groupValue);
                        page.AddChild(section);
                    }
                }

                UPMDocument document = new UPMDocument(documentData);
                section.AddChild(document);
            }

            if (lastSection != null)
            {
                page.AddChild(lastSection);
            }

            return(true);
        }
Beispiel #19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UPMSEPositionInfoMessage"/> class.
 /// </summary>
 /// <param name="identifier">The identifier.</param>
 public UPMSEPositionInfoMessage(IIdentifier identifier)
     : base(identifier)
 {
     this.MessageField      = new UPMStringField(StringIdentifier.IdentifierWithStringId($"{identifier} MessageField"));
     this.ErrorLevelMessage = false;
 }
Beispiel #20
0
        /// <summary>
        /// Updateds the element.
        /// </summary>
        /// <param name="element">The element.</param>
        /// <returns>
        /// The <see cref="UPMElement" />.
        /// </returns>
        public override UPMElement UpdatedElement(UPMElement element)
        {
            UPMSyncConflictsPage page = new UPMSyncConflictsPage(StringIdentifier.IdentifierWithStringId("SyncConflictsPage"));

            page.SyncConflictEmail = ConfigurationUnitStore.DefaultStore.ConfigValue("Sync.ConflictEmailAddress");
            IOfflineStorage offlineStorage  = UPOfflineStorage.DefaultStorage;
            var             offlineRequests = this.ShowAllOfflineRequests ? offlineStorage.OfflineRequests : offlineStorage.ConflictRequests;

            if (offlineRequests == null || offlineRequests.Count == 0)
            {
                this.AddNoConflictsFoundPage(page);
                return(page);
            }

            foreach (UPOfflineRequest request in offlineRequests)
            {
                IIdentifier identifier;
                if (!string.IsNullOrEmpty(request.IdentifyingRecordIdentification))
                {
                    identifier = new RecordIdentifier(request.IdentifyingRecordIdentification);
                }
                else
                {
                    identifier = StringIdentifier.IdentifierWithStringId($"request_{request.RequestNr}");
                }

                UPMSyncConflictWithContext syncConflict = new UPMSyncConflictWithContext(identifier);
                request.LoadFromOfflineStorage();
                syncConflict.OfflineRequest = request;
                syncConflict.CanBeFixed     = request.FixableByUser;
                syncConflict.CanBeReported  = !string.IsNullOrEmpty(page.SyncConflictEmail) && syncConflict.OfflineRequest.HasXml;
                if (!string.IsNullOrEmpty(request.ImageName))
                {
                    //SyncConflict.Icon = UIImage.ImageNamed(request.ImageName);    // CRM-5007
                }

                UPMStringField titleLineField = new UPMStringField(null);
                titleLineField.StringValue = request.TitleLine;
                syncConflict.MainField     = titleLineField;
                string detailsLine = request.DetailsLine;
                if (!string.IsNullOrEmpty(detailsLine))
                {
                    UPMStringField detailsLineField = new UPMStringField(null);
                    detailsLineField.StringValue = detailsLine;
                    syncConflict.DetailField     = detailsLineField;
                }

                if (!this.ShowAllOfflineRequests)
                {
                    UPMErrorStatus error = UPMErrorStatus.ErrorStatusWithMessageDetails(request.Error, request.Response);
                    syncConflict.AddStatus(error);
                }

                List <UPOfflineRequest> dependingRequests = request.DependentRequests;
                if (dependingRequests != null)
                {
                    foreach (UPOfflineRequest dependentRequest in dependingRequests)
                    {
                        string        description = $"{dependentRequest.TitleLine}-{dependentRequest.DetailsLine}";
                        UPMWarnStatus warning     = UPMWarnStatus.WarnStatusWithMessageDetails(description, null);
                        syncConflict.AddStatus(warning);
                    }
                }

                page.AddSyncConflict(syncConflict);
            }

            if (this.oldNumberOfConflicts >= 0 && this.oldNumberOfConflicts != offlineRequests.Count)
            {
                Messenger.Default.Send(SyncManagerMessage.Create(SyncManagerMessageKey.NumberOfConflictsChanged));
            }

            this.oldNumberOfConflicts = offlineRequests.Count;
            return(page);
        }
 /// <summary>
 /// Watermarks the status.
 /// </summary>
 /// <returns>
 /// The <see cref="UPMWatermarkStatus"/>.
 /// </returns>
 public static UPMWatermarkStatus WatermarkStatus()
 {
     return(new UPMWatermarkStatus(StringIdentifier.IdentifierWithStringId("watermark")));
 }
        /// <summary>
        /// Builds the additional actions for record identification.
        /// </summary>
        /// <param name="recordIdentification">The record identification.</param>
        /// <returns></returns>
        public List <object> BuildAdditionalActionsForRecordIdentification(string recordIdentification)
        {
            var configStore  = ConfigurationUnitStore.DefaultStore;
            var buttonsArray = new List <object>();
            var buttonName   = this.FieldControlConfig.ValueForAttribute($"action{this.TabIndex + 1}");
            var buttons      = new List <string>();

            if (!string.IsNullOrEmpty(buttonName))
            {
                buttons.AddRange(buttonName.Split(';'));
            }

            buttonName = this.TabConfig.ValueForAttribute("action");
            if (!string.IsNullOrEmpty(buttonName))
            {
                buttons.AddRange(buttonName.Split(';'));
            }

            foreach (var bName in buttons)
            {
                var buttonDef = configStore.ButtonByName(bName);
                if (buttonDef == null || buttonDef.IsHidden)
                {
                    continue;
                }

                var iconName = string.Empty;
                if (!string.IsNullOrEmpty(buttonDef.ImageName))
                {
                    iconName = configStore.FileNameForResourceName(buttonDef.ImageName);
                }

                UPMOrganizerAction action = null;

                if (buttonDef.ViewReference != null)
                {
                    action = new UPMOrganizerAction(StringIdentifier.IdentifierWithStringId($"action.{bName}"));
                    action.SetTargetAction(this, action.PerformAction);
                    action.ViewReference = buttonDef.ViewReference.ViewReferenceWith(recordIdentification);
                    if (!string.IsNullOrEmpty(iconName))
                    {
                        action.IconName = iconName;
                    }

                    if (action.Identifier.Equals(StringIdentifier.IdentifierWithStringId(Core.Constants.ActionIdToggleFavorite)))
                    {
                        action.IconName       = "Icon:StarEmpty";
                        action.ActiveIconName = "Icon:Star";
                        action.LabelText      = LocalizedString.TextProcessAddToFavorites;
                    }
                    else
                    {
                        action.LabelText = buttonDef.Label;
                    }
                }

                if (action != null)
                {
                    action.Invalid = true;
                    buttonsArray.Add(action);
                }
            }

            return(buttonsArray);
        }
Beispiel #23
0
 public InvoiceParty(StringIdentifier taxNumber, CountryCode countryCode, NonNegativeInt branch = null, StringIdentifier name = null, Address address = null)
 {
     TaxNumber   = taxNumber ?? throw new ArgumentNullException(nameof(taxNumber));
     CountryCode = countryCode ?? throw new ArgumentNullException(nameof(countryCode));
     Branch      = branch ?? new NonNegativeInt(0);
     Name        = name;
     Address     = address;
 }
 public PersonID(StringIdentifier id) : base(id.ID)
 { /* No additional construction required. */
 }
Beispiel #25
0
        /// <summary>
        /// Builds the detail organizer pages.
        /// </summary>
        protected virtual void BuildDetailOrganizerPages()
        {
            string recordId = this.ViewReference.ContextValueForKey("RecordId");

            recordId        = UPCRMDataStore.DefaultStore.ReplaceRecordIdentification(recordId);
            this.InfoAreaId = this.ViewReference.ContextValueForKey("InfoAreaId");

            UPMOrganizer detailOrganizer;

            if (recordId.IsRecordIdentification() && this.RefreshOrganizer)
            {
                detailOrganizer = new UPMOrganizer(new RecordIdentifier(recordId));
            }
            else
            {
                detailOrganizer = new UPMOrganizer(StringIdentifier.IdentifierWithStringId("Details"));
            }

            this.TopLevelElement = detailOrganizer;
            detailOrganizer.DisplaysTitleText = true;
            detailOrganizer.ExpandFound       = false;
            string linkIdString = this.ViewReference.ContextValueForKey("LinkId");

            if (!string.IsNullOrEmpty(this.InfoAreaId))
            {
                var parts = this.InfoAreaId.Split(':');
                if (parts.Length > 1)
                {
                    this.InfoAreaId = parts[0];
                    linkIdString    = parts[1];
                }
            }

            if (recordId.IsRecordIdentification())
            {
                this.RecordIdentification = recordId;
                if (string.IsNullOrEmpty(this.InfoAreaId))
                {
                    this.InfoAreaId = recordId.InfoAreaId();
                }
            }
            else
            {
                this.RecordIdentification = this.InfoAreaId.InfoAreaIdRecordId(recordId);
            }

            string linkRecordId = this.ViewReference.ContextValueForKey("LinkRecordId");

            if (!string.IsNullOrEmpty(linkRecordId))
            {
                string parentLinkString = this.InfoAreaId;
                if (!string.IsNullOrEmpty(linkIdString))
                {
                    parentLinkString = $"{parentLinkString}:{linkIdString}";
                }

                this.LinkReader = new UPCRMLinkReader(linkRecordId, parentLinkString, UPRequestOption.FastestAvailable, this);
                this.LinkReader.Start();
            }
            else
            {
                this.ContinueBuildDetailOrganizerPages0();
            }
        }
Beispiel #26
0
        /// <summary>
        /// Method Loads tiles and subviews into Details Organizer Page
        /// </summary>
        private void ContinueBuildDetailsOrganizerPageTilesLoaded()
        {
            var configStore     = ConfigurationUnitStore.DefaultStore;
            var detailOrganizer = (UPMOrganizer)TopLevelElement;
            var recordTiles     = GetUPMTiles();

            detailOrganizer.Tiles       = recordTiles;
            Organizer.OrganizerColor    = ColorForInfoAreaWithId(InfoAreaId);
            Organizer.DisplaysTitleText = true;
            Organizer.ExpandFound       = true;
            RefreshTableCaption();

            if (string.IsNullOrWhiteSpace(VirtualInfoAreaId) || string.IsNullOrWhiteSpace(ExpandConfig.UnitName))
            {
                return;
            }

            var additionalParameters = new Dictionary <string, object>
            {
                { nameof(VirtualInfoAreaId), VirtualInfoAreaId },
                { "CurrentExpandName", ExpandConfig.UnitName }
            };

            var detailPageModelController = new DetailPageModelController(ViewReference.ViewReferenceWith(additionalParameters));

            detailPageModelController.Init();
            var overviewPage = detailPageModelController.Page;

            overviewPage.Parent = detailOrganizer;
            AddPageModelController(detailPageModelController);
            detailOrganizer.AddPage(overviewPage);
            var expandHeader = configStore.HeaderByNameFromGroup(HeaderNameExpand, ExpandConfig.HeaderGroupName);

            if (expandHeader != null)
            {
                UPMOrganizerAddPages(expandHeader, detailOrganizer, overviewPage);
                AddActionButtonsFromHeaderRecordIdentification(expandHeader, RecordIdentification);
                var offline = UPCRMDataStore.DefaultStore.RecordExistsOffline(RecordIdentification);
                if (!offline)
                {
                    OnlineData       = true;
                    SyncRecordAction = new UPMOrganizerAction(StringIdentifier.IdentifierWithStringId(ActionSyncRecord));
                    SyncRecordAction.SetTargetAction(this, PerformAction);
                    var parameter = new List <string> {
                        "RecordId", "Value", "uid"
                    };
                    var parameters = new List <object> {
                        parameter
                    };
                    var definition = new List <object> {
                        string.Empty, "Action:syncRecord", parameters
                    };
                    var syncRecordViewReference = new ViewReference(definition, ButtonSyncRecordText);
                    SyncRecordAction.ViewReference = syncRecordViewReference.ViewReferenceWith(RecordIdentification);
                }
                else
                {
                    OnlineData       = false;
                    SyncRecordAction = null;
                }
            }

            Organizer.DisplaysImage = IsOrganizerHeaderImageConfigured();
            Organizer.LineCountAdditionalTitletext = LinecountOrganizerHeaderSubLabelConfigured();
            UpdateActionItemsStatus();
            InformAboutDidChangeTopLevelElement(Organizer, Organizer, null, UPChangeHints.ChangeHintsWithHint(HintAlternateExpandFound));
        }
Beispiel #27
0
        /// <summary>
        /// Search operation did finish with result
        /// </summary>
        /// <param name="operation">Operation</param>
        /// <param name="result">Result</param>
        public override void SearchOperationDidFinishWithResult(Operation operation, UPCRMResult result)
        {
            UPCRMResultRow resultRow = (UPCRMResultRow)result.ResultRowAtIndex(0);

            this.resCount--;
            if (resultRow != null)
            {
                string           recordIdent      = resultRow.RootRecordIdentification;
                RecordIdentifier recordIdentifier = new RecordIdentifier(recordIdent.InfoAreaId(), recordIdent.RecordId());
                UPMResultRow     row = new UPMResultRow(new RecordIdentifier(recordIdent));
                SearchAndList    searchConfiguration = this.configStore.SearchAndListByName(recordIdent.InfoAreaId());
                FieldControl     listFieldControl    = this.configStore.FieldControlByNameFromGroup("List", searchConfiguration.FieldGroupName);
                InfoArea         configInfoArea      = this.configStore.InfoAreaConfigById(recordIdent.InfoAreaId());
                row.RowColor = AureaColor.ColorWithString(configInfoArea.ColorKey);
                UPCRMListFormatter listFormatter = new UPCRMListFormatter(listFieldControl);
                int             fieldCount       = listFormatter.PositionCount;
                List <UPMField> listFields       = new List <UPMField>(fieldCount);
                for (int i = 0; i < fieldCount; i++)
                {
                    UPConfigFieldControlField configField = listFormatter.FirstFieldForPosition(i);
                    if (configField == null)
                    {
                        continue;
                    }

                    FieldAttributes attributes = configField.Attributes;
                    if (attributes.Hide)
                    {
                        continue;
                    }

                    UPMStringField stringField = new UPMStringField(StringIdentifier.IdentifierWithStringId($"{recordIdent}-{i}"));
                    string         stringValue = listFormatter.StringFromRowForPosition(resultRow, i);
                    if (attributes.Image)
                    {
                        DocumentManager documentManager = new DocumentManager();
                        string          documentKey     = stringValue;
                        DocumentData    documentData    = documentManager.DocumentForKey(documentKey);
                        if (documentData != null)
                        {
                            row.RecordImageDocument = new UPMDocument(documentData);
                        }
                        else
                        {
                            //row.RecordImageDocument = new UPMDocument(recordIdentifier, ServerSession.DocumentRequestUrlForDocumentKey(documentKey));
                        }

                        continue;
                    }

                    if (!string.IsNullOrEmpty(stringValue))
                    {
                        if (attributes.NoLabel && !string.IsNullOrEmpty(configField.Label))
                        {
                            stringValue = $"{configField.Label} {stringValue}";
                        }

                        stringField.StringValue = stringValue;
                        stringField.SetAttributes(attributes);
                    }

                    listFields.Add(stringField);
                }

                row.OnlineData = resultRow.IsServerResponse;
                if (row.OnlineData)
                {
                    //row.StatusIndicatorIcon = UIImage.UpXXImageNamed("crmpad-List-Cloud");    // CRM-5007
                }

                foreach (HistoryEntry entry in this.historyManager.HistoryEntries)
                {
                    if (entry.RecordIdentification == recordIdent)
                    {
                        this.rows.Add(row);
                        if (this.pendingRecords.Contains(recordIdent))
                        {
                            this.pendingRecords.Remove(recordIdent);
                        }

                        break;
                    }
                }

                row.Fields = listFields;
            }

            if (this.resCount == 0)
            {
                this.DisplayPage(this.rows);
            }
        }
        /// <summary>
        /// Adds the page model controllers.
        /// </summary>
        public override void AddPageModelControllers()
        {
            this.RecordIdentification = this.ViewReference.ContextValueForKey("RecordId");
            this.RecordIdentification = UPCRMDataStore.DefaultStore.ReplaceRecordIdentification(this.RecordIdentification);
            ViewReference viewReference = this.ViewReference;

            if (this.OfflineRequest != null)
            {
                if (this.RecordIdentification.Contains("new"))
                {
                    UPCRMRecord rootRecord = ((UPOfflineRecordRequest)this.OfflineRequest).FirstRecordWithInfoAreaId(this.RecordIdentification.InfoAreaId());
                    if (rootRecord != null)
                    {
                        viewReference             = new ViewReference(this.ViewReference, this.RecordIdentification, rootRecord.RecordIdentification, null);
                        this.RecordIdentification = rootRecord.RecordIdentification;
                    }
                }
            }

            UPMOrganizer editOrganizer = new UPMOrganizer(StringIdentifier.IdentifierWithStringId("Edit"));

            this.TopLevelElement = editOrganizer;
            SerialEntryPageModelController tmpSerialEntryPageModelController = new SerialEntryPageModelController(viewReference, (UPOfflineSerialEntryRequest)this.OfflineRequest);

            //tmpSerialEntryPageModelController.AddObserverForKeyPathOptionsContext(this, "hasRunningChangeRequests", NSKeyValueObservingOptionNew, null);
            tmpSerialEntryPageModelController.Delegate = this;
            Page   overviewPage = tmpSerialEntryPageModelController.Page;
            string organizerHeaderText;
            string organizerDetailText = null;

            if (this.ExpandConfig != null)
            {
                UPConfigHeader header = ConfigurationUnitStore.DefaultStore.HeaderByNameFromGroup("Edit", this.ExpandConfig.HeaderGroupName);
                if (header != null)
                {
                    organizerDetailText = header.Label;
                    tmpSerialEntryPageModelController.Page.LabelText = organizerDetailText;
                }
            }

            if (string.IsNullOrEmpty(organizerDetailText))
            {
                if (!string.IsNullOrEmpty(this.InfoAreaId))
                {
                    organizerDetailText = UPCRMDataStore.DefaultStore.TableInfoForInfoArea(this.InfoAreaId).Label;
                }
                else
                {
                    organizerDetailText = UPCRMDataStore.DefaultStore.TableInfoForInfoArea(this.RecordIdentification.InfoAreaId()).Label;
                }
            }

            IConfigurationUnitStore configStore = ConfigurationUnitStore.DefaultStore;
            string rootRecordIdentification     = this.RecordIdentification;

            if (string.IsNullOrEmpty(rootRecordIdentification))
            {
                rootRecordIdentification = this.LinkRecordIdentification;
            }

            UPConfigTableCaption tableCaption = configStore.TableCaptionByName(rootRecordIdentification.InfoAreaId());
            string recordTableCaption         = null;

            if (tableCaption != null)
            {
                recordTableCaption = tableCaption.TableCaptionForRecordIdentification(rootRecordIdentification);
            }

            if (string.IsNullOrEmpty(recordTableCaption))
            {
                if (!string.IsNullOrEmpty(organizerDetailText))
                {
                    organizerHeaderText = organizerDetailText;
                    organizerDetailText = null;
                }
                else
                {
                    organizerHeaderText = rootRecordIdentification;
                }
            }
            else
            {
                organizerHeaderText = recordTableCaption;
            }

            this.Organizer.TitleText    = organizerHeaderText;
            this.Organizer.SubtitleText = organizerDetailText;
            this.AddPageModelController(tmpSerialEntryPageModelController);
            this.Organizer.AddPage(overviewPage);
            this.AddRemainingPageModelController();
            this.AddOrganizerActions();
            editOrganizer.ExpandFound = true;
        }
Beispiel #29
0
 public Address(NotEmptyString postalCode, NotEmptyString city, StringIdentifier street = null, StringIdentifier number = null)
 {
     PostalCode = postalCode ?? throw new ArgumentNullException(nameof(postalCode));
     City       = city ?? throw new ArgumentNullException(nameof(city));
     Street     = street;
     Number     = number;
 }
        private UPMGroup BuildGroup(UPMGroup group)
        {
            Dictionary <string, string> infoAreaImageFileNames = new Dictionary <string, string>();
            IConfigurationUnitStore     configStore            = ConfigurationUnitStore.DefaultStore;
            UPConfigExpand repExpand = configStore.ExpandByName("ID");

            this.linkParticipantsViewReference = null;

            if (!string.IsNullOrEmpty(this.linkParticipantsName))
            {
                SearchAndList searchAndList = configStore.SearchAndListByName(this.linkParticipantsName);
                Menu          menu          = searchAndList != null?configStore.MenuByName(searchAndList.DefaultAction) : null;

                this.linkParticipantsViewReference = menu?.ViewReference;
            }

            if (this.acceptanceCatalogAttributes == null && this.recordParticipants.AcceptanceField != null)
            {
                this.acceptanceCatalogAttributes = configStore.CatalogAttributesForInfoAreaIdFieldId(this.recordParticipants.AcceptanceField.InfoAreaId, this.recordParticipants.AcceptanceField.FieldId);
            }

            foreach (UPCRMParticipant participant in this.recordParticipants.Participants)
            {
                bool           isRepParticipant = participant is UPCRMRepParticipant;
                IIdentifier    identifier       = StringIdentifier.IdentifierWithStringId(participant.Key);
                UPMListRow     listRow          = new UPMListRow(identifier);
                UPMStringField nameField        = new UPMStringField(StringIdentifier.IdentifierWithStringId("name"));
                nameField.StringValue = participant.Name;
                listRow.AddField(nameField);
                UPMStringField acceptanceField = new UPMStringField(StringIdentifier.IdentifierWithStringId("acceptance"));
                if (!isRepParticipant || this.recordParticipants.HasRepAcceptance)
                {
                    acceptanceField.StringValue = participant.AcceptanceDisplayText;
                    UPConfigCatalogValueAttributes configCatalogValueAttributes = this.acceptanceCatalogAttributes?.ValuesByCode[Convert.ToInt32(participant.AcceptanceText)];
                    string colorString = configCatalogValueAttributes?.ColorKey;
                    if (!string.IsNullOrEmpty(colorString))
                    {
                        listRow.RowColor = AureaColor.ColorWithString(colorString);
                    }
                }
                else
                {
                    acceptanceField.StringValue = string.Empty;
                }

                listRow.AddField(acceptanceField);
                UPMStringField requirementField = new UPMStringField(StringIdentifier.IdentifierWithStringId("requirement"));
                requirementField.StringValue = participant.RequirementDisplayText;
                listRow.AddField(requirementField);
                if (isRepParticipant)
                {
                    // listRow.Icon = UIImage.UpImageWithFileName(repExpand.ImageName);     // CRM-5007
                    listRow.RowAction = null;
                }
                else
                {
                    UPCRMLinkParticipant linkParticipant = (UPCRMLinkParticipant)participant;
                    string _infoAreaId = linkParticipant.LinkRecordIdentification.InfoAreaId();
                    string imageName   = infoAreaImageFileNames.ValueOrDefault(_infoAreaId);
                    if (imageName == null)
                    {
                        UPConfigExpand expand = configStore.ExpandByName(_infoAreaId);
                        imageName = expand.ImageName ?? string.Empty;

                        infoAreaImageFileNames.SetObjectForKey(imageName, _infoAreaId);
                    }

                    // listRow.Icon = UIImage.UpImageWithFileName(imageName);       // CRM-5007
                    listRow.OnlineData = !UPCRMDataStore.DefaultStore.RecordExistsOffline(linkParticipant.LinkRecordIdentification);

                    if (this.linkParticipantsViewReference != null)
                    {
                        UPMAction switchToOrganizerAction = new UPMAction(null);
                        switchToOrganizerAction.IconName = "arrow.png";
                        switchToOrganizerAction.SetTargetAction(this, this.SwitchToOrganizerForLinkParticipant);
                        listRow.RowAction = switchToOrganizerAction;
                    }
                }

                group.AddChild(listRow);
            }

            return(group);
        }