Ejemplo n.º 1
0
        private void tbtnEliminar_Click(object sender, EventArgs e)
        {
            if (txtId.Text != "")
            {
                nRegion objRegion = new nRegion();
                objRegion.Idregion = Convert.ToInt32(txtId.Text);
                //objRegion.eliminarRegion();
                MessageBox.Show("Región eliminada con éxito");
                cargaBotonEliminar();
            }
            else
            {
                MessageBox.Show("Debe ingresar una ID a eliminar");
            }

            RegionDGV(dgvRegion);
        }
Ejemplo n.º 2
0
        private void tbtnActualizar_Click(object sender, EventArgs e)
        {
            if (txtId.Text != "" && txtNombre.Text != "")
            {
                nRegion objRegion = new nRegion();
                objRegion.Idregion = Convert.ToInt32(txtId.Text);
                objRegion.Nombre   = txtNombre.Text;
                //objRegion.editarRegion();
                MessageBox.Show("Región actualizada con éxito");
                cargaBotonActualizar();
            }
            else
            {
                MessageBox.Show("No deben haber campos vacíos");
            }

            RegionDGV(dgvRegion);
        }