/// <summary> /// Adds the link participant with record identification. /// </summary> /// <param name="recordIdentification">The record identification.</param> /// <param name="options">The options.</param> /// <returns></returns> public UPCRMLinkParticipant AddLinkParticipantWithRecordIdentification(string recordIdentification, Dictionary <string, object> options) { string name = UPConfigTableCaption.TableCaptionForRecordIdentification(recordIdentification, "Default"); UPCRMLinkParticipant linkParticipant = new UPCRMLinkParticipant(this.LinkParticipantsInfoAreaId, recordIdentification, name); linkParticipant.Options = options; this.AddLinkParticipant(linkParticipant); return(linkParticipant); }
/// <summary> /// Adds the link participant. /// </summary> /// <param name="participant">The participant.</param> public void AddLinkParticipant(UPCRMLinkParticipant participant) { participant.Context = this; if (this.mutableLinkParticipantArray == null) { this.mutableLinkParticipantArray = new List <UPCRMLinkParticipant>(); } this.mutableLinkParticipantArray.Add(participant); }
/// <summary> /// Adds the new link participant. /// </summary> /// <returns></returns> public UPCRMLinkParticipant AddNewLinkParticipant() { UPCRMLinkParticipant participant = new UPCRMLinkParticipant("link_" + this.NextKey()) { AcceptanceText = "0", RequirementText = "0", Context = this }; this.AddLinkParticipant(participant); return(participant); }
/// <summary> /// Searches the operation did finish with result. /// </summary> /// <param name="operation">The operation.</param> /// <param name="result">The result.</param> public override void SearchOperationDidFinishWithResult(Operation operation, UPCRMResult result) { if (this.crmQuery != null) { int count = result.RowCount; int infoAreaCount = result.MetaInfo.NumberOfResultInfoAreaMetaInfos(); for (int i = 0; i < count; i++) { UPCRMResultRow resultRow = (UPCRMResultRow)result.ResultRowAtIndex(i); for (int j = 1; j < infoAreaCount; j++) { string linkRecordIdentification = resultRow.RecordIdentificationAtIndex(j); if (linkRecordIdentification?.Length > 6) { UPCRMLinkParticipant linkParticipant = new UPCRMLinkParticipant(resultRow, j); this.AddLinkParticipant(linkParticipant); if (!string.IsNullOrEmpty(this.ProtectedLinkRecordIdentification) && this.ProtectedLinkRecordIdentification == linkParticipant.LinkRecordIdentification) { linkParticipant.MayNotBeDeleted = true; } break; } else { UPContainerInfoAreaMetaInfo iaMeta = result.MetaInfo.ResultInfoAreaMetaInfoAtIndex(j); UPCRMLinkReader _linkReader = new UPCRMLinkReader(resultRow.RootRecordIdentification, iaMeta.InfoAreaIdWithLink, null); string linkRecordId = _linkReader.RequestLinkRecordOffline(); if (!string.IsNullOrEmpty(linkRecordId) && UPCRMDataStore.DefaultStore.RecordExistsOffline(linkRecordId)) { UPCRMLinkParticipant linkParticipant = new UPCRMLinkParticipant(resultRow, linkRecordId); this.AddLinkParticipant(linkParticipant); break; } } } } this.Finished(null); } else { base.SearchOperationDidFinishWithResult(operation, result); } }