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

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

            DialogResult rpta = detalle.ShowDialog();

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

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

                detalle.txtID.Text        = dataGridView1.CurrentRow.Cells["ID"].Value.ToString();
                detalle.txtNombres.Text   = dataGridView1.CurrentRow.Cells["Nombres"].Value.ToString();
                detalle.txtApellidos.Text = dataGridView1.CurrentRow.Cells["Apellidos"].Value.ToString();
                detalle.txtUsuario.Text   = dataGridView1.CurrentRow.Cells["Usuario"].Value.ToString();
                detalle.txtContra.Text    = dataGridView1.CurrentRow.Cells["Contraseña"].Value.ToString();
                detalle.txtEstado.Checked = checkBox1.Checked;

                DialogResult rpta = detalle.ShowDialog();

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