private void PerformUploadReportPdf(int viewTag, object sender) { this.disable85106 = true; byte[] data = this.CreatePdfData(viewTag); string recordIdentification = this.RecordIdentification; int fieldId = -1; ViewReference documentUploadViewReference = this.DetermineDocumentUploadViewReference(); if (documentUploadViewReference != null) { recordIdentification = documentUploadViewReference.ContextValueForKey("RecordId"); if (string.IsNullOrEmpty(recordIdentification)) { recordIdentification = this.RecordIdentification; } string parentLinkString = documentUploadViewReference.ContextValueForKey("ParentLink"); if (!string.IsNullOrEmpty(parentLinkString)) { UPCRMLinkReader _linkReader = new UPCRMLinkReader(recordIdentification, parentLinkString, null); recordIdentification = _linkReader.RequestLinkRecordOffline(); } fieldId = this.DetermineFieldIdDocumentUploadViewReference(fieldId, documentUploadViewReference); } this.approveActionDelegate = sender; this.reportFileName = this.CalcReportFileName(); this.uploadDocumentRequest = new UPOfflineUploadDocumentRequest(data, -1, this.reportFileName, "application/pdf", recordIdentification, fieldId); this.uploadDocumentRequest.StartRequest(UPOfflineRequestMode.OnlineConfirm, this); }
/// <summary> /// The link reader did finish with result. /// </summary> /// <param name="linkReader">The link reader.</param> /// <param name="result">The result.</param> public void LinkReaderDidFinishWithResult(UPCRMLinkReader linkReader, object result) { if (!string.IsNullOrEmpty(linkReader.DestinationRecordIdentification)) { if (this.CreateParentControllerFromLinkReader(linkReader)) { this.LinkFields = null; if (this.ApplyLinkRecordIdentification(linkReader.DestinationRecordIdentification) != null) { this.ControllerState = GroupModelControllerState.Finished; this.CallDelegate(); } } else { this.ControllerState = GroupModelControllerState.Error; this.CallDelegate(); } } else { this.ControllerState = GroupModelControllerState.Empty; this.CallDelegate(); } }
/// <summary> /// Links the reader did finish with result. /// </summary> /// <param name="_linkReader">The link reader.</param> /// <param name="result">The result.</param> public override void LinkReaderDidFinishWithResult(UPCRMLinkReader _linkReader, object result) { if (_linkReader == this.templateFilterLinkReader) { this.templateFilterLinkReader = null; if (_linkReader.DestinationRecordIdentification.IsRecordIdentification()) { this.currentCheckedLinkRecord.UpdateRecordInformationWithRecordIdentification(_linkReader.DestinationRecordIdentification, true); this.recordsToSave.Add(this.currentCheckedLinkRecord); this.currentCheckedLinkRecord = null; } if (this.openChildRecords != null) { this.ContinueWithLinkRecords(this.openChildRecords); } else { this.PerformUploadReportPdfWithRecords(this.recordsToSave); } } else if (_linkReader == this.parentLinkReader) { this.parentLinkRecordIdentification = _linkReader.DestinationRecordIdentification ?? string.Empty; this.ContinueUploadReportPdf(); } else { base.LinkReaderDidFinishWithResult(_linkReader, result); } }
/// <summary> /// Executes this instance. /// </summary> public override void Execute() { this.ParentLink = this.ViewReference.ContextValueForKey("ParentLink"); string linkRecordIdentification = this.ViewReference.ContextValueForKey("LinkRecordId"); if (!string.IsNullOrEmpty(this.ParentLink) && !string.IsNullOrEmpty(linkRecordIdentification)) { if (this.ParentLink == "NoLink") { this.LinkRecordIdentification = null; } else { this.linkReader = new UPCRMLinkReader(linkRecordIdentification, this.ParentLink, this); if (!this.linkReader.Start()) { this.Error = new Exception("cannot start link reader"); this.Finished(); } return; } } else { this.LinkRecordIdentification = linkRecordIdentification; } this.ParentLinkLoaded(); }
/// <summary> /// Link reader did finish with result /// </summary> /// <param name="linkReader">Link reader</param> /// <param name="result">Result</param> public void LinkReaderDidFinishWithResult(UPCRMLinkReader linkReader, object result) { this.LinkRecordIdentification = linkReader.DestinationRecordIdentification; this.ParentLinkString = string.Empty; this.LinkReader = null; this.Search((UPMSearchPage)this.Page); }
private void QuestionnaireLoaded() { if (this.Questionnaire == null) { this.TheDelegate.SurveyDidFailWithError(this, new Exception("questionnaire could not be loaded")); return; } Dictionary <string, object> dict = new Dictionary <string, object>(this.Questionnaire.DataDictionary); foreach (string key in this.Parameters.Keys) { dict[key] = this.Parameters[key]; } this.Parameters = dict; if (!string.IsNullOrEmpty(this.ParentLink)) { this.linkReader = new UPCRMLinkReader(this.RecordIdentification, this.ParentLink, this.SourceRequestOption, this); this.linkReader.Start(); } else { this.RootRecordIdentification = this.RecordIdentification; this.ParentLinkLoaded(); } }
/// <summary> /// Links the reader did finish with result. /// </summary> /// <param name="_linkReader">The link reader.</param> /// <param name="result">The result.</param> public virtual void LinkReaderDidFinishWithResult(UPCRMLinkReader _linkReader, object result) { if (!string.IsNullOrEmpty(_linkReader.DestinationRecordIdentification)) { this.RecordIdentification = _linkReader.DestinationRecordIdentification; this.ContinueBuildPage(); } }
/// <summary> /// Links the reader did finish with result. /// </summary> /// <param name="_linkReader">The link reader.</param> /// <param name="result">The result.</param> public void LinkReaderDidFinishWithResult(UPCRMLinkReader _linkReader, object result) { if (_linkReader.DestinationRecordIdentification != null) { this.RecordIdentification = _linkReader.DestinationRecordIdentification; } this.ContinueLoadRecordData(); }
/// <summary> /// Links the reader did finish with result. /// </summary> /// <param name="linkReader">The link reader.</param> /// <param name="result">The result.</param> public void LinkReaderDidFinishWithResult(UPCRMLinkReader linkReader, object result) { this.LinkReader = null; if (!string.IsNullOrEmpty(linkReader.DestinationRecordIdentification)) { this.RecordIdentification = linkReader.DestinationRecordIdentification; this.ContinueBuildDetailOrganizerPages0(); } }
/// <summary> /// Applies the record identification. /// </summary> /// <param name="_recordIdentification">The record identification.</param> public void ApplyRecordIdentification(string _recordIdentification) { this.ControllerState = GroupModelControllerState.Pending; this.recordIdentification = _recordIdentification; if (!string.IsNullOrEmpty(this.recordIdentification)) { this.relevantViewReference = this.relevantViewReference.ViewReferenceWith(this.recordIdentification); } string _linkRecordIdentification; if (this.isAlternativeContextMenu && this.countable) { _linkRecordIdentification = this.relevantViewReference.ContextValueForKey("LinkRecord"); if (!string.IsNullOrEmpty(_linkRecordIdentification) && _linkRecordIdentification.IsRecordIdentification()) { _linkRecordIdentification = UPCRMDataStore.DefaultStore.ReplaceRecordIdentification(_linkRecordIdentification); object linkIdObject = this.relevantViewReference.ContextValueForKey("LinkId"); if (linkIdObject != null) { this.linkId = Convert.ToInt32(linkIdObject); } else { this.linkId = -1; } } else { _linkRecordIdentification = null; this.linkId = -1; } this.filterName = this.relevantViewReference.ContextValueForKey("FilterName"); } else { _linkRecordIdentification = this.recordIdentification; this.linkId = 0; this.filterName = null; } string parentLink = this.relevantViewReference?.ContextValueForKey("ParentLink"); if (!string.IsNullOrEmpty(_linkRecordIdentification) && !string.IsNullOrEmpty(parentLink)) { this.linkReader = new UPCRMLinkReader(_linkRecordIdentification, parentLink, this.requestOption, this); this.linkReader.Start(); } else { this.ContinueWithRecordIdentification(_linkRecordIdentification); } }
/// <summary> /// Links the reader did finish with result. /// </summary> /// <param name="_linkReader">The link reader.</param> /// <param name="result">The result.</param> public void LinkReaderDidFinishWithResult(UPCRMLinkReader _linkReader, object result) { if (!string.IsNullOrEmpty(_linkReader.DestinationRecordIdentification)) { this.RecordIdentification = _linkReader.DestinationRecordIdentification; this.ContinueBuildGroup(); if (this.ControllerState != GroupModelControllerState.Pending) { this.Delegate.GroupModelControllerFinished(this); } } }
private void ContinueWithLinkRecords(List <UPCRMRecord> linkRecords) { this.OpenChildRecords = null; string parentLinkString = null; string sourceRecordIdentification = null; foreach (UPCRMRecord linkRecord in linkRecords) { UPCRMLink link = linkRecord.SingleLink; if (link == null) { continue; } UPCRMRecord childRecord = link.Record; if (childRecord.Mode == "ParentUpdate" || !string.IsNullOrEmpty(sourceRecordIdentification)) { if (this.OpenChildRecords == null) { this.OpenChildRecords = new List <UPCRMRecord> { childRecord }; } else { this.OpenChildRecords.Add(childRecord); } continue; } if (!childRecord.RecordIdentification.IsRecordIdentification()) { continue; } sourceRecordIdentification = childRecord.RecordIdentification; this.CurrentCheckedLinkRecord = linkRecord; parentLinkString = link.LinkId > 0 ? $"{linkRecord.InfoAreaId}:{link.LinkId}" : linkRecord.InfoAreaId; } if (string.IsNullOrEmpty(parentLinkString) || string.IsNullOrEmpty(sourceRecordIdentification)) { this.ContinueWithRecords(this.RecordsToSave); return; } this.LinkReader = new UPCRMLinkReader(sourceRecordIdentification, parentLinkString, UPRequestOption.FastestAvailable, this); if (!this.LinkReader.Start()) { this.ContinueWithRecords(this.RecordsToSave); } }
private void LoadRecordData() { string parentLink = this.ViewReference.ContextValueForKey("ParentLink"); if (!string.IsNullOrEmpty(parentLink)) { this.linkReader = new UPCRMLinkReader(this.RecordIdentification, parentLink, this); this.linkReader.Start(); } else { this.ContinueLoadRecordData(); } }
/// <summary> /// Loads for link record. /// </summary> /// <param name="linkRecord">The link record.</param> /// <param name="filterParameters">The filter parameters.</param> public void LoadForLinkRecord(UPCRMRecord linkRecord, Dictionary <string, object> filterParameters) { this.FilterParameters = filterParameters; this.LinkRecord = linkRecord; this.loadStep = 0; if (this.ParentLinkString != null) { this.linkReader = new UPCRMLinkReader(this.LinkRecord.RecordIdentification, this.ParentLinkString, this); this.linkReader.Start(); } else { this.linkRecordIdentification = this.LinkRecord.RecordIdentification; this.LoadArticleConfigurations(); } }
/// <summary> /// Links the reader did finish with error. /// </summary> /// <param name="_linkReader">The link reader.</param> /// <param name="error">The error.</param> public override void LinkReaderDidFinishWithError(UPCRMLinkReader _linkReader, Exception error) { if (_linkReader == this.templateFilterLinkReader) { this.templateFilterLinkReader = null; this.ReportError(error, true); } else if (_linkReader == this.parentLinkReader) { this.parentLinkReader = null; this.ReportError(error, true); } else { base.LinkReaderDidFinishWithError(_linkReader, error); } }
/// <summary> /// Performs search /// </summary> /// <param name="sender">Sender object</param> public override void Search(object sender) { var searchPage = (UPMSearchPage)sender; if (this.LinkReader != null) { return; } if (!string.IsNullOrEmpty(this.ParentLinkString) && !string.IsNullOrEmpty(this.LinkRecordIdentification)) { this.LinkReader = new UPCRMLinkReader(this.LinkRecordIdentification, this.ParentLinkString, UPRequestOption.FastestAvailable, this); if (this.LinkReader.Start()) { return; } this.LinkReader = null; this.ParentLinkString = null; } this.CurrentSearchOperation?.Cancel(); string value = null; if (!string.IsNullOrEmpty(searchPage.SearchText)) { value = searchPage.SearchText; } var configFilters = this.ActiveFiltersForSearchPage(searchPage); if (string.IsNullOrEmpty(value) && configFilters.Count == 0) { var contextValue = this.ViewReference.ContextValueForKey(@"SearchOptions"); var range = contextValue?.IndexOf(@"NoEmptySearch"); if (range > 0) { this.SearchOperationDidFinishWithResult(null, null); return; } } this.StartStandardSearchWithValue(value, configFilters); }
private bool CreateParentControllerFromLinkReader(UPCRMLinkReader linkReader) { int tabIndex; UPConfigFieldControlField field = this.LinkFields[linkReader.DestinationPosition]; string fieldGroupName = field.InfoAreaId; tabIndex = 0; string fieldStyle = field.Attributes.FieldStyle; if (!string.IsNullOrEmpty(fieldStyle)) { var parts = fieldStyle.Split('_'); if (parts.Length > 1) { tabIndex = Convert.ToInt32(parts[1]); fieldGroupName = parts[0]; } else { fieldGroupName = fieldStyle; } } IConfigurationUnitStore configStore = ConfigurationUnitStore.DefaultStore; this.ParentFieldControl = configStore.FieldControlByNameFromGroup("Details", fieldGroupName); if (this.ParentFieldControl == null && fieldGroupName == field.InfoAreaId) { this.ParentFieldControl = configStore.FieldControlByNameFromGroup("Details", field.InfoAreaId); } if (this.ParentFieldControl == null) { return(false); } if (tabIndex >= this.ParentFieldControl.NumberOfTabs) { tabIndex = 0; } this.ParentController = UPGroupModelController.DetailsGroupModelController(this.ParentFieldControl, tabIndex, this); this.ParentController.ExplicitLabel = this.TabLabel; return(true); }
/// <inheritdoc/> public override Page UpdatedElementForPage(UPMSearchPage page) { if (this.AnalysisLinkRecordIdentification?.Length > 0) { this.ContinueWithAnalysisLinkRecord(this.AnalysisLinkRecordIdentification); } else if (this.ParentLink?.Length > 0 && this.RecordIdentification?.Length > 0) { this.linkReader = new UPCRMLinkReader(this.RecordIdentification, this.ParentLink, this.RequestOption, this); this.linkReader.Start(); } else { this.ContinueWithAnalysisLinkRecord(this.RecordIdentification); } return(this.Page); }
/// <summary> /// Links the reader did finish with result. /// </summary> /// <param name="linkReader">The link reader.</param> /// <param name="result">The result.</param> public void LinkReaderDidFinishWithResult(UPCRMLinkReader linkReader, object result) { this.LinkReader = null; if (linkReader.DestinationRecordIdentification.IsRecordIdentification()) { this.CurrentCheckedLinkRecord.UpdateRecordInformationWithRecordIdentification(linkReader.DestinationRecordIdentification, true); this.RecordsToSave.Add(this.CurrentCheckedLinkRecord); this.CurrentCheckedLinkRecord = null; } if (this.OpenChildRecords != null) { this.ContinueWithLinkRecords(this.OpenChildRecords); } else { this.ContinueWithRecords(this.RecordsToSave); } }
/// <summary> /// Links the reader did finish with result. /// </summary> /// <param name="_linkReader">The link reader.</param> /// <param name="result">The result.</param> public void LinkReaderDidFinishWithResult(UPCRMLinkReader _linkReader, object result) { string _recordIdentification; this.linkReader = null; _recordIdentification = _linkReader.DestinationRecordIdentification ?? string.Empty; if (this.parentLinkDictionary == null) { this.parentLinkDictionary = new Dictionary <string, string> { { _linkReader.ParentLinkString, _recordIdentification } }; } else { this.parentLinkDictionary[_linkReader.ParentLinkString] = _recordIdentification; } this.ComputeNextReport(); }
/// <summary> /// Updateds the element. /// </summary> /// <param name="element">The element.</param> /// <returns> /// The <see cref="UPMElement" />. /// </returns> public override UPMElement UpdatedElement(UPMElement element) { if (element is UPMOrganizer) { this.AlternateExpandChecker = null; this.LinkReader = null; this.Tiles = null; this.TilesName = null; this.CopyFields = null; this.PageModelControllers.Clear(); List <UPMElement> newActions = null; foreach (UPMOrganizerAction action in this.LeftNavigationBarItems) { if (action.Identifier.IdentifierAsString == "CloseOrganizerAction") { newActions = new List <UPMElement> { action }; } } if (newActions != null) { this.LeftNavigationBarItems = newActions; } else { this.LeftNavigationBarItems.Clear(); } this.RightNaviagtionBarItems.Clear(); this.OrganizerHeaderQuickActionItems?.Clear(); this.OrganizerHeaderActionItems.Clear(); this.SaveActionItems.Clear(); this.BuildDetailOrganizerPages(); } return(null); }
private void ContinueBuildPageWithParameters(Dictionary <string, object> parameters) { this.copyFields = null; this.FieldValueDictionary = parameters; Dictionary <string, object> dict = new Dictionary <string, object>(); Dictionary <string, List <string> > sessionParameters = ServerSession.CurrentSession.SessionParameterReplacements; foreach (string key in sessionParameters.Keys) { List <string> val = sessionParameters[key]; if (val.Count > 0) { dict[key] = val[0]; } } if (parameters?.Count > 0) { foreach (string key in parameters.Keys) { dict[$"${key}"] = parameters[key]; } } this.PrefixedFieldValueDictionary = dict; string parentLink = this.ViewReference.ContextValueForKey("ParentLink"); if (!string.IsNullOrEmpty(parentLink)) { this.linkReader = new UPCRMLinkReader(this.RecordIdentification, parentLink, UPRequestOption.FastestAvailable, this); this.linkReader.Start(); } else { this.ContinueBuildPage(); } }
/// <summary> /// Links the reader did finish with error. /// </summary> /// <param name="linkReader">The link reader.</param> /// <param name="error">The error.</param> public void LinkReaderDidFinishWithError(UPCRMLinkReader linkReader, Exception error) { this.ControllerState = GroupModelControllerState.Error; this.Error = error; this.CallDelegate(); }
/// <inheritdoc/> public void LinkReaderDidFinishWithResult(UPCRMLinkReader linkReader, object result) { this.linkReader = null; this.ContinueWithAnalysisLinkRecord(linkReader.DestinationRecordIdentification); }
/// <inheritdoc/> public void LinkReaderDidFinishWithError(UPCRMLinkReader linkReader, Exception error) { this.linkReader = null; this.ReportError(error, false); }
/// <summary> /// Links the reader did finish with error. /// </summary> /// <param name="_linkReader">The link reader.</param> /// <param name="error">The error.</param> public virtual void LinkReaderDidFinishWithError(UPCRMLinkReader _linkReader, Exception error) { this.ContinueBuildPage(); }
/// <summary> /// Links the reader did finish with error. /// </summary> /// <param name="linkReader">The link reader.</param> /// <param name="error">The error.</param> public void LinkReaderDidFinishWithError(UPCRMLinkReader linkReader, Exception error) { this.crmQuery = null; this.TheDelegate.WebContentMetaDataFailedWithError(this, error); return; }
/// <summary> /// Links the reader did finish with error. /// </summary> /// <param name="linkReader">The link reader.</param> /// <param name="error">The error.</param> public void LinkReaderDidFinishWithError(UPCRMLinkReader linkReader, Exception error) { this.LinkReader = null; this.ContinueBuildDetailOrganizerPages0(); }
private bool ComputeNextReport() { if (this.ClientReports.Count <= this.nextClientReport) { this.BuildXml(); this.blockStart = false; return(true); } IConfigurationUnitStore configStore = ConfigurationUnitStore.DefaultStore; UPWebContentClientReport report = this.ClientReports[this.nextClientReport]; SearchAndList searchAndList = configStore.SearchAndListByName(report.ConfigName); FieldControl tmpFieldControl = searchAndList == null ? configStore.FieldControlByNameFromGroup("List", report.ConfigName) : configStore.FieldControlByNameFromGroup("List", searchAndList.FieldGroupName); if (tmpFieldControl == null) { this.nextClientReport++; return(this.ComputeNextReport()); } this.crmQuery = new UPContainerMetaInfo(tmpFieldControl); if (!string.IsNullOrEmpty(this.recordIdentification)) { int _linkId = this.linkId; if (report.ExplicitLinkId) { _linkId = report.LinkId; } if (string.IsNullOrEmpty(report.ParentLinkConfig)) { this.crmQuery.SetLinkRecordIdentification(this.recordIdentification, _linkId); } else if (report.ParentLinkConfig != "nolink") { string linkRecordIdentification = this.parentLinkDictionary.ValueOrDefault(report.ParentLinkConfig); if (linkRecordIdentification == null) { this.linkReader = new UPCRMLinkReader(this.recordIdentification, report.ParentLinkConfig, this); this.linkReader.Start(); return(true); } if (!string.IsNullOrEmpty(linkRecordIdentification)) { this.crmQuery.SetLinkRecordIdentification(linkRecordIdentification, _linkId); } } } if (!string.IsNullOrEmpty(searchAndList?.FilterName)) { UPConfigFilter filter = configStore.FilterByName(searchAndList.FilterName); filter = filter?.FilterByApplyingValueDictionaryDefaults(this.filterParameters, true); if (filter != null) { this.crmQuery.ApplyFilter(filter); } } this.crmQuery.Find(this.RequestOption, this); return(true); }
/// <summary> /// Links the reader did finish with error. /// </summary> /// <param name="_linkReader">The link reader.</param> /// <param name="error">The error.</param> public void LinkReaderDidFinishWithError(UPCRMLinkReader _linkReader, Exception error) { this.TheDelegate.CharacteristicsDidFailWithError(this, error); }