Exemple #1
0
        private void btnAgregar_Click(object sender, EventArgs e)
        {
            CategoriaDetalleIU detalle = new CategoriaDetalleIU();

            detalle.StartPosition     = FormStartPosition.CenterScreen;
            detalle.chkEstado.Checked = true;
            detalle.operacion         = (byte)MisConstantes.OPERACION.Insercion;

            DialogResult rpta = detalle.ShowDialog();

            if (rpta == DialogResult.OK)
            {
                mostrarDatos();
            }
        }
Exemple #2
0
        private void btnModificar_Click(object sender, EventArgs e)
        {
            if (dataGridView1.SelectedRows.Count > 0)
            {
                CategoriaDetalleIU detalle = new CategoriaDetalleIU();

                detalle.StartPosition = FormStartPosition.CenterParent;
                detalle.operacion     = (byte)MisConstantes.OPERACION.Modificacion;

                detalle.lblID.Text          = dataGridView1.CurrentRow.Cells["ID"].Value.ToString();
                detalle.txtNombre.Text      = dataGridView1.CurrentRow.Cells["Nombre"].Value.ToString();
                detalle.txtDescripcion.Text = dataGridView1.CurrentRow.Cells["Descripcion"].Value.ToString();
                detalle.chkEstado.Checked   = chkEstado1.Checked;

                DialogResult rpta = detalle.ShowDialog();

                if (rpta == DialogResult.OK)
                {
                    mostrarDatos();
                }
            }
        }