Exemple #1
0
        /// <summary>
        ///     Loads the election parameters
        /// </summary>
        /// <param name="strConnection">The STR connection.</param>
        /// <param name="machineAssignmentId">The machine assignment id.</param>
        /// <externalUnit/>
        /// <revision revisor="dev16" date="1/11/2009" version="1.0.0.0">
        ///     Member Created
        /// </revision>
        private void LoadElecParams(
            string strConnection,
            int machineAssignmentId)
        {
            BallotEntrySet elecParam = new BallotEntrySet(typeof(StpElecParam));

            // pass in the machineAssignmentId to the proc if we got one
            if (machineAssignmentId != 0)
            {
                elecParam.Load(strConnection, machineAssignmentId);
            }
            else
            {
                elecParam.Load(strConnection);
            }

            for (int i = 0; i < elecParam.Count; i = i + 1)
            {
                ElectionParameter parameter = new ElectionParameter();
                parameter.Name = elecParam.GetValueStr(
                    i, StpElecParam.ParamName);
                parameter.Value = elecParam.GetValueStr(
                    i, StpElecParam.ParamValue);
                this.electionParameters.Add(parameter);
            }
        }
        /// <summary>
        ///     Initializes a new instance of the <see cref="PaperBallotElectionInfo"/> class.
        /// </summary>
        /// <externalUnit/>
        /// <revision revisor="dev11" date="4/2/2009" version="1.0.9.1701">
        ///     Member Created
        /// </revision>
        public PaperBallotElectionInfo(string strConnection)
        {
            BallotEntrySet entrySet = new BallotEntrySet(typeof(StpElecParam));

            entrySet.Load(strConnection, DefaultMachineId);

            int idx = entrySet.FindIndex(
                StpElecParam.ParamName, ParamElectionName);

            if (idx >= 0)
            {
                this.electionName = entrySet.GetValueStr(
                    idx, StpElecParam.ParamValue);
            }
            else
            {
                // no election name found, use empty string
                this.electionName = string.Empty;
            }

            idx = entrySet.FindIndex(StpElecParam.ParamName, ParamElectionDate);
            try
            {
                this.electionDate = entrySet.GetValueDate(
                    idx, StpElecParam.ParamValue);
            }
            catch
            {
                // do nothing and let election date be null
            }
        }
Exemple #3
0
        /// <summary>
        ///     Loads the machine parameters
        /// </summary>
        /// <param name="strConnection">The STR connection.</param>
        /// <externalUnit/>
        /// <revision revisor="dev11" date="12/23/2008" version="1.0.0.0">
        ///     Member Created
        /// </revision>
        private void LoadMachParams(string strConnection)
        {
            BallotEntrySet machParm = new BallotEntrySet(typeof(StpMachParm));

            machParm.Load(strConnection);

            for (int i = 0; i < machParm.Count; i = i + 1)
            {
                ParameterFile file = new ParameterFile();
                file.Name = machParm.GetValueStr(i, StpMachParm.ParamName);
                this.machineParams.ParameterFiles.Add(file);
            }
        }
Exemple #4
0
        /// <summary>
        ///     Loads the machine options
        /// </summary>
        /// <param name="strConnection">The STR connection.</param>
        /// <externalUnit/>
        /// <revision revisor="dev11" date="12/23/2008" version="1.0.0.0">
        ///     Member Created
        /// </revision>
        private void LoadMachOptn(string strConnection)
        {
            BallotEntrySet machOptn = new BallotEntrySet(typeof(StpMachOptn));

            machOptn.Load(strConnection);

            for (int i = 0; i < machOptn.Count; i = i + 1)
            {
                MachineOption option = new MachineOption();
                option.Name  = machOptn.GetValueStr(i, StpMachOptn.OptionName);
                option.Value = machOptn.GetValueStr(i, StpMachOptn.OptionValue);
                this.machineOptions.Add(option);
            }
        }