/// <summary>
 /// The CRM participants did finish with result.
 /// </summary>
 /// <param name="recordParticipants">The record participants.</param>
 /// <param name="result">The result.</param>
 public void CrmParticipantsDidFinishWithResult(UPCRMParticipants recordParticipants, object result)
 {
     this.Group           = this.CreateGroup();
     this.ControllerState = GroupModelControllerState.Finished;
     if (this.signalFinished)
     {
         this.Delegate.GroupModelControllerFinished(this);
     }
 }
        /// <summary>
        /// The CRM participants did fail with error.
        /// </summary>
        /// <param name="recordParticipants">The record participants.</param>
        /// <param name="error">The error.</param>
        public void CrmParticipantsDidFailWithError(UPCRMParticipants recordParticipants, Exception error)
        {
            this.ControllerState = GroupModelControllerState.Error;
            this.Error           = error;
            this.Group           = null;

            if (this.signalFinished)
            {
                this.Delegate.GroupModelControllerFinished(this);
            }
        }
Exemple #3
0
        /// <summary>
        /// Adds the value for record identifier.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <param name="recordId">The record identifier.</param>
        /// <returns>0 if success, else error number</returns>
        public int AddValueForRecordId(string value, string recordId)
        {
            DatabaseStatement statement;
            int ret = 0;

            if (this.InsertStatement == null)
            {
                statement = new DatabaseStatement(this.Database);
                if (!statement.Prepare(this.InsertStatementSql))
                {
                    return(-1);
                }

                this.InsertStatement = statement;
            }
            else
            {
                statement = this.InsertStatement;
            }

            UPCRMParticipants          participantFormatter = new UPCRMParticipants(value);
            List <UPCRMRepParticipant> participants         = participantFormatter.RepParticipants;
            int participantCount = 0;

            foreach (UPCRMRepParticipant participant in participants)
            {
                statement.Reset();
                statement.Bind(1, recordId);
                statement.Bind(2, participantCount++);
                statement.Bind(3, participant.RepId);
                statement.Bind(4, participant.RepGroupId);
                statement.Bind(5, participant.RequirementText);
                ret = statement.Execute();
                if (ret != 0)
                {
                    break;
                }
            }

            return(ret);
        }