public void inserir(voto vot)
 {
     using (eleicoesEntities db = new eleicoesEntities())
     {
         db.votos.Add(vot);
         db.SaveChanges();
     }
 }
        public List <candidato> selecionarLista(string numCand)
        {
            List <candidato> lista = null;

            using (eleicoesEntities db = new eleicoesEntities())
            {
                lista = (from cand in db.candidato where cand.numeroeleitoral_candidato.Equals(numCand) select cand).ToList();
            }
            return(lista);
        }
        public candidato selecionarPR(string numCand)
        {
            candidato can = null;

            using (eleicoesEntities db = new eleicoesEntities())
            {
                can = (from cand in db.candidato where cand.numeroeleitoral_candidato.Equals(numCand) && cand.codigo_cargo == 5 select cand).FirstOrDefault();
            }
            return(can);
        }
        public candidato selecionar(string numCand)
        {
            candidato cand = null;

            using (eleicoesEntities db = new eleicoesEntities())
            {
                cand = (from can in db.candidatoes where can.numeroeleitoral_candidato == numCand select can).FirstOrDefault();
            }
            return(cand);
        }