Esempio n. 1
0
        protected void gridDetalle_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (!Voto.EsVotoRegistrado(Convert.ToInt32(Session["UserId"])))
            {
                try
                {
                    if (e.CommandName == "VotarDetalle")
                    {
                        CVoto objetoVoto = new CVoto();
                        objetoVoto.candidatoID = Convert.ToInt32(e.CommandArgument.ToString());
                        objetoVoto.usuarioID   = Convert.ToInt32(Session["UserId"]);

                        if (Voto.InsertarVoto(objetoVoto) > 0)
                        {
                            Session.Remove("UserName");
                            Session.Remove("NombreCompletoUsuario");
                            Session.Remove("ClaveUsuario");
                            Response.Redirect("Mensaje.aspx");
                        }
                    }
                }
                catch (Exception ex)
                {
                    messageBox.ShowMessage(ex.Message + ex.StackTrace);
                }
            }
            else
            {
                messageBox.ShowMessage("Voto registrado");
            }
        }
Esempio n. 2
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (Voto.ConfigurarEstatusEleccion("EstatusVotacion", txtEstatus.Text) > 0)
     {
         messageBox.ShowMessage("Elección Configurada");
         txtEstatus.Text = "";
     }
 }
Esempio n. 3
0
 protected void btnRestablecer_Click(object sender, EventArgs e)
 {
     if (Voto.RestablecerVoto(txtCedula.Text) > 0)
     {
         messageBox.ShowMessage("Voto restablecido");
         txtCedula.Text = "";
     }
 }
Esempio n. 4
0
 private void CargarResultado()
 {
     try
     {
         DataSet ds = Voto.ObtenerResultados();
         this.gridDetalle.DataSource = ds.Tables[0];
         this.gridDetalle.DataBind();
     }
     catch (Exception ex)
     {
         messageBox.ShowMessage(ex.Message + ex.StackTrace);
     }
 }
Esempio n. 5
0
 protected new void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (!Voto.EsVotoRegistrado(Convert.ToInt32(Session["UserId"])))
         {
             CargarCandidatos();
         }
         else
         {
             Response.Redirect("Mensaje.aspx");
         }
     }
 }