コード例 #1
0
        protected void btnAnadirParticipante_Click(object sender, EventArgs e)
        {
            if (btnAnadirParticipante.Text == "Actualizar")
            {
                p.IdParticipante = Convert.ToInt32(txId.Text);
            }

            try
            {
                p.Nombre      = txNombre.Text;
                p.Apellidos   = txApellidos.Text;
                p.Dorsal      = Convert.ToInt32(txDorsal.Text);
                p.IdCategoria = Convert.ToInt32(cbCategorias.SelectedValue);

                logica.GuardaOActualizaParticipante(p);
            }
            catch (Exception)
            {               }

            gvParticipantes.DataSource = logica.TablaParticipantes();
            gvParticipantes.DataBind();

            txNombre.Text    = "";
            txApellidos.Text = "";
            txDorsal.Text    = "";
            CargaComboCategorias();

            Response.Redirect("participantes.aspx");
        }