private void ButEliminarCorr_Click(object sender, EventArgs e) { Corredores corr = new Corredores(); if (tbxEliminar.Text.ToString() != string.Empty) { if (corr.CompararID(tbxEliminar.Text) == true) { DataSet dsAgregar; Gestion g = new Gestion(); dsAgregar = new DataSet(); SqlCommand Comando = new SqlCommand(); g.ArmarParametrosCorredoresEliminar(ref Comando, tbxEliminar.Text); AccesoDatos ad = new AccesoDatos(); ad.EjecutarProcedimientoAlmacenado(Comando, "spEliminarCorredor"); MessageBox.Show("Corredor Eliminado"); } else { MessageBox.Show("No existe ese ID."); } } else { MessageBox.Show("Debe incertar un Id de corredor a eliminar"); } }
private void ButModificarEqui_Click(object sender, EventArgs e) { Corredores corr = new Corredores(); if (tbxID.Text.ToString() == string.Empty || tbxNombre.Text.ToString() == string.Empty || tbxCentEqui.Text.ToString() == string.Empty || tbxJefEqui.Text.ToString() == string.Empty || tbxJefTecEqui.Text.ToString() == string.Empty || tbxAñoEqui.Text.ToString() == string.Empty) { MessageBox.Show("Debe llenar los Campos para modificar un registro"); } else { if (corr.CompararID(tbxID.Text) == true) { DataSet dsAgregar; Gestion g = new Gestion(); dsAgregar = new DataSet(); SqlCommand Comando = new SqlCommand(); g.ArmarParametrosEquipos(ref Comando, tbxNombre.Text, tbxCentEqui.Text, tbxJefEqui.Text, tbxJefTecEqui.Text, tbxAñoEqui.Text, tbxID.Text); AccesoDatos ad = new AccesoDatos(); ad.EjecutarProcedimientoAlmacenado(Comando, "spActualizarEquipo"); MessageBox.Show("Equipo Modificado. Se requiere refrescar para ver los datos modificados."); } else { MessageBox.Show("No existe ese ID."); } } }
private void ButBuscarDatosID_Click(object sender, EventArgs e) { Corredores corr = new Corredores(); if (tbxID.Text.ToString() != string.Empty) { if (corr.CompararID(tbxID.Text) == true) { AsignarTextBoxes(tbxID.Text); } else { MessageBox.Show("No existe ese ID."); } } else { MessageBox.Show("Debe incertar un Id de corredor a Modificar"); } }