public static FrmUsuario Instance()
 {
     if (((frmInstance == null)
                 || (frmInstance.IsDisposed == true)))
     {
         frmInstance = new FrmUsuario();
     }
     frmInstance.BringToFront();
     return frmInstance;
 }
Esempio n. 2
0
        private void MenuItemOnClick(object sender, EventArgs e)
        {
            // Referenciamos el control que ha desencadenado el evento
            ToolStripMenuItem item = (ToolStripMenuItem)sender;

            if (item.ToString() == "Clientes")
            {
                FrmClientes llamar = null;

                llamar           = FrmClientes.Instance();
                llamar.MdiParent = this;
                llamar.Show();
            }
            else if (item.ToString() == "Proveedores")
            {
                FrmProveedores llamar = null;

                llamar           = FrmProveedores.Instance();
                llamar.MdiParent = this;
                llamar.Show();
            }
            else if (item.ToString() == "Usuario")
            {
                FrmUsuario llamar = null;

                llamar           = FrmUsuario.Instance();
                llamar.MdiParent = this;
                llamar.Show();
            }
            else if (item.ToString() == "Reportes Clientes")
            {
                FrmReporteCliente rep = new FrmReporteCliente();
                rep.ShowDialog();
            }
            else if (item.ToString() == "Reportes de Ventas")
            {
                FrmReporteFactura rep = new FrmReporteFactura();
                rep.ShowDialog();
            }
            else if (item.ToString() == "Reportes Productos")
            {
                FrmReporteProducto rep = new FrmReporteProducto();
                rep.ShowDialog();
            }
            else if (item.ToString() == "Reportes Usuario")
            {
                FrmReporteUsuario rep = new FrmReporteUsuario();
                rep.ShowDialog();
            }
            else if (item.ToString() == "Productos")
            {
                FrmProductos llamar = null;

                llamar           = FrmProductos.Instance();
                llamar.MdiParent = this;
                llamar.Show();
            }
            else if (item.ToString() == "Facturar")
            {
                FrmFacturar llamar = null;
                string      u      = toolStripStatusLabel1.Text;
                llamar           = FrmFacturar.Instance();
                llamar           = new FrmFacturar(u);
                llamar.MdiParent = this;
                llamar.Show();
            }
            else if (item.ToString() == "Inventario ")
            {
                FrmInventario llamar = null;

                llamar           = FrmInventario.Instance();
                llamar           = new FrmInventario(usu);
                llamar.MdiParent = this;
                llamar.Show();
            }
            else if (item.ToString() == "Ayuda")
            {
                BtnAyuda.PerformClick();
            }
            else if (item.ToString() == "Salir")
            {
                toolStripButton4.PerformClick();
            }
        }