Example #1
0
        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.");
                }
            }
        }
Example #2
0
        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");
            }
        }
Example #3
0
        private void ButCorredores_Click(object sender, EventArgs e)
        {
            Corredores Corr = new Corredores();

            this.Hide();
            Corr.ShowDialog();
            if (Corr.DialogResult == DialogResult.Yes)
            {
                this.Show();
            }
        }
Example #4
0
        public void AsignarTextBoxes(string id)
        {
            Corredores corr = new Corredores();
            Gestion    gp   = new Gestion();
            DataTable  dtCorredores;

            dtCorredores = gp.ObtenerTodosLosCorredores();
            corr.DGVCorredor.DataSource = dtCorredores;
            for (int i = 0; i < corr.DGVCorredor.RowCount - 1; i++)
            {
                if (corr.DGVCorredor.Rows[i].Cells["ID_Corredor"].Value.ToString() == id)
                {
                    tbxNombre.Text   = corr.DGVCorredor.Rows[i].Cells["Nombre_Corredor"].Value.ToString();
                    tbxApellido.Text = corr.DGVCorredor.Rows[i].Cells["Apellido_Corredor"].Value.ToString();
                    tbxPais.Text     = corr.DGVCorredor.Rows[i].Cells["Pais_Corredor"].Value.ToString();
                    tbxLugar.Text    = corr.DGVCorredor.Rows[i].Cells["LugarN_Corredor"].Value.ToString();
                    tbxFecha.Text    = Convert.ToDateTime(corr.DGVCorredor.Rows[i].Cells["FechaN_Corredor"].Value).ToString("dd-MM-yyyy");
                }
            }
        }
Example #5
0
        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");
            }
        }