예제 #1
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            if (txtElimPlac.Text == "")
            {
                MessageBox.Show("Debe Completar la Informacion");
            }
            else
            {
                clVehiculo objvehiculo = new clVehiculo();
                objvehiculo.Placa = txtElimPlac.Text;

                string placa = objvehiculo.mtdVerBuscPlaca();

                if (placa == txtElimPlac.Text)
                {
                    //DataTable dtBuscVehiculo = objvehiculo.mtdBuscarVehiculo();
                    //dgvVehiculo.DataSource = dtBuscVehiculo;

                    txtElimPlac.Clear();
                    txtElimPlac.Focus();
                }
                else
                {
                    MessageBox.Show("Revise que la Placa este Escrita Correctamente");
                }
            }
        }
예제 #2
0
        private void btnEliminar_Click(object sender, EventArgs e)
        {
            if (txtElimPlac.Text == "")
            {
                MessageBox.Show("Debe Completar la Informacion");
            }
            else
            {
                clVehiculo objvehiculo = new clVehiculo();
                objvehiculo.Placa = txtElimPlac.Text;

                string placa = objvehiculo.mtdVerBuscPlaca();

                if (placa == txtElimPlac.Text)
                {
                    int retorno = objvehiculo.mtdEliminarVehiculo();

                    if (retorno > 0)
                    {
                        MessageBox.Show("Eliminacion Completada");
                        txtElimPlac.Clear();
                        txtElimPlac.Focus();

                        frmVehiculo_Load(null, null);
                    }
                    else
                    {
                        MessageBox.Show("Error al Eliminar");
                    }
                }
                else
                {
                    MessageBox.Show("Revise que la Placa este Escrita Correctamente");
                }
            }
        }