Пример #1
0
        //Boton para modificar un administrador
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            String valor = dataGridView1.CurrentRow.Cells[0].Value.ToString();


            AddAdministrador newMDIChild = new AddAdministrador();

            // Set the Parent Form of the Child window.
            newMDIChild.MdiParent = SuperAdmin.ActiveForm;
            // Display the new form.
            newMDIChild.update = valor;
            newMDIChild.Show();
            Close();
        }
Пример #2
0
        private void altaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //Compruebo si el formulario que lista los administradores esta abierto
            //en caso afirmativo lo cierro para evitar duplicados
            Form frm = Application.OpenForms.Cast <Form>().FirstOrDefault(x => x is AdminMantenimiento);

            if (frm != null)
            {
                frm.Close();
            }
            AddAdministrador newMDIChild = new AddAdministrador();

            // Set the Parent Form of the Child window.
            newMDIChild.MdiParent = this;
            // Display the new form.
            newMDIChild.Show();
        }