private void hashEstaticoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (dgv_Entidad.SelectedCells != null)
            {
                int pos = dgv_Entidad.CurrentRow.Index;

                long posForanea = buscarEntidadForanea(pos);

                if (posForanea != -1)
                {
                    foreach (Entidad en in entidades)
                    {
                        if (posForanea == en.direccion_Entidad)
                        {
                            if (en.direccion_Dato == -1)
                            {
                                MessageBox.Show("Contiene clave foranea, sin datos en la enidad", "Primero agrega registros");
                                return;
                            }
                        }
                    }
                }

                this.Hide();
                FormRegistro nuevoRegistro = new FormRegistro(this, fa.fileS, fa.nombreDelArchivo, entidades, pos, 3);
                nuevoRegistro.cambia += new FormRegistro.regresar(direccionIndice);
                nuevoRegistro.Show();
            }
            else
            {
                MessageBox.Show("Seleccione una entidad");
            }
        }
Exemple #2
0
        /*Boton para crear un nuevo registro, el cual generara un nuevo archivo con el nombre del ID*/
        private void nuevoRegistroToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (dgv_Entidad.SelectedCells != null)
            {
                int pos = dgv_Entidad.CurrentRow.Index;

                this.Hide();
                FormRegistro nuevoRegistro = new FormRegistro(this, fa.fileS, fa.nombreDelArchivo, entidades, pos);
                nuevoRegistro.cambia += new FormRegistro.regresar(direccionIndice);
                nuevoRegistro.Show();
            }
            else
            {
                MessageBox.Show("Seleccione una entidad");
            }
        }