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; } }
public void togglePanelMain(string panelName) { limpiarControles(); switch (panelName) { case "listadoProducto": if (uCListadoProducto == null) { this.uCListadoProducto = new Admeli.Productos.UCListadoProducto(this.formPrincipal); this.formPrincipal.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.formPrincipal.panelMain.Controls.Add(uCListadoProducto); this.uCListadoProducto.reLoad(); } formPrincipal.lblTitlePage.Text = "Producto - Listar Productos"; /// Titulo en el encabezado break; case "marcas": if (uCMarcas == null) { this.uCMarcas = new Admeli.Productos.UCMarcas(this.formPrincipal); this.formPrincipal.panelMain.Controls.Add(uCMarcas); this.uCMarcas.Dock = System.Windows.Forms.DockStyle.Fill; this.uCMarcas.Location = new System.Drawing.Point(0, 0); this.uCMarcas.Name = "uCMarcas"; this.uCMarcas.Size = new System.Drawing.Size(250, 776); this.uCMarcas.TabIndex = 0; } else { this.formPrincipal.panelMain.Controls.Add(uCMarcas); this.uCMarcas.reLoad(); } formPrincipal.lblTitlePage.Text = "Producto - Marcas"; /// Titulo en el encabezado break; case "unidadesMedida": if (uCUnidadesMedida == null) { this.uCUnidadesMedida = new Admeli.Productos.UCUnidadesMedida(this.formPrincipal); this.formPrincipal.panelMain.Controls.Add(uCUnidadesMedida); this.uCUnidadesMedida.Dock = System.Windows.Forms.DockStyle.Fill; this.uCUnidadesMedida.Location = new System.Drawing.Point(0, 0); this.uCUnidadesMedida.Name = "uCUnidadesMedida"; this.uCUnidadesMedida.Size = new System.Drawing.Size(250, 776); this.uCUnidadesMedida.TabIndex = 0; } else { this.formPrincipal.panelMain.Controls.Add(uCUnidadesMedida); this.uCUnidadesMedida.reLoad(); } formPrincipal.lblTitlePage.Text = "Producto - Unidad Medida"; /// Titulo en el encabezado break; case "categorias": if (uCCategorias == null) { this.uCCategorias = new Admeli.Productos.UCCategorias(this.formPrincipal); this.formPrincipal.panelMain.Controls.Add(uCCategorias); this.uCCategorias.Dock = System.Windows.Forms.DockStyle.Fill; this.uCCategorias.Location = new System.Drawing.Point(0, 0); this.uCCategorias.Name = "uCCategorias"; this.uCCategorias.Size = new System.Drawing.Size(250, 776); this.uCCategorias.TabIndex = 0; } else { this.formPrincipal.panelMain.Controls.Add(uCCategorias); this.uCCategorias.reLoad(); } formPrincipal.lblTitlePage.Text = "Producto - Categorias"; /// Titulo en el encabezado break; default: break; } }