Ejemplo n.º 1
0
        /// <summary>
        /// Searches the operation did finish with result.
        /// </summary>
        /// <param name="operation">The operation.</param>
        /// <param name="result">The result.</param>
        public virtual void SearchOperationDidFinishWithResult(Operation operation, UPCRMResult result)
        {
            int count = result.RowCount;

            for (int i = 0; i < count; i++)
            {
                UPCRMResultRow resultRow = (UPCRMResultRow)result.ResultRowAtIndex(i);
                var            rowValues = resultRow.ValuesWithFunctions();

                string rep   = (string)rowValues.ValueOrDefault(Constants.UPRepAcceptanceFunctionName_RepId);
                int    repId = rep.ToInt();

                if (repId > 0)
                {
                    rep = StringExtensions.NineDigitStringFromRep(Convert.ToInt32(rep));

                    var repParticipant = this.ParticipantWithKey(rep);

                    if (repParticipant is UPCRMRepParticipant)
                    {
                        string acceptance = (string)rowValues[Constants.UPRepAcceptanceFunctionName_Acceptance];
                        ((UPCRMRepParticipant)repParticipant).AcceptanceFromRecordIdentification(acceptance, resultRow.RootRecordIdentification);
                    }
                }
            }

            this.repAcceptanceCrmQuery = null;
            this.Loaded();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UPCRMLinkParticipant"/> class.
        /// </summary>
        /// <param name="resultRow">The result row.</param>
        /// <param name="index">The index.</param>
        public UPCRMLinkParticipant(UPCRMResultRow resultRow, int index)
            : base(resultRow.RootRecordIdentification)
        {
            this.RecordIdentification     = resultRow.RootRecordIdentification;
            this.LinkRecordIdentification = resultRow.RecordIdentificationAtIndex(index);
            this.IsNewParticipant         = false;

            var functionNameValues = resultRow.ValuesWithFunctions();

            this.RequirementText        = (string)functionNameValues["Requirement"];
            this.AcceptanceText         = (string)functionNameValues["Acceptance"];
            this.OriginalAcceptanceText = this.AcceptanceText;

            UPContainerInfoAreaMetaInfo infoAreaMetaInfo = resultRow.Result.MetaInfo.ResultInfoAreaMetaInfoAtIndex(index);

            this._name = TableCaptionForInfoAreaIdResultRow(this.LinkRecordIdentification.InfoAreaId(), resultRow);

            if (string.IsNullOrEmpty(this._name))
            {
                this._name = string.Empty;
                foreach (UPContainerFieldMetaInfo field in infoAreaMetaInfo.Fields)
                {
                    string val = resultRow.ValueForField(field);
                    if (!string.IsNullOrEmpty(val))
                    {
                        this._name = this._name.Length > 0 ? $"{this._name} {val}" : val;
                    }
                }
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UPCRMLinkParticipant"/> class.
        /// </summary>
        /// <param name="resultRow">The result row.</param>
        /// <param name="linkRecordIdentification">The link record identification.</param>
        public UPCRMLinkParticipant(UPCRMResultRow resultRow, string linkRecordIdentification)
            : base(resultRow.RootRecordIdentification)
        {
            this.RecordIdentification      = resultRow.RootRecordIdentification;
            this.LinkRecordIdentification  = linkRecordIdentification;
            this.IsOfflineEmptyParticipant = true;

            var functionNameValues = resultRow.ValuesWithFunctions();

            this.RequirementText        = (string)functionNameValues["Requirement"];
            this.AcceptanceText         = (string)functionNameValues["Acceptance"];
            this.OriginalAcceptanceText = this.AcceptanceText;

            this._name = LocalizedString.TextOfflineNotAvailable;
        }