internal void togglePanelMain(string panelName) { this.panelMain.Controls.Clear(); switch (panelName) { case "home": if (this.uCHome == null) { this.uCHome = new Admeli.UCHome(this); this.panelMain.Controls.Add(uCHome); this.uCHome.Dock = System.Windows.Forms.DockStyle.Fill; this.uCHome.Location = new System.Drawing.Point(0, 0); this.uCHome.Name = "uCHome"; this.uCHome.Size = new System.Drawing.Size(250, 776); this.uCHome.TabIndex = 0; } else { this.panelMain.Controls.Add(uCHome); } this.lblTitlePage.Text = "Home - "; /// Titulo en el encabezado break; case "compras2": if (this.uCCompras == null) { this.uCCompras = new UCCompras(this); this.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.panelMain.Controls.Add(uCCompras); } this.lblTitlePage.Text = "Compras - Compra"; /// Titulo en el encabezado break; case "ventas2": if (this.uCVentas == null) { this.uCVentas = new UCVentas(this); this.panelMain.Controls.Add(uCVentas); this.uCVentas.Dock = System.Windows.Forms.DockStyle.Fill; this.uCVentas.Location = new System.Drawing.Point(0, 0); this.uCVentas.Name = "uCVentas"; this.uCVentas.Size = new System.Drawing.Size(250, 776); this.uCVentas.TabIndex = 0; } else { this.panelMain.Controls.Add(uCVentas); } this.lblTitlePage.Text = "Ventas - Venta"; /// Titulo en el encabezado break; case "productos2": if (this.uCListadoProducto == null) { this.uCListadoProducto = new UCListadoProducto(this); this.panelMain.Controls.Add(uCListadoProducto); this.uCListadoProducto.Dock = System.Windows.Forms.DockStyle.Fill; this.uCListadoProducto.Location = new System.Drawing.Point(0, 0); this.uCListadoProducto.Name = "uCListadoProducto"; this.uCListadoProducto.Size = new System.Drawing.Size(250, 776); this.uCListadoProducto.TabIndex = 0; } else { this.panelMain.Controls.Add(uCListadoProducto); } this.lblTitlePage.Text = "Productos - Listar"; /// Titulo en el encabezado break; default: break; } }
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; } }