Beispiel #1
0
        /// <summary>
        /// Builds the pages from view reference.
        /// </summary>
        public override void BuildPagesFromViewReference()
        {
            UPMOrganizer detailOrganizer = new UPMOrganizer(StringIdentifier.IdentifierWithStringId("History"));

            this.TopLevelElement        = detailOrganizer;
            detailOrganizer.ExpandFound = true;
            string organizerColorKey = this.ViewReference.ContextValueForKey("OrganizerColor");

            if (!string.IsNullOrEmpty(organizerColorKey))
            {
                this.Organizer.OrganizerColor = AureaColor.ColorWithString(organizerColorKey);
            }

            string headerName              = this.ViewReference.ContextValueForKey("HeaderName");
            IConfigurationUnitStore store  = ConfigurationUnitStore.DefaultStore;
            UPConfigHeader          header = store.HeaderByName(headerName);

            if (!string.IsNullOrEmpty(header.Label))
            {
                detailOrganizer.TitleText = header.Label;
            }

            this.ShouldShowTabsForSingleTab = false;
            UPHistorySearchPageModelController docPageModelController = new UPHistorySearchPageModelController(this.ViewReference);

            this.AddPageModelController(docPageModelController);
        }
Beispiel #2
0
        /// <summary>
        /// Builds the pages from view reference.
        /// </summary>
        public override void BuildPagesFromViewReference()
        {
            SyncConflictsPageModelController pageModelController = new SyncConflictsPageModelController();
            UPMOrganizer syncConflictOrganizer = new UPMOrganizer(StringIdentifier.IdentifierWithStringId("SyncConflictsOrganizer"))
            {
                ExpandFound  = true,
                SubtitleText = LocalizedString.TextSyncConflictsTitle
            };

            this.ShouldShowTabsForSingleTab = false;
            UPMOrganizerAction retryAction       = new UPMOrganizerAction(StringIdentifier.IdentifierWithStringId("action.retry"));
            UPMOrganizerAction reportErrorAction = new UPMOrganizerAction(StringIdentifier.IdentifierWithStringId("action.report"));
            string             retryText         = LocalizedString.Localize(LocalizationKeys.TextGroupBasic, LocalizationKeys.KeyBasicSyncConflictsRetryAll, "Retry All");

            retryAction.LabelText = retryText;
            retryAction.IconName  = "Icon:Record";
            retryAction.SetTargetAction(this, this.RetryAll);
            this.AddOrganizerHeaderActionItem(retryAction);
            IOfflineStorage offlineStorage = UPOfflineStorage.DefaultStorage;

            if (!string.IsNullOrEmpty(ConfigurationUnitStore.DefaultStore.ConfigValue("Sync.ConflictEmailAddress")) &&
                offlineStorage.ConflictRequests?.Count > 1 &&
                !string.IsNullOrEmpty(offlineStorage.OfflineRequestXml()))
            {
                string sendRequestXmlText = LocalizedString.Localize(LocalizationKeys.TextGroupBasic, LocalizationKeys.KeyBasicSyncConflictsReportAllErrors, "Report all errors");
                reportErrorAction.LabelText = sendRequestXmlText;
                reportErrorAction.SetTargetAction(this, this.ReportAllErrors);
                this.AddOrganizerHeaderActionItem(reportErrorAction);
            }

            this.AddPageModelController(pageModelController);
            syncConflictOrganizer.AddPage(pageModelController.Page);
            this.TopLevelElement = syncConflictOrganizer;
        }
        /// <summary>
        /// Builds the pages from view reference.
        /// </summary>
        public override void BuildPagesFromViewReference()
        {
            SyncConflictsPageModelController pageModelController = new SyncConflictsPageModelController();
            UPMOrganizer syncConflictOrganizer = new UPMOrganizer(StringIdentifier.IdentifierWithStringId("SyncConflictOrganizer"))
            {
                ExpandFound                  = true,
                DisplaysTitleText            = true,
                LineCountAdditionalTitletext = 1,
                SubtitleText                 = LocalizedString.TextSyncConflictsTitle,
                TitleText           = this.SyncConflict.MainField.StringValue,
                AdditionalTitleText = (string)this.SyncConflict.DetailField?.FieldValue
            };

            this.ShouldShowTabsForSingleTab = false;
            if (this.IsDiscardAllowed())
            {
                UPMOrganizerAction discardAction = new UPMOrganizerAction(StringIdentifier.IdentifierWithStringId("action.discard"))
                {
                    LabelText = LocalizedString.Localize(LocalizationKeys.TextGroupBasic,
                                                         LocalizationKeys.KeyBasicSyncConflictsActionDiscardChanges, "DISCARD CONFLICT"),
                    IconName = "Icon:Trash"
                };

                discardAction.SetTargetAction(this, this.DiscardError);
                this.AddOrganizerHeaderActionItem(discardAction);
            }

            this.AddPageModelController(pageModelController);
            syncConflictOrganizer.AddPage(pageModelController.Page);
            this.TopLevelElement = syncConflictOrganizer;
        }
        /// <summary>
        /// Builds Tabs for Forms
        /// </summary>
        /// <param name="dashboardOrganizer">
        /// UPMOrganizer
        /// </param>
        /// <param name="form">
        /// Form
        /// </param>
        private void BuildFormTabs(UPMOrganizer dashboardOrganizer, Form form)
        {
            var count = form.NumberOfTabs;

            for (int i = 0; i < count; i++)
            {
                var parameterDictionary = new Dictionary <string, object> {
                    { "ConfigTabNr", i.ToString() }
                };
                var pageViewReference = ViewReference.ViewReferenceWith(parameterDictionary);
                pageViewReference = pageViewReference.ViewReferenceWith(RecordIdentification);
                var pageModelController = PageForViewReference(pageViewReference);
                if (pageModelController != null)
                {
                    FormTab tab = form.TabAtIndex(i);
                    if (i == 0 && tab.AttributeForKey("Color") != null)
                    {
                        Organizer.OrganizerColor = AureaColor.ColorWithString(tab.AttributeForKey("Color"));
                    }

                    pageModelController.Page.Parent    = dashboardOrganizer;
                    pageModelController.Page.LabelText = tab.Label;
                    AddPageModelController(pageModelController);
                    dashboardOrganizer.AddPage(pageModelController.Page);
                }
            }
        }
        /// <summary>
        /// Builds SubViews for Headers
        /// </summary>
        /// <param name="dashboardOrganizer">
        /// UPMOrganizer
        /// </param>
        /// <param name="header">
        /// UPConfigHeader
        /// </param>
        private void BuildHeaderSubViews(UPMOrganizer dashboardOrganizer, UPConfigHeader header)
        {
            var count = header?.NumberOfSubViews ?? 0;

            if (count > 0)
            {
                for (int i = 0; i < count; i++)
                {
                    var subViewDef           = header?.SubViewAtIndex(i);
                    var subViewViewReference = subViewDef?.ViewReference;
                    subViewViewReference = subViewViewReference?.ViewReferenceWith(RecordIdentification);
                    if (subViewViewReference == null)
                    {
                        continue;
                    }

                    var pageModelController = PageForViewReference(subViewViewReference);
                    if (pageModelController != null)
                    {
                        pageModelController.Page.Invalid   = true;
                        pageModelController.Page.LabelText = subViewDef.Label;
                        pageModelController.Page.Parent    = dashboardOrganizer;
                        AddPageModelController(pageModelController);
                        dashboardOrganizer.AddPage(pageModelController.Page);
                    }
                }
            }
        }
Beispiel #6
0
        private void ContinueBuildPagesFromViewReference()
        {
            UPCharacteristicsEditPageModelController pageModelController = new UPCharacteristicsEditPageModelController(this.ViewReference, this.RecordIdentification, (UPOfflineCharacteristicsRequest)this.conflictEditOfflineRequest);
            UPMOrganizer organizer  = new UPMOrganizer(StringIdentifier.IdentifierWithStringId("EditCharacteristics"));
            string       infoAreaId = this.RecordIdentification.InfoAreaId();

            organizer.TitleText = LocalizedString.TextEditCharacteristics;
            UPConfigTableCaption tableCaption = ConfigurationUnitStore.DefaultStore.TableCaptionByName(this.RecordIdentification.InfoAreaId());

            organizer.TitleText = tableCaption?.TableCaptionForRecordIdentification(this.RecordIdentification);
            InfoArea infoAreaConfig = ConfigurationUnitStore.DefaultStore.InfoAreaConfigById(infoAreaId);

            organizer.SubtitleText = infoAreaConfig?.SingularName;
            if (string.IsNullOrEmpty(organizer.SubtitleText))
            {
                organizer.SubtitleText = UPCRMDataStore.DefaultStore.TableInfoForInfoArea(infoAreaId).Label;
            }

            Page page = pageModelController.Page;

            page.LabelText = "Error";
            this.AddPageModelController(pageModelController);
            organizer.AddPage(page);
            this.TopLevelElement  = organizer;
            organizer.ExpandFound = true;
            this.AddOrganizerActions();
        }
        /// <summary>
        /// Builds the detail organizer pages.
        /// </summary>
        protected override void BuildDetailOrganizerPages()
        {
            UPMOrganizer detailOrganizer = new UPMOrganizer(StringIdentifier.IdentifierWithStringId("Documemnts"));

            detailOrganizer.ExpandFound = true;
            this.TopLevelElement        = detailOrganizer;
            IConfigurationUnitStore configStore = ConfigurationUnitStore.DefaultStore;
            string organizerColorKey            = this.ViewReference.ContextValueForKey("OrganizerColor");

            if (!string.IsNullOrEmpty(organizerColorKey))
            {
                this.Organizer.OrganizerColor = AureaColor.ColorWithString(organizerColorKey);
            }

            string         headerName = this.ViewReference.ContextValueForKey("HeaderName");
            UPConfigHeader header     = null;

            if (!string.IsNullOrEmpty(headerName))
            {
                header = configStore.HeaderByName(headerName);
            }

            detailOrganizer.SubtitleText = header != null ? header.Label : LocalizedString.TextProcessDocuments;

            this.ShouldShowTabsForSingleTab = false;
            DocumentPageModelController docPageModelController = new DocumentPageModelController(this.ViewReference);

            this.AddPageModelController(docPageModelController);
        }
Beispiel #8
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;
        }
        /// <summary>
        /// Builds the detail organizer pages.
        /// </summary>
        public void BuildDetailOrganizerPages()
        {
            UPMOrganizer detailOrganizer = new UPMOrganizer(StringIdentifier.IdentifierWithStringId("Details"));

            this.TopLevelElement        = detailOrganizer;
            detailOrganizer.ExpandFound = true;
            IConfigurationUnitStore configStore = ConfigurationUnitStore.DefaultStore;
            string          configName          = this.ViewReference.ContextValueForKey("LayoutName");
            WebConfigLayout layout = configStore.WebConfigLayoutByName(configName);

            if (layout == null)
            {
                return;
            }

            string organizerColorKey = this.ViewReference.ContextValueForKey("OrganizerColor");

            if (!string.IsNullOrEmpty(organizerColorKey))
            {
                this.Organizer.OrganizerColor = AureaColor.ColorWithString(organizerColorKey);
            }

            string         headerName = this.ViewReference.ContextValueForKey("HeaderName");
            UPConfigHeader header     = null;

            if (!string.IsNullOrEmpty(headerName))
            {
                header = configStore.HeaderByName(headerName);
            }

            if (header == null)
            {
                headerName = "SYSTEMINFO.Expand";
                header     = configStore.HeaderByName(headerName);
            }

            if (header != null)
            {
                detailOrganizer.SubtitleText = header.Label;
                this.AddActionButtonsFromHeaderRecordIdentification(header, null);
            }
            else
            {
                detailOrganizer.SubtitleText = LocalizedString.TextSettings;
                UPMOrganizerAction action = new UPMOrganizerAction(StringIdentifier.IdentifierWithStringId("action.edit"));
                action.SetTargetAction(this, this.SwitchToEdit);
                action.LabelText = LocalizedString.TextEdit;
                action.IconName  = "Button:Edit";
                this.AddOrganizerHeaderActionItem(action);
            }

            SettingsViewPageModelController detailPageModelController = new SettingsViewPageModelController(this.ViewReference);
            Page overviewPage = detailPageModelController.Page;

            this.AddPageModelController(detailPageModelController);
            detailOrganizer.AddPage(overviewPage);
        }
Beispiel #10
0
        /// <summary>
        /// Builds the pages from view reference.
        /// </summary>
        public override void BuildPagesFromViewReference()
        {
            UPDataSyncPageModelController pageModelController = new UPDataSyncPageModelController();
            UPMOrganizer dataSynchronizationOrganizer         = new UPMOrganizer(StringIdentifier.IdentifierWithStringId("DataSynchronization"));

            this.ShouldShowTabsForSingleTab = false;
            this.AddPageModelController(pageModelController);
            dataSynchronizationOrganizer.AddPage(pageModelController.Page);
            this.TopLevelElement = dataSynchronizationOrganizer;
        }
Beispiel #11
0
        private void BuildEditOrganizerPage()
        {
            UPMOrganizer organizer = new UPMOrganizer(StringIdentifier.IdentifierWithStringId("EditQuestionnaire"));

            this.TopLevelElement      = organizer;
            this.RecordIdentification = this.ViewReference.ContextValueForKey("RecordId");
            this.InfoAreaId           = this.RecordIdentification.InfoAreaId();
            UPConfigTableCaption tableCaption = ConfigurationUnitStore.DefaultStore.TableCaptionByName(this.RecordIdentification.InfoAreaId());

            organizer.TitleText    = this.SurveyText;
            organizer.SubtitleText = tableCaption.TableCaptionForRecordIdentification(this.RecordIdentification);
            QuestionnaireEditPageModelController pageModelController = new QuestionnaireEditPageModelController(this.ViewReference);

            this.AddPageModelController(pageModelController);
            organizer.AddPage(pageModelController.Page);
            this.AddOrganizerActions();
            organizer.ExpandFound = true;
        }
Beispiel #12
0
        /// <summary>
        /// Adds Subview pages to UPMOrganizer
        /// </summary>
        /// <param name="expandHeader">
        /// <see cref="UPConfigHeader"/> configuration object
        /// </param>
        /// <param name="detailOrganizer">
        /// <see cref="UPMOrganizer"/> to add pages to
        /// </param>
        /// <param name="overviewPage">
        /// <see cref="Page"/> object to update LableText
        /// </param>
        private void UPMOrganizerAddPages(UPConfigHeader expandHeader, UPMOrganizer detailOrganizer, Page overviewPage)
        {
            var additionalParameters = new Dictionary <string, object> {
                { nameof(VirtualInfoAreaId), VirtualInfoAreaId }
            };

            if (expandHeader.SubViews != null)
            {
                foreach (UPConfigHeaderSubView subView in expandHeader.SubViews)
                {
                    if (subView.Options == "#")
                    {
                        overviewPage.LabelText = subView.Label;
                        continue;
                    }

                    UPPageModelController pageModelController = PageForViewReference(
                        subView.ViewReference?.ViewReferenceWith(additionalParameters).ViewReferenceWith(RecordIdentification));

                    if (pageModelController != null)
                    {
                        pageModelController.Page.Parent    = detailOrganizer;
                        pageModelController.Page.Invalid   = true;
                        pageModelController.Page.LabelText = subView.Label;
                        AddPageModelController(pageModelController);
                        if (pageModelController is UPWebContentPageModelController)
                        {
                            var webContentPageModelController = (UPWebContentPageModelController)pageModelController;
                            if (webContentPageModelController.AllowsXMLExport)
                            {
                                var exportXMLAction = new UPMOrganizerAction(StringIdentifier.IdentifierWithStringId("action.exportXML"))
                                {
                                    LabelText = "Export XML"
                                };
                                AddOrganizerHeaderActionItem(exportXMLAction);
                            }
                        }

                        detailOrganizer.AddPage(pageModelController.Page);
                    }
                }
            }
        }
        /// <summary>
        /// Builds the pages from view reference.
        /// </summary>
        public override void BuildPagesFromViewReference()
        {
            ObjectivesEditPageModelController pageModelController = new ObjectivesEditPageModelController(this.ViewReference);
            UPMOrganizer organizer = new UPMOrganizer(StringIdentifier.IdentifierWithStringId("EditObjectives"));

            this.RecordIdentification = this.ViewReference.ContextValueForKey("RecordId");
            string infoAreaId = this.RecordIdentification.InfoAreaId();
            UPConfigTableCaption tableCaption = ConfigurationUnitStore.DefaultStore.TableCaptionByName(this.RecordIdentification.InfoAreaId());

            organizer.TitleText    = tableCaption.TableCaptionForRecordIdentification(this.RecordIdentification);
            organizer.SubtitleText = UPCRMDataStore.DefaultStore.TableInfoForInfoArea(infoAreaId).Label;
            Page page = pageModelController.Page;

            page.LabelText = "Error";
            this.AddPageModelController(pageModelController);
            organizer.AddPage(page);
            this.TopLevelElement  = organizer;
            organizer.ExpandFound = true;
            this.AddOrganizerActions();
        }
        private void BuildEditOrganizerPage()
        {
            var organizer = new UPMOrganizer(StringIdentifier.IdentifierWithStringId("EditQuestionnaire"))
            {
                ExpandFound = true
            };

            this.TopLevelElement      = organizer;
            this.RecordIdentification = this.ViewReference.ContextValueForKey("RecordId");
            this.InfoAreaId           = this.RecordIdentification.InfoAreaId();
            var tableCaption = ConfigurationUnitStore.DefaultStore.TableCaptionByName(this.RecordIdentification.InfoAreaId());

            organizer.TitleText    = tableCaption.TableCaptionForRecordIdentification(this.RecordIdentification);
            organizer.SubtitleText = UPCRMDataStore.DefaultStore.TableInfoForInfoArea(this.InfoAreaId).Label;

            var pageModelController = new ContactTimesEditPageModelController(this.ViewReference);

            this.AddPageModelController(pageModelController);
            organizer.AddPage(pageModelController.Page);
            this.AddOrganizerActions();
        }
Beispiel #15
0
        /// <summary>
        /// Builds the pages from view reference.
        /// </summary>
        public override void BuildPagesFromViewReference()
        {
            UPMOrganizer detailOrganizer = new UPMOrganizer(StringIdentifier.IdentifierWithStringId("Details"));

            this.TopLevelElement = detailOrganizer;
            IConfigurationUnitStore configStore = ConfigurationUnitStore.DefaultStore;

            this.ConfigName = this.ViewReference.ContextValueForKey("LayoutName");
            WebConfigLayout layout = configStore.WebConfigLayoutByName(this.ConfigName);

            if (layout == null)
            {
                return;
            }

            string organizerColorKey = this.ViewReference.ContextValueForKey("OrganizerColor");

            if (!string.IsNullOrEmpty(organizerColorKey))
            {
                this.Organizer.OrganizerColor = AureaColor.ColorWithString(organizerColorKey);
            }

            string         headerName = this.ViewReference.ContextValueForKey("HeaderName");
            UPConfigHeader header     = null;

            if (!string.IsNullOrEmpty(headerName))
            {
                header = configStore.HeaderByName(headerName);
            }

            detailOrganizer.TitleText = header != null ? header.Label : LocalizedString.TextSettings;

            EditSettingsPageModelController detailPageModelController = new EditSettingsPageModelController(this.ViewReference);
            Page overviewPage = detailPageModelController.Page;

            this.AddPageModelController(detailPageModelController);
            detailOrganizer.AddPage(overviewPage);
            this.AddOrganizerActions();
            detailOrganizer.ExpandFound = true;
        }
Beispiel #16
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 #17
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();
            }
        }
        /// <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;
        }
        /// <summary>
        /// Builds the pages from view reference.
        /// </summary>
        public override void BuildPagesFromViewReference()
        {
            var dashboardOrganizer = new UPMOrganizer(StringIdentifier.IdentifierWithStringId("Dashboard"));

            dashboardOrganizer.ExpandFound = true;
            TopLevelElement = dashboardOrganizer;
            var configStore = ConfigurationUnitStore.DefaultStore;

            FormName             = ViewReference.ContextValueForKey("ConfigName");
            HeaderName           = ViewReference.ContextValueForKey("HeaderName");
            RecordIdentification = ViewReference.ContextValueForKey("RecordId");

            var form = (Form)null;

            if (!string.IsNullOrWhiteSpace(FormName))
            {
                form = configStore.FormByName(FormName);
            }

            var header = (UPConfigHeader)null;

            if (!string.IsNullOrWhiteSpace(HeaderName))
            {
                header = configStore.HeaderByName(HeaderName);
            }

            if (header != null)
            {
                dashboardOrganizer.SubtitleText = header.Label;
                AddActionButtonsFromHeaderRecordIdentification(header, null);
                foreach (UPMElement element in OrganizerHeaderActionItems)
                {
                    if (element is UPMOrganizerAction)
                    {
                        var action = (UPMOrganizerAction)element;
                        if (action.ViewReference.Arguments.ContainsKey("RecordId") ||
                            action.ViewReference.Arguments.ContainsKey("LinkRecordId"))
                        {
                            LogActionWarning(action.LabelText);
                        }
                    }
                    else if (element is UPMOrganizerActionGroup)
                    {
                        var actionGroup = (UPMOrganizerActionGroup)element;
                        foreach (UPMOrganizerAction action in actionGroup.Children)
                        {
                            if (action.ViewReference.Arguments.ContainsKey("RecordId") ||
                                action.ViewReference.Arguments.ContainsKey("LinkRecordId"))
                            {
                                LogActionWarning(action.LabelText);
                            }
                        }
                    }
                }
            }
            else
            {
                var formTab = form?.TabAtIndex(0);
                if (!string.IsNullOrWhiteSpace(formTab?.Label))
                {
                    dashboardOrganizer.SubtitleText = formTab.Label;
                }
            }

            if (form == null)
            {
                return;
            }

            BuildFormTabs(dashboardOrganizer, form);
            BuildHeaderSubViews(dashboardOrganizer, header);
        }