Beispiel #1
0
        /// <summary>
        ///     Removes the action.
        /// </summary>
        /// <param name="action">The action.</param>
        /// <externalUnit/>
        /// <revision revisor="dev01" date="11/12/2009" version="1.1.2.21">
        ///     Member Created
        /// </revision>
        public void RemoveAction(VoterRecordStep action)
        {
            bool found = false;

            for (int i = 0; i < this.VoterRecordSessions.Count &&
                 found != true; i++)
            {
                ActionSession session = this.VoterRecordSessions[i];
                for (int j = 0; j < session.VoterRecordActionSets.Count &&
                     found != true; j++)
                {
                    VoterRecordActionSet actionSet =
                        session.VoterRecordActionSets[j];

                    if (actionSet.VoterRecordActions.Remove(action))
                    {
                        found = true;
                    }
                }
            }

            if (found)
            {
                this.Clean();
            }
        }
        /// <summary>
        ///     Adds the action.
        /// </summary>
        /// <param name="contestIdParameter">The contest id parameter.</param>
        /// <param name="action">The action.</param>
        /// <param name="actionType">Type action</param>
        /// <externalUnit/>
        /// <revision revisor="dev01" date="10/9/2009" version="1.1.1.9">
        ///     Member Created
        /// </revision>
        /// <revision revisor="dev01" date="11/12/2009" version="1.1.2.21">
        ///     Modified search Paradigm
        /// </revision>
        public void AddAction(
            int contestIdParameter,
            VoterRecordStep action,
            OutstackConditionId actionType)
        {
            var actionSet = new VoterRecordActionSet
            {
                Type               = actionType,
                ContestId          = contestIdParameter,
                VoterRecordActions =
                    new VoterRecordActionList(),
            };

            if (this.VoterRecordActionSets.Exists(d => d.Type == actionType &&
                                                  d.ContestId == contestIdParameter))
            {
                actionSet =
                    this.VoterRecordActionSets.Find(
                        d =>
                        d.Type == actionType &&
                        d.ContestId == contestIdParameter);
            }
            else
            {
                this.VoterRecordActionSets.Add(actionSet);
            }

            actionSet.VoterRecordActions.Add(action);
        }
Beispiel #3
0
        /// <summary>
        ///     Removes the action set.
        /// </summary>
        /// <param name="set">The ActionSet.</param>
        /// <externalUnit/>
        /// <revision revisor="dev01" date="11/12/2009" version="1.1.2.21">
        ///     Member Created
        /// </revision>
        public void RemoveActionSet(VoterRecordActionSet set)
        {
            bool found = false;

            for (int i = 0; i < this.VoterRecordSessions.Count &&
                 found != true; i++)
            {
                ActionSession session = this.VoterRecordSessions[i];
                if (session.VoterRecordActionSets.Remove(set))
                {
                    found = true;
                }
            }

            if (found)
            {
                this.Clean();
            }
        }