Exemplo n.º 1
0
 public void GiveUp(string id)
 {
     if (AppDomain.CurrentCandidate != null)
     {
         if (AppDomain.CurrentCandidate.Voters == null)
         {
             AppDomain.CurrentCandidate.Voters = new List <Models.Voter>();
         }
         var voter = AppDomain.FindVoterById(id);
         if (voter != null)
         {
             voter.Score = 0;
             AppDomain.CurrentCandidate.Voters.Add(voter);
         }
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// 到数据库核实id是否存在
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        bool CheckID(string id)
        {
            var vote = AppDomain.FindVoterById(id);

            return(vote != null);
        }