protected void btnBuscarJ_Click(object sender, EventArgs e) { //constructor de la clase//02012018 adoJugador cljg = new adoJugador("", "", "", "", "", 0, 0); if (cljg.consultar(int.Parse(TxtCedula.Text))) { lblCedulaJ.Text = cljg.Cedula.ToString(); lblNombreJ.Text = cljg.Nombre; lblTelefono.Text = cljg.Telefono.ToString(); lblEmail.Text = cljg.Email; txtAviso.Text = "Jugador encontrado"; } else { txtAviso.Text = "No existe ese jugador"; lblCedulaJ.Text = ""; lblNombreJ.Text = ""; lblTelefono.Text = ""; lblEmail.Text = ""; lblEquipoJ.Text = ""; lblNacionalidad.Text = ""; lblstatus.Text = ""; } }
protected void btnNuevo_Click(object sender, EventArgs e) { //control de botones para el ingreso de datos-Svasco_01032018 if (btnNuevo.Text == "Nuevo") { ControlsLimpiar(); ControlsEdicion(); btnmodificar.Text = "Guardar"; } else if (btnNuevo.Text == "Guardar") { try { adoJugador jugador = new adoJugador("", "", "", "", "", 0, 0); if (jugador.consultar(int.Parse(txtcedula.Text.Trim()))) { jugador.Cedula = int.Parse(txtcedula.Text); jugador.Nombre = txtNombre.Text; jugador.Email = txtEmail.Text; jugador.Telefono = int.Parse(txtTelefono.Text); jugador.Direccion = txtNacionalidad.Text; jugador.Codjugador = txtcedula.Text; jugador.actualizar(); ControlsTerminada(); lblAviso.Text = "Registro Actualizado"; btnNuevo.Text = "Nuevo"; } else { jugador.Cedula = int.Parse(txtcedula.Text); jugador.Nombre = txtNombre.Text; jugador.Email = txtEmail.Text; jugador.Telefono = int.Parse(txtTelefono.Text); jugador.Direccion = txtNacionalidad.Text; jugador.Codjugador = txtcedula.Text; jugador.agregar(); ControlsTerminada(); lblAviso.Text = "Nuevo Registro Guardado"; btnNuevo.Text = "Nuevo"; } } catch { lblAviso.Text = "No dejar espacios en blanco"; } } }