/// <summary> /// Offlines the request data context did fail with error. /// </summary> /// <param name="request">The request.</param> /// <param name="data">The data.</param> /// <param name="context">The context.</param> /// <param name="error">The error.</param> public override void OfflineRequestDidFailWithError(UPOfflineRequest request, object data, object context, Exception error) { this.DisableAllActionItems(false); this.InformAboutDidUpdateListOfErrors(new List <Exception> { error }); }
/// <summary> /// Offlines the request did finish with result. /// </summary> /// <param name="request">The request.</param> /// <param name="data">The data.</param> /// <param name="online">if set to <c>true</c> [online].</param> /// <param name="_context">The context.</param> /// <param name="result">The result.</param> public override void OfflineRequestDidFinishWithResult(UPOfflineRequest request, object data, bool online, object _context, Dictionary <string, object> result) { this.uploadDocumentRequest = null; this.Row.Error = null; this.SerialEntry.HandlePhotoUploadedContext(this.Row, this.Context); this.Finished(); }
/// <summary> /// Offlines the request data online context did finish with result. /// </summary> /// <param name="request">The request.</param> /// <param name="data">The data.</param> /// <param name="online">if set to <c>true</c> [online].</param> /// <param name="context">The context.</param> /// <param name="result">The result.</param> public override void OfflineRequestDidFinishWithResult(UPOfflineRequest request, object data, bool online, object context, Dictionary <string, object> result) { List <UPCRMRecord> records = (List <UPCRMRecord>)data; List <IIdentifier> changes = new List <IIdentifier>(); changes.AddRange(records.Select(record => new RecordIdentifier(record.InfoAreaId, record.RecordId))); if (!string.IsNullOrEmpty(this.RecordIdentification)) { changes.Add(new RecordIdentifier(this.RecordIdentification)); } if (changes.Count > 0) { UPChangeManager.CurrentChangeManager.RegisterChanges(changes); } if (this.conflictEditOfflineRequest != null) { this.ModelControllerDelegate.PopToRootContentViewController(); } else { this.ModelControllerDelegate.PopToPreviousContentViewController(); } }
/// <summary> /// Offlines the request data context did fail with error. /// </summary> /// <param name="request">The request.</param> /// <param name="data">The data.</param> /// <param name="context">The context.</param> /// <param name="error">The error.</param> public override async void OfflineRequestDidFailWithError(UPOfflineRequest request, object data, object context, Exception error) { this.Organizer.Status = null; #if PORTING //UPStatusHandler.ShowErrorMessage(LocalizedString.TextErrorCouldNotBeSaved); #endif this.InformAboutDidChangeTopLevelElement(this.TopLevelElement, this.TopLevelElement, null, null); if (this.pendingExecutionViewReference != null) { await SimpleIoc.Default.GetInstance <IDialogService>().ShowMessage( LocalizedString.TextObjectivesSaveError, LocalizedString.TextObjectivesTitle, this.actionButtonText, LocalizedString.TextCancel, c => { if (c) { ViewReference viewReference = this.pendingExecutionViewReference; this.pendingExecutionViewReference = null; this.ContinueWithAction(viewReference); } else { this.pendingExecutionViewReference = null; } }); } }
/// <summary> /// Offlines the request data context did fail with error. /// </summary> /// <param name="request">The request.</param> /// <param name="data">The data.</param> /// <param name="context">The context.</param> /// <param name="error">The error.</param> public void OfflineRequestDidFailWithError(UPOfflineRequest request, object data, object context, Exception error) { this.uploadDocumentRequest = null; this.buttonRequest = null; this.SerialEntryApproved = UPMSerialEntryState.Unknown; this.HandlePageErrorDetails(error.Message, error.StackTrace); this.SetShouldWaitForPendingChangesWithoutPageUpdate(false, true); this.ForcePageUpdate(new List <IIdentifier> { this.Page.Identifier }); }
/// <summary> /// Offlines the request data context did fail with error. /// </summary> /// <param name="request">The request.</param> /// <param name="data">The data.</param> /// <param name="context">The context.</param> /// <param name="error">The error.</param> public void OfflineRequestDidFailWithError(UPOfflineRequest request, object data, object context, Exception error) { this.followUpViewReference = this.ViewReferenceWith("CreateFailureAction", this.ViewReference.ContextValueForKey("LinkRecordId"), this.ViewReference.ContextValueForKey("LinkRecordId")); if (this.followUpViewReference == null) { this.Error = error; } this.ModelController.SetOfflineRequest(null, true); this.Finished(); }
/// <summary> /// Offlines the request data context did fail with error. /// </summary> /// <param name="request">The request.</param> /// <param name="data">The data.</param> /// <param name="context">The context.</param> /// <param name="error">The error.</param> public override void OfflineRequestDidFailWithError(UPOfflineRequest request, object data, object context, Exception error) { if (this.ModelControllerDelegate != null) { this.InformAboutDidUpdateListOfErrors(new List <Exception> { error }); } this.OfflineRequest = null; }
/// <summary> /// Offlines the request data online context did finish with result. /// </summary> /// <param name="request">The request.</param> /// <param name="data">The data.</param> /// <param name="online">if set to <c>true</c> [online].</param> /// <param name="context">The context.</param> /// <param name="result">The result.</param> public override void OfflineRequestDidFinishWithResult(UPOfflineRequest request, object data, bool online, object context, Dictionary <string, object> result) { if (request != this.uploadDocumentRequest) { if (!string.IsNullOrEmpty(this.RecordIdentification)) { List <IIdentifier> changes = new List <IIdentifier> { new RecordIdentifier(this.RecordIdentification) }; UPChangeManager.CurrentChangeManager.RegisterChanges(changes); } List <UPCRMRecord> records = (List <UPCRMRecord>)data; this.FillUploadRequestsForRecord(records[0]); } if (this.uploadDocumentRequests?.Count > 0) { if (request != this.uploadDocumentRequest) { this.uploadDocumentRequest = this.uploadDocumentRequests[0]; this.uploadDocumentRequests.Remove(this.uploadDocumentRequest); bool requestAccepted = this.uploadDocumentRequest.StartRequest(UPOfflineRequestMode.OnlineConfirm, this); if (requestAccepted) { return; } } else { this.uploadDocumentRequest = this.uploadDocumentRequests[0]; bool requestAccepted = this.uploadDocumentRequest.StartRequest(UPOfflineRequestMode.OnlineConfirm, this); if (requestAccepted) { return; } } } if (this.pendingExecutionViewReference != null) { ViewReference viewReference = this.pendingExecutionViewReference; this.pendingExecutionViewReference = null; this.Organizer.Status = null; this.ContinueWithAction(viewReference); return; } this.ModelControllerDelegate.PopToPreviousContentViewController(); this.OfflineRequest = null; }
/// <summary> /// Sends the report for offline request. /// </summary> /// <param name="request">The request.</param> void SendReportForOfflineRequest(UPOfflineRequest request) { #if PORTING string xmlData = request.Xml(); UPMail mail = new UPMail(); mail.Subject = NSString.StringWithFormat("SyncConflict from %@ at %@ of type %@", ServerSession.CurrentSession().UserName, request.ServerDateTime, request.ProcessType); mail.AddRecipient(((UPMSyncConflictsPage)this.Page).SyncConflictEmail); string filename = NSString.StringWithFormat("SyncConflict_%@_%@_%ld.xml", ServerSession.CurrentSession().UserName, request.ProcessType, request.RequestNr); UPMailAttachment attachment = new UPMailAttachment(xmlData, "application/xml", filename); mail.AddAttachment(attachment); this.ModelControllerDelegate.SendMailModal(mail, false); #endif }
/// <summary> /// Offlines the request data online context did finish with result. /// </summary> /// <param name="request">The request.</param> /// <param name="data">The data.</param> /// <param name="online">if set to <c>true</c> [online].</param> /// <param name="context">The context.</param> /// <param name="result">The result.</param> public override void OfflineRequestDidFinishWithResult(UPOfflineRequest request, object data, bool online, object context, Dictionary <string, object> result) { List <UPCRMRecord> changedRecords = (List <UPCRMRecord>)data; if (changedRecords.Count > 0) { List <IIdentifier> changedIdentifiers = new List <IIdentifier>(); changedIdentifiers.AddRange(changedRecords.Select(x => new RecordIdentifier(x.RecordIdentification))); UPChangeManager.CurrentChangeManager.RegisterChanges(changedIdentifiers); } this.ModelControllerDelegate.PopToPreviousContentViewController(); }
public void OfflineRequestDataOnlineContextDidFinishWithResult(UPOfflineRequest request, object data, bool online, object context, object result) { this.offlineRequest = null; List <UPCRMRecord> copiedRecords = data as List <UPCRMRecord>; if (copiedRecords?.Count > 0) { UPCRMRecord record = copiedRecords[0]; this.outputValue = record.RecordIdentification; this.Delegate.GroupModelControllerValueChanged(this, this.outputValue); } this.ShowFinished(null); }
/// <summary> /// Offlines the request did finish with result. /// </summary> /// <param name="request">The request.</param> /// <param name="data">The data.</param> /// <param name="online">if set to <c>true</c> [online].</param> /// <param name="_context">The context.</param> /// <param name="result">The result.</param> public override void OfflineRequestDidFinishWithResult(UPOfflineRequest request, object data, bool online, object _context, Dictionary <string, object> result) { foreach (UPSERow row in this.changedRows) { row.Error = null; } this.SerialEntry.Error = null; this.SerialEntry.SaveAllExecuted = true; this.SerialEntry.UnblockOfflineRequestWithUpSync(online ? online : ServerSession.CurrentSession.ConnectedToServer); this.SerialEntry.HandleRowChangesResultContextSaveAll(this.changedRows, data, this.Context, true); this.SerialEntry.StartNextRequest(); }
/// <summary> /// Offlines the request data online context did finish with result. /// </summary> /// <param name="request">The request.</param> /// <param name="data">The data.</param> /// <param name="online">if set to <c>true</c> [online].</param> /// <param name="context">The context.</param> /// <param name="result">The result.</param> public void OfflineRequestDidFinishWithResult(UPOfflineRequest request, object data, bool online, object context, Dictionary <string, object> result) { this.followUpViewReference = this.ViewReferenceWith("CreatedAction", this.record.RecordIdentification, this.ViewReference.ContextValueForKey("LinkRecordId")) ?? this.ViewReferenceWith("defaultFinishAction", this.record.RecordIdentification, this.ViewReference.ContextValueForKey("LinkRecordId")); if (this.ViewReference.HasBackToPreviousFollowUpAction()) { this.followUpViewReference = this.followUpViewReference.ViewReferenceWithBackToPreviousFollowUpAction(); this.followUpReplaceOrganizer = true; } this.ChangedRecords = (List <UPCRMRecord>)data; this.ModelController.SetOfflineRequest(null, true); this.Finished(); }
/// <summary> /// Approves the specified dummy. /// </summary> /// <param name="dummy">The dummy.</param> public void Approve(object dummy) { if (this.disableSigning) { return; } string recordIdentification = this.buttonViewReference.ContextValueForKey("RecordId"); string filterName = this.buttonViewReference.ContextValueForKey("TemplateFilter"); if (string.IsNullOrEmpty(recordIdentification)) { this.ParentOrganizerModelController.HandleOrganizerActionError( LocalizedString.TextErrorConfiguration, string.Format(LocalizedString.TextErrorParameterEmpty, "RecordId"), true); return; } UPConfigFilter filter = ConfigurationUnitStore.DefaultStore.FilterByName(filterName); if (filter == null) { this.HandlePageErrorDetails(LocalizedString.TextErrorConfiguration, string.Format(LocalizedString.TextErrorFilterMissing, filterName)); return; } filter = filter.FilterByApplyingValueDictionaryDefaults(this.FieldValueDictionary, true); UPCRMRecord record = new UPCRMRecord(recordIdentification); record.ApplyValuesFromTemplateFilter(filter); UPOfflineEditRecordRequest request = new UPOfflineEditRecordRequest(0); this.buttonRequest = request; string requestOptionString = this.buttonViewReference.ContextValueForKey("RequestOption"); UPOfflineRequestMode requestMode = UPOfflineRequest.RequestModeFromString(requestOptionString, UPOfflineRequestMode.OnlineConfirm); if (request.StartRequest(requestMode, new List <UPCRMRecord> { record }, this) == false) { this.buttonRequest = null; } else { this.ShouldWaitForPendingChanges = true; } }
private void PerformUploadReportPdfWithRecords(List <UPCRMRecord> records) { if (records.Count > 0) { string requestOptionString = this.buttonViewReference.ContextValueForKey("RequestOption"); UPOfflineRequestMode requestMode = UPOfflineRequest.RequestModeFromString(requestOptionString, UPOfflineRequestMode.OnlineConfirm); UPOfflineEditRecordRequest request = new UPOfflineEditRecordRequest(requestMode, null); this.buttonRequest = request; foreach (UPCRMRecord record in records) { request.AddRecord(record); } this.multiRequest.AddRequest(request); } this.multiRequest.Start(); }
/// <summary> /// Offlines the request did finish with result. /// </summary> /// <param name="request">The request.</param> /// <param name="data">The data.</param> /// <param name="online">if set to <c>true</c> [online].</param> /// <param name="_context">The context.</param> /// <param name="result">The result.</param> public override void OfflineRequestDidFinishWithResult(UPOfflineRequest request, object data, bool online, object _context, Dictionary <string, object> result) { List <object> contextArray = (List <object>) this.Context; int rowIndex = 0; foreach (UPSERow row in this.rows) { object context = null; if (contextArray.Count > rowIndex) { context = contextArray[rowIndex]; } ++rowIndex; this.SerialEntry.HandleRowChangesResultContextSaveAll(new List <UPSERow> { row }, null, context, false); } this.Finished(); }
/// <summary> /// Offlines the request did finish with result. /// </summary> /// <param name="request">The request.</param> /// <param name="data">The data.</param> /// <param name="online">if set to <c>true</c> [online].</param> /// <param name="_context">The context.</param> /// <param name="result">The result.</param> public override void OfflineRequestDidFinishWithResult(UPOfflineRequest request, object data, bool online, object _context, Dictionary <string, object> result) { this.Row.Error = null; List <UPSERow> dependentPositions = this.Row.DependentRows(this.SerialEntry.Positions); if (dependentPositions != null) { //List<UPSERow> bundlePositions = new List<UPSERow>(dependentPositions); //bundlePositions.Add(this.Row); foreach (UPSERow row in dependentPositions) { //row.RowPricing.UpdateCurrentConditionsWithPositions(bundlePositions); //row.ClearDiscountInfo(); row.ComputeRowWithConditionsWithDependent(false); } } this.SerialEntry.HandleRowChangesResultContextSaveAll(new List <UPSERow> { this.Row }, data, this.Context, false); this.Finished(); }
/// <summary> /// Executes this instance. /// </summary> public override void Execute() { string requestModeString = this.ViewReference.ContextValueForKey("RequestMode"); if (!ServerSession.CurrentSession.UserChoiceOffline && ServerSession.CurrentSession.ConnectedToServer) { this.RequestMode = UPOfflineRequest.RequestModeFromString(requestModeString, UPOfflineRequestMode.OnlineOnly); } else { this.RequestMode = UPOfflineRequest.RequestModeFromString(requestModeString, UPOfflineRequestMode.Offline); } this.RecordIdentification = this.ViewReference.ContextValueForKey("RecordId"); string filterName = this.ViewReference.ContextValueForKey("TemplateFilter"); if (string.IsNullOrEmpty(this.RecordIdentification)) { this.ModelController.HandleOrganizerActionError(LocalizedString.TextErrorConfiguration, string.Format(LocalizedString.TextErrorParameterEmpty, "RecordId"), true); return; } this.TemplateFilter = ConfigurationUnitStore.DefaultStore.FilterByName(filterName); if (this.TemplateFilter == null && string.IsNullOrEmpty(this.ViewReference.ContextValueForKey("LinkRecordId"))) { this.ModelController.HandleOrganizerActionError(LocalizedString.TextErrorConfiguration, string.Format(LocalizedString.TextErrorFilterMissing, filterName), true); return; } if (this.TemplateFilter?.NeedsLocation ?? false) { SimpleIoc.Default.GetInstance <ILocationService>().GetCurrentLocation(this); return; } this.ContinueTemplateFilterGeoChecked(); }
/// <summary> /// Offlines the request data online context did finish with result. /// </summary> /// <param name="request">The request.</param> /// <param name="data">The data.</param> /// <param name="online">if set to <c>true</c> [online].</param> /// <param name="context">The context.</param> /// <param name="result">The result.</param> public override void OfflineRequestDidFinishWithResult(UPOfflineRequest request, object data, bool online, object context, Dictionary <string, object> result) { this.waitForSave = false; this.Organizer.Status = null; if (this.created) { if (!this.waitForSerialEntrySave) { base.OfflineRequestDidFinishWithResult(request, data, online, context, result); } return; } List <IIdentifier> changedIdentifiers = new List <IIdentifier>(((UPOfflineRecordRequest)request).Records.Count); this.SetRecordIdentificationForRecords((List <UPCRMRecord>)data, changedIdentifiers); if (!string.IsNullOrEmpty(this.LinkRecordIdentification)) { changedIdentifiers.Add(new RecordIdentifier(this.LinkRecordIdentification)); if (!string.IsNullOrEmpty(this.LinkRecordIdentification2)) { changedIdentifiers.Add(new RecordIdentifier(this.LinkRecordIdentification2)); } } if (this.IsNew) { this.AddRemainingPageModelController(); this.UpdateTitleText(); this.UpdateOrganizerActions(changedIdentifiers); } UPChangeManager.CurrentChangeManager.RegisterChanges(changedIdentifiers); this.InformAboutDidChangeTopLevelElement(this.Organizer, this.Organizer, changedIdentifiers, null); }
/// <summary> /// Offlines the request did fail with error. /// </summary> /// <param name="request">The request.</param> /// <param name="data">The data.</param> /// <param name="_context">The context.</param> /// <param name="error">The error.</param> public override void OfflineRequestDidFailWithError(UPOfflineRequest request, object data, object _context, Exception error) { this.SerialEntry.Error = error; if (this.changedRows.Count == 1) { UPSERow row = this.changedRows[0]; row.Error = error; } else if (this.changedRows.Count > 0) { Exception rowError = new Exception("SerialEntrySave", error); foreach (UPSERow row in this.changedRows) { if (row.Error == null) { row.Error = rowError; } } } this.SerialEntry.UnblockOfflineRequestWithUpSync(!error.IsConnectionOfflineError()); this.SerialEntry.HandleRowErrorContext(null, error, _context); this.Finished(); }
/// <summary> /// Offlines the request data context did fail with error. /// </summary> /// <param name="request">The request.</param> /// <param name="data">The data.</param> /// <param name="context">The context.</param> /// <param name="error">The error.</param> public virtual void OfflineRequestDidFailWithError(UPOfflineRequest request, object data, object context, Exception error) { this.SerialEntry.HandleRowErrorContext(null, error, this.Context); this.Finished(); }
/// <summary> /// Offlines the request did finish with result. /// </summary> /// <param name="request">The request.</param> /// <param name="data">The data.</param> /// <param name="online">if set to <c>true</c> [online].</param> /// <param name="_context">The context.</param> /// <param name="result">The result.</param> public override void OfflineRequestDidFinishWithResult(UPOfflineRequest request, object data, bool online, object _context, Dictionary <string, object> result) { this.Row.Error = null; this.SerialEntry.HandleRowDeleteResultContext(this.Row, data, this.Context); this.Finished(); }
public void OfflineRequestDidFinishMultiRequest(UPOfflineRequest request) { throw new NotImplementedException(); }
/// <summary> /// Offlines the request did finish with result. /// </summary> /// <param name="request">The request.</param> /// <param name="data">The data.</param> /// <param name="online">if set to <c>true</c> [online].</param> /// <param name="context">The context.</param> /// <param name="result">The result.</param> public override void OfflineRequestDidFinishWithResult(UPOfflineRequest request, object data, bool online, object context, Dictionary <string, object> result) { this.Row.Error = null; base.OfflineRequestDidFinishWithResult(request, data, online, context, result); }
/// <summary> /// Offlines the request did fail with error. /// </summary> /// <param name="request">The request.</param> /// <param name="data">The data.</param> /// <param name="_context">The context.</param> /// <param name="error">The error.</param> public override void OfflineRequestDidFailWithError(UPOfflineRequest request, object data, object _context, Exception error) { this.Row.Error = error; this.SerialEntry.HandleRowErrorContext(this.Row, error, this.Context); this.Finished(); }
/// <summary> /// Offlines the request data online context did finish with result. /// </summary> /// <param name="request">The request.</param> /// <param name="data">The data.</param> /// <param name="online">if set to <c>true</c> [online].</param> /// <param name="context">The context.</param> /// <param name="result">The result.</param> public virtual void OfflineRequestDidFinishWithResult(UPOfflineRequest request, object data, bool online, object context, Dictionary <string, object> result) { this.Finished(); }
public void OfflineRequestDidFinishWithResult(UPOfflineRequest request, object data, bool online, object context, Dictionary <string, object> result) { throw new NotImplementedException(); }
/// <summary> /// Offlines the request did fail with error. /// </summary> /// <param name="request">The request.</param> /// <param name="data">The data.</param> /// <param name="_context">The context.</param> /// <param name="error">The error.</param> public override void OfflineRequestDidFailWithError(UPOfflineRequest request, object data, object _context, Exception error) { this.uploadDocumentRequest = null; base.OfflineRequestDidFailWithError(request, data, _context, error); }
/// <summary> /// Offlines the request did finish multi request. /// </summary> /// <param name="request">The request.</param> public void OfflineRequestDidFinishMultiRequest(UPOfflineRequest request) { // Function part of interface implementation, not applicable here, will never be implemented. throw new NotImplementedException(); }
public void OfflineRequestDidFailWithError(UPOfflineRequest request, object data, object context, Exception error) { throw new NotImplementedException(); }