Esempio n. 1
0
        private void DgContratos_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (documentacion)
            {
                GenerarDocumento form3 = new GenerarDocumento(new Contrato(Convert.ToInt32(dgContratos.Rows[e.RowIndex].Cells["id"].Value)));
                if (form3.IsAccessible)
                {
                    form3.Size       = new Size(Screen.PrimaryScreen.Bounds.Width - 300, Screen.PrimaryScreen.Bounds.Height - 100);
                    form3.TopLevel   = false;
                    form3.AutoScroll = true;

                    Data.f1.pPanelBig.Controls.Add(form3);
                    form3.Show();
                    this.Close();
                }
            }
            else
            {
                CrearContrato crearContrato = new CrearContrato(new Contrato(Convert.ToInt32(dgContratos.Rows[e.RowIndex].Cells["id"].Value)));
                crearContrato.Size       = new Size(Screen.PrimaryScreen.Bounds.Width - 300, Screen.PrimaryScreen.Bounds.Height - 100);
                crearContrato.TopLevel   = false;
                crearContrato.AutoScroll = true;

                Data.f1.pPanelBig.Controls.Add(crearContrato);

                crearContrato.Show();
                this.Close();
            }
        }
Esempio n. 2
0
        private void DgFichaMantenimiento_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            switch (op)
            {
            case 1:

                CrearFichaMantenimiento fichaMantenimiento = new CrearFichaMantenimiento(new FichaMantenimiento(Convert.ToInt32(dgFichaMantenimiento[4, e.RowIndex].Value)));

                fichaMantenimiento.TopLevel   = false;
                fichaMantenimiento.AutoScroll = true;

                Data.f1.pPanelBig.Controls.Add(fichaMantenimiento);
                fichaMantenimiento.Show();

                this.Close();
                break;

            case 2:

                GenerarDocumento generarDocumento = new GenerarDocumento(new FichaMantenimiento(Convert.ToInt32(dgFichaMantenimiento[4, e.RowIndex].Value)));
                generarDocumento.TopLevel   = false;
                generarDocumento.AutoScroll = true;

                Data.f1.pPanelBig.Controls.Add(generarDocumento);
                generarDocumento.Show();
                break;
            }
        }