示例#1
0
        private void button_gestiones_Click(object sender, EventArgs e)
        {
            Form existe = Application.OpenForms.OfType <Form>().Where(pre => pre.Text.Contains(" " + dataGridView_comunidades.SelectedCells[2].Value.ToString())).SingleOrDefault <Form>();

            if (existe != null)
            {
                //existe.WindowState = FormWindowState.Maximized;
                existe.BringToFront();
            }
            else
            {
                Presentacion.ComunidadesForms.ContenedorComunidad nueva = new ComunidadesForms.ContenedorComunidad(dataGridView_comunidades.SelectedCells[2].Value.ToString(), (int)dataGridView_comunidades.SelectedCells[0].Value);
                nueva.Show();
            }
        }
示例#2
0
        private void dataGridView_comunidades_DoubleClick(object sender, EventArgs e)
        {
            String FechaBajaComunidad = (Persistencia.SentenciasSQL.select("SELECT FBaja FROM com_comunidades WHERE IdComunidad = " + dataGridView_comunidades.SelectedCells[0].Value.ToString())).Rows[0][0].ToString();

            //if (FechaBajaComunidad == "")
            //{

            Form existe = Application.OpenForms.OfType <Form>().Where(pre => pre.Text.Contains(" " + dataGridView_comunidades.SelectedCells[2].Value.ToString())).SingleOrDefault <Form>();

            if (existe != null)
            {
                //existe.WindowState = FormWindowState.Maximized;
                existe.BringToFront();
            }
            else
            {
                Presentacion.ComunidadesForms.ContenedorComunidad nueva = new ComunidadesForms.ContenedorComunidad(dataGridView_comunidades.SelectedCells[2].Value.ToString(), (int)dataGridView_comunidades.SelectedCells[0].Value);
                nueva.Show();
            }
            //}else {
            //    MessageBox.Show("Esa Comunidad esta dada de baja y no se puede entrar\n          Contacte con el Administrador");
            //}
        }