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); } } }
/// <summary> /// 到数据库核实id是否存在 /// </summary> /// <param name="id"></param> /// <returns></returns> bool CheckID(string id) { var vote = AppDomain.FindVoterById(id); return(vote != null); }