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

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

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

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

            statusField.FieldValue = LocalizedString.TextWaitForChanges;
            stillLoadingError.StatusMessageField = statusField;
            this.Organizer.Status = stillLoadingError;
            this.InformAboutDidChangeTopLevelElement(this.TopLevelElement, this.TopLevelElement, null, null);
            objectives.OfflineRequest.StartRequest(UPOfflineRequestMode.OnlineConfirm, changedRecords, this);
        }
Beispiel #2
0
        /// <summary>
        /// Objectiveses the did fail with error.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="error">The error.</param>
        public void ObjectivesDidFailWithError(UPObjectives sender, Exception error)
        {
            if (error.IsConnectionOfflineError())
            {
                this.HandlePageErrorDetails(LocalizedString.TextOffline, LocalizedString.TextErrorTitleNoInternet);
            }
            else
            {
                this.HandlePageErrorDetails(error.Message, error.StackTrace);
            }

            this.Page.Invalid = false;
            this.InformAboutDidChangeTopLevelElement(this.Page, this.Page, null, null);
        }
Beispiel #3
0
        /// <summary>
        /// Builds the page.
        /// </summary>
        public override void BuildPage()
        {
            this.recordId   = this.ViewReference.ContextValueForKey("RecordId");
            this.recordId   = UPCRMDataStore.DefaultStore.ReplaceRecordIdentification(this.recordId);
            this.InfoAreaId = this.ViewReference.ContextValueForKey("InfoAreaId");
            this.ConfigName = this.ViewReference.ContextValueForKey("ConfigName");
            Dictionary <string, object> parameters = new Dictionary <string, object> {
                { "viewReference", this.ViewReference }
            };

            this.ObjectivesCore  = new UPObjectives(this.recordId, parameters, this.editMode, this);
            this.editPageContext = new UPEditPageContext(this.recordId, false, null, null, this.ViewReference);
            this.DeletedItems    = new List <UPObjectivesItem>();
            UPMObjectivesPage _page = (UPMObjectivesPage)this.InstantiatePage();

            _page.LabelText      = LocalizedString.TextTabOverview;
            _page.Invalid        = true;
            this.TopLevelElement = _page;
            this.ApplyLoadingStatusOnPage(_page);
        }
Beispiel #4
0
 /// <summary>
 /// Objectiveses the did finish.
 /// </summary>
 /// <param name="sender">The sender.</param>
 public void ObjectivesDidFinish(UPObjectives sender)
 {
     this.objectivesGroupArray = new List <UPObjectivesGroup>(sender.Groups);
     this.UpdatePageWithResult();
 }