private void togglePanelMain(string panelName) { this.limpiarControles(); switch (panelName) { case "compras": if (uCCompras == null) { this.uCCompras = new Admeli.Compras.UCCompras(this.formPrincipal); this.formPrincipal.panelMain.Controls.Add(uCCompras); this.uCCompras.Dock = System.Windows.Forms.DockStyle.Fill; this.uCCompras.Location = new System.Drawing.Point(0, 0); this.uCCompras.Name = "uCCompras"; this.uCCompras.Size = new System.Drawing.Size(250, 776); this.uCCompras.TabIndex = 0; } else { this.formPrincipal.panelMain.Controls.Add(uCCompras); this.uCCompras.reLoad(); } this.formPrincipal.lblTitlePage.Text = "Compra - Compras"; break; case "cuentaPagar": if (uCCuentaPagar == null) { this.uCCuentaPagar = new Admeli.Compras.UCCuentaPagar(this.formPrincipal); this.formPrincipal.panelMain.Controls.Add(uCCuentaPagar); this.uCCuentaPagar.Dock = System.Windows.Forms.DockStyle.Fill; this.uCCuentaPagar.Location = new System.Drawing.Point(0, 0); this.uCCuentaPagar.Name = "uCCuentaPagar"; this.uCCuentaPagar.Size = new System.Drawing.Size(250, 776); this.uCCuentaPagar.TabIndex = 0; } else { this.formPrincipal.panelMain.Controls.Add(uCCuentaPagar); this.uCCuentaPagar.reLoad(); } this.formPrincipal.lblTitlePage.Text = "Compra - Cuentas a pagar"; break; case "ordenCompraProveedor": if (uCOrdenCompraProveedor == null) { this.uCOrdenCompraProveedor = new Admeli.Compras.UCOrdenCompraProveedor(this.formPrincipal); this.formPrincipal.panelMain.Controls.Add(uCOrdenCompraProveedor); this.uCOrdenCompraProveedor.Dock = System.Windows.Forms.DockStyle.Fill; this.uCOrdenCompraProveedor.Location = new System.Drawing.Point(0, 0); this.uCOrdenCompraProveedor.Name = "uCOrdenCompraProveedor"; this.uCOrdenCompraProveedor.Size = new System.Drawing.Size(250, 776); this.uCOrdenCompraProveedor.TabIndex = 0; } else { this.formPrincipal.panelMain.Controls.Add(uCOrdenCompraProveedor); this.uCOrdenCompraProveedor.reLoad(); } this.formPrincipal.lblTitlePage.Text = "Compra - Orden de compra proveedor"; break; case "proveedores": if (uCProveedores == null) { this.uCProveedores = new Admeli.Compras.UCProveedores(this.formPrincipal); this.formPrincipal.panelMain.Controls.Add(uCProveedores); this.uCProveedores.Dock = System.Windows.Forms.DockStyle.Fill; this.uCProveedores.Location = new System.Drawing.Point(0, 0); this.uCProveedores.Name = "uCProveedores"; this.uCProveedores.Size = new System.Drawing.Size(250, 776); this.uCProveedores.TabIndex = 0; } else { this.formPrincipal.panelMain.Controls.Add(uCProveedores); this.uCProveedores.reLoad(); } this.formPrincipal.lblTitlePage.Text = "Compra - Proveedores"; break; default: break; } }
private void togglePanelMain(string panelName) { limpiarControles(); switch (panelName) { case "cierreCaja": if (uCCierreCaja == null) { this.uCCierreCaja = new Admeli.CajaBox.UCCierreCaja(this.formPrincipal); this.formPrincipal.panelMain.Controls.Add(uCCierreCaja); this.uCCierreCaja.Dock = System.Windows.Forms.DockStyle.Fill; this.uCCierreCaja.Location = new System.Drawing.Point(0, 0); this.uCCierreCaja.Name = "uCCierreCaja"; this.uCCierreCaja.Size = new System.Drawing.Size(250, 776); this.uCCierreCaja.TabIndex = 0; } else { this.formPrincipal.panelMain.Controls.Add(uCCierreCaja); this.uCCierreCaja.reLoad(); } this.formPrincipal.lblTitlePage.Text = "Caja - Cierre de caja"; break; case "egresos": if (uCEgresos == null) { this.uCEgresos = new Admeli.CajaBox.UCEgresos(this.formPrincipal); this.formPrincipal.panelMain.Controls.Add(uCEgresos); this.uCEgresos.Dock = System.Windows.Forms.DockStyle.Fill; this.uCEgresos.Location = new System.Drawing.Point(0, 0); this.uCEgresos.Name = "uCEgresos"; this.uCEgresos.Size = new System.Drawing.Size(250, 776); this.uCEgresos.TabIndex = 0; } else { this.formPrincipal.panelMain.Controls.Add(uCEgresos); this.uCEgresos.reLoad(); } this.formPrincipal.lblTitlePage.Text = "Caja - Egreso"; break; case "ingresos": if (uCIngresos == null) { this.uCIngresos = new Admeli.CajaBox.UCIngresos(this.formPrincipal); this.formPrincipal.panelMain.Controls.Add(uCIngresos); this.uCIngresos.Dock = System.Windows.Forms.DockStyle.Fill; this.uCIngresos.Location = new System.Drawing.Point(0, 0); this.uCIngresos.Name = "uCIngresos"; this.uCIngresos.Size = new System.Drawing.Size(250, 776); this.uCIngresos.TabIndex = 0; } else { this.formPrincipal.panelMain.Controls.Add(uCIngresos); this.uCIngresos.reLoad(); } this.formPrincipal.lblTitlePage.Text = "Caja - Ingreso"; break; case "iniciarCaja": if (uCIniciarCaja == null) { this.uCIniciarCaja = new Admeli.CajaBox.UCIniciarCaja(this.formPrincipal); this.formPrincipal.panelMain.Controls.Add(uCIniciarCaja); this.uCIniciarCaja.Dock = System.Windows.Forms.DockStyle.Fill; this.uCIniciarCaja.Location = new System.Drawing.Point(0, 0); this.uCIniciarCaja.Name = "uCIniciarCaja"; this.uCIniciarCaja.Size = new System.Drawing.Size(250, 776); this.uCIniciarCaja.TabIndex = 0; } else { this.formPrincipal.panelMain.Controls.Add(uCIniciarCaja); this.uCIniciarCaja.reLoad(); } this.formPrincipal.lblTitlePage.Text = "Caja - Iniciar caja"; break; case "cuentaPorCobrar": if (uCCuentasCobrar == null) { this.uCCuentasCobrar = new Admeli.CajaBox.UCCuentaCobrar(this.formPrincipal); this.formPrincipal.panelMain.Controls.Add(uCCuentasCobrar); this.uCCuentasCobrar.Dock = System.Windows.Forms.DockStyle.Fill; this.uCCuentasCobrar.Location = new System.Drawing.Point(0, 0); this.uCCuentasCobrar.Name = "uCCuentaCobrar"; this.uCCuentasCobrar.Size = new System.Drawing.Size(250, 776); this.uCCuentasCobrar.TabIndex = 0; } else { this.formPrincipal.panelMain.Controls.Add(uCCuentasCobrar); this.uCCuentasCobrar.reLoad(); } this.formPrincipal.lblTitlePage.Text = "Cuentas - Cobrar"; break; case "cuentaPorPagar": if (uCCuentasPagar == null) { this.uCCuentasPagar = new Admeli.CajaBox.UCCuentaPagar(this.formPrincipal); this.formPrincipal.panelMain.Controls.Add(uCCuentasPagar); this.uCCuentasPagar.Dock = System.Windows.Forms.DockStyle.Fill; this.uCCuentasPagar.Location = new System.Drawing.Point(0, 0); this.uCCuentasPagar.Name = "uCCuentaCobrar"; this.uCCuentasPagar.Size = new System.Drawing.Size(250, 776); this.uCCuentasPagar.TabIndex = 0; } else { this.formPrincipal.panelMain.Controls.Add(uCCuentasPagar); this.uCCuentasPagar.reLoad(); } this.formPrincipal.lblTitlePage.Text = "Cuentas - Pagar"; break; case "estadoCajas": if (uCEstadoCajas == null) { //this.uCCierreCaja = new Admeli.CajaBox.UCCierreCaja(this.formPrincipal); this.uCEstadoCajas = new UCEstadoCajas(this.formPrincipal); this.formPrincipal.panelMain.Controls.Add(uCEstadoCajas); this.uCEstadoCajas.Dock = System.Windows.Forms.DockStyle.Fill; this.uCEstadoCajas.Location = new Point(0, 0); this.uCEstadoCajas.Name = "uCEstadoCajas"; this.uCEstadoCajas.Size = new Size(250, 776); this.uCEstadoCajas.TabIndex = 0; } else { this.formPrincipal.panelMain.Controls.Add(uCEstadoCajas); this.uCEstadoCajas.reLoad(); } this.formPrincipal.lblTitlePage.Text = "Caja - Estado de Cajas"; break; default: break; } }