/// <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 } }