Example #1
0
        private void FrmMain_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (MessageBox.Show("¿Seguro que desea salir?", "Continuar", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                FrmLogin frm_login = new FrmLogin(true);
                frm_login.ShowDialog();

                if (Login.superUsuario)
                {
                    FrmCorteSalida abrir = new FrmCorteSalida();
                    abrir.ShowDialog();

                    if (Login.cerrarSesion)
                    {
                        this.Hide();
                        hilo.Suspend();
                        frm_login = new FrmLogin(false);
                        frm_login.ShowDialog();
                        e.Cancel = false;
                    }
                    e.Cancel = true;
                }

                else
                {
                    e.Cancel = false;
                }
            }

            else
            {
                e.Cancel = true;
            }
        }
Example #2
0
        private void corteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("¿Seguro que desea salir?", "Continuar", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                FrmLogin frm_login = new FrmLogin(true);

                FrmCorteSalida abrir = new FrmCorteSalida();
                abrir.ShowDialog();

                if (Login.cerrarSesion)
                {
                    FrmObservacion observacion = new FrmObservacion(2);
                    observacion.ShowDialog();
                    this.Hide();
                    hilo.Suspend();
                    frm_login = new FrmLogin(false);
                    frm_login.ShowDialog();
                }
            }
        }
Example #3
0
        private void cerrarCajaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmCorteSalida abrir = new FrmCorteSalida();

            abrir.ShowDialog();
        }