Beispiel #1
0
        private void LblBuscarAlmacen_Click(object sender, EventArgs e)
        {
            Frm_Almacen frmCategoria = new Frm_Almacen();

            frmCategoria.Owner = this;
            frmCategoria.OcultarToolBar();
            frmCategoria.ShowDialog();
        }
Beispiel #2
0
 void frmAlmacen_FormClosed(object sender, FormClosedEventArgs e)
 {
     frmAlmacen = null;
 }
Beispiel #3
0
        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            treeView1.Refresh();

            if (e.Action == TreeViewAction.ByMouse)
            {
                if (botonCLickeado == fue_Clickeado.Ventas)//solo si se hizo clic en btnVentas
                {
                    #region ModuloVentas
                    //Inicio Modulo de Ventas

                    //visualizar modulo especifico
                    btnVentas_Click("Ventas", null);

                    if (e.Node.Text == "Categoria de Clientes")
                    {
                        //verificar si fue llamado anteriormente
                        if (frmCategoriaClientes == null)
                        {
                            frmCategoriaClientes             = new Frm_CategoriaClientes();
                            frmCategoriaClientes.MdiParent   = this;
                            frmCategoriaClientes.FormClosed += new FormClosedEventHandler(frmCategoriaClientes_FormClosed);
                        }
                        frmCategoriaClientes.WindowState   = FormWindowState.Normal;
                        frmCategoriaClientes.StartPosition = FormStartPosition.CenterScreen;
                        frmCategoriaClientes.BringToFront();
                        frmCategoriaClientes.Show();
                    }

                    if (e.Node.Text == "SubCategoria de Clientes")
                    {
                        //verificar si fue llamado anteriormente
                        if (frmSubCategoriaClientes == null)
                        {
                            frmSubCategoriaClientes             = new Frm_SubCategoriaClientes();
                            frmSubCategoriaClientes.MdiParent   = this;
                            frmSubCategoriaClientes.FormClosed += new FormClosedEventHandler(frmSubCategoriaClientes_FormClosed);
                        }
                        frmSubCategoriaClientes.WindowState   = FormWindowState.Normal;
                        frmSubCategoriaClientes.StartPosition = FormStartPosition.CenterScreen;
                        frmSubCategoriaClientes.BringToFront();
                        frmSubCategoriaClientes.Show();
                    }

                    if (e.Node.Text == "Clientes")
                    {
                        //verificar si fue llamado anteriormente
                        if (frmClientes == null)
                        {
                            frmClientes             = new Frm_Clientes();
                            frmClientes.MdiParent   = this;
                            frmClientes.FormClosed += new FormClosedEventHandler(frmClientes_FormClosed);
                        }
                        frmClientes.WindowState   = FormWindowState.Normal;
                        frmClientes.StartPosition = FormStartPosition.CenterScreen;
                        frmClientes.BringToFront();
                        frmClientes.Show();
                    }

                    if (e.Node.Text == "Cotizaciones")
                    {
                        //verificar si fue llamado anteriormente
                        if (frmCotizaciones == null)
                        {
                            frmCotizaciones             = new Frm_Cotizaciones();
                            frmCotizaciones.MdiParent   = this;
                            frmCotizaciones.FormClosed += new FormClosedEventHandler(frmCotizaciones_FormClosed);
                        }
                        frmCotizaciones.WindowState   = FormWindowState.Normal;
                        frmCotizaciones.StartPosition = FormStartPosition.CenterScreen;
                        frmCotizaciones.BringToFront();
                        frmCotizaciones.Show();
                    }

                    if (e.Node.Text == "Facturacion")
                    {
                        //verificar si fue llamado anteriormente
                        if (frmFacturas == null)
                        {
                            frmFacturas             = new Frm_Facturas();
                            frmFacturas.MdiParent   = this;
                            frmFacturas.FormClosed += new FormClosedEventHandler(frmFacturas_FormClosed);
                        }
                        frmFacturas.WindowState   = FormWindowState.Normal;
                        frmFacturas.StartPosition = FormStartPosition.CenterScreen;
                        frmFacturas.BringToFront();
                        frmFacturas.Show();
                    }

                    if (e.Node.Text == "Recibos")
                    {
                        //verificar si fue llamado anteriormente
                        if (frmRecibos == null)
                        {
                            frmRecibos             = new Frm_Recibos();
                            frmRecibos.MdiParent   = this;
                            frmRecibos.FormClosed += new FormClosedEventHandler(frmRecibos_FormClosed);
                        }
                        frmRecibos.WindowState   = FormWindowState.Normal;
                        frmRecibos.StartPosition = FormStartPosition.CenterScreen;
                        frmRecibos.BringToFront();
                        frmRecibos.Show();
                    }


                    if (e.Node.Text == "Notas de Creditos CxC")
                    {
                        //verificar si fue llamado anteriormente
                        if (frmNotasCreditosCxC == null)
                        {
                            frmNotasCreditosCxC             = new Frm_NotasCreditos();
                            frmNotasCreditosCxC.MdiParent   = this;
                            frmNotasCreditosCxC.FormClosed += new FormClosedEventHandler(frmNotasCreditosCxC_FormClosed);
                        }
                        frmNotasCreditosCxC.WindowState   = FormWindowState.Normal;
                        frmNotasCreditosCxC.StartPosition = FormStartPosition.CenterScreen;
                        frmNotasCreditosCxC.BringToFront();
                        frmNotasCreditosCxC.Show();
                    }

                    if (e.Node.Text == "Notas de Debito CxC")
                    {
                        //verificar si fue llamado anteriormente
                        if (frmNotasDebitosCxC == null)
                        {
                            frmNotasDebitosCxC             = new Frm_NotasDebitos();
                            frmNotasDebitosCxC.MdiParent   = this;
                            frmNotasDebitosCxC.FormClosed += new FormClosedEventHandler(frmNotasDebitosCxC_FormClosed);
                        }
                        frmNotasDebitosCxC.WindowState   = FormWindowState.Normal;
                        frmNotasDebitosCxC.StartPosition = FormStartPosition.CenterScreen;
                        frmNotasDebitosCxC.BringToFront();
                        frmNotasDebitosCxC.Show();
                    }

                    if (e.Node.Text == "Terminos")
                    {
                        //verificar si fue llamado anteriormente
                        if (frmTerminos == null)
                        {
                            frmTerminos             = new Frm_Terminos();
                            frmTerminos.MdiParent   = this;
                            frmTerminos.FormClosed += new FormClosedEventHandler(frmTerminos_FormClosed);
                        }
                        frmTerminos.WindowState   = FormWindowState.Normal;
                        frmTerminos.StartPosition = FormStartPosition.CenterScreen;
                        frmTerminos.BringToFront();
                        frmTerminos.Show();
                    }

                    if (e.Node.Text == "Cajas")
                    {
                        //verificar si fue llamado anteriormente
                        if (frmCajas == null)
                        {
                            frmCajas             = new Frm_Cajas();
                            frmCajas.MdiParent   = this;
                            frmCajas.FormClosed += new FormClosedEventHandler(frmCajas_FormClosed);
                        }
                        frmCajas.WindowState   = FormWindowState.Normal;
                        frmCajas.StartPosition = FormStartPosition.CenterScreen;
                        frmCajas.BringToFront();
                        frmCajas.Show();
                    }
                    #endregion ModuloVentas
                }//Fin Modulo de Ventas

                else if (botonCLickeado == fue_Clickeado.Compras) //solo si se hizo clic en btnCompras
                {
                    #region ModuloCompras
                    //Inicio Modulo de Compras

                    //visualizar modulo especifico
                    btnCompras_Click("Compras", null);

                    if (e.Node.Text == "Categoria de Suplidores")
                    {
                        //verificar si fue llamado anteriormente
                        if (frmCategoriaSuplidor == null)
                        {
                            frmCategoriaSuplidor             = new Frm_CategoriaSuplidores();
                            frmCategoriaSuplidor.MdiParent   = this;
                            frmCategoriaSuplidor.FormClosed += new FormClosedEventHandler(frmCategoriaSuplidor_FormClosed);
                        }
                        frmCategoriaSuplidor.WindowState   = FormWindowState.Normal;
                        frmCategoriaSuplidor.StartPosition = FormStartPosition.CenterScreen;
                        frmCategoriaSuplidor.BringToFront();
                        frmCategoriaSuplidor.Show();
                    }


                    if (e.Node.Text == "SubCategoria de Suplidores")
                    {
                        //verificar si fue llamado anteriormente
                        if (frmSubCateSupli == null)
                        {
                            frmSubCateSupli             = new Frm_SubCategoriaSuplidores();
                            frmSubCateSupli.MdiParent   = this;
                            frmSubCateSupli.FormClosed += new FormClosedEventHandler(frmSubCateSupli_FormClosed);
                        }
                        frmSubCateSupli.WindowState   = FormWindowState.Normal;
                        frmSubCateSupli.StartPosition = FormStartPosition.CenterScreen;
                        frmSubCateSupli.BringToFront();
                        frmSubCateSupli.Show();
                    }


                    if (e.Node.Text == "Suplidores")
                    {
                        //verificar si fue llamado anteriormente
                        if (frmSuplidores == null)
                        {
                            frmSuplidores             = new Frm_Suplidores();
                            frmSuplidores.MdiParent   = this;
                            frmSuplidores.FormClosed += new FormClosedEventHandler(frmSuplidores_FormClosed);
                        }
                        frmSuplidores.WindowState   = FormWindowState.Normal;
                        frmSuplidores.StartPosition = FormStartPosition.CenterScreen;
                        frmSuplidores.BringToFront();
                        frmSuplidores.Show();
                    }


                    if (e.Node.Text == "Ordenes de Compras")
                    {
                        //verificar si fue llamado anteriormente
                        if (frmOrdenesCompras == null)
                        {
                            frmOrdenesCompras             = new Frm_OrdenesCompras();
                            frmOrdenesCompras.MdiParent   = this;
                            frmOrdenesCompras.FormClosed += new FormClosedEventHandler(frmOrdenesCompras_FormClosed);
                        }
                        frmOrdenesCompras.WindowState   = FormWindowState.Normal;
                        frmOrdenesCompras.StartPosition = FormStartPosition.CenterScreen;
                        frmOrdenesCompras.BringToFront();
                        frmOrdenesCompras.Show();
                    }


                    if (e.Node.Text == "Compras")
                    {
                        //verificar si fue llamado anteriormente
                        if (frmCompras == null)
                        {
                            frmCompras             = new Frm_Compras();
                            frmCompras.MdiParent   = this;
                            frmCompras.FormClosed += new FormClosedEventHandler(frmCompras_FormClosed);
                        }
                        frmCompras.WindowState   = FormWindowState.Normal;
                        frmCompras.StartPosition = FormStartPosition.CenterScreen;
                        frmCompras.BringToFront();
                        frmCompras.Show();
                    }


                    if (e.Node.Text == "Notas de Creditos CxP")
                    {
                        //verificar si fue llamado anteriormente
                        if (frmNotasCreditosCxP == null)
                        {
                            frmNotasCreditosCxP             = new Frm_NotasCreditosCxP();
                            frmNotasCreditosCxP.MdiParent   = this;
                            frmNotasCreditosCxP.FormClosed += new FormClosedEventHandler(frmNotasCreditosCxP_FormClosed);
                        }
                        frmNotasCreditosCxP.WindowState   = FormWindowState.Normal;
                        frmNotasCreditosCxP.StartPosition = FormStartPosition.CenterScreen;
                        frmNotasCreditosCxP.BringToFront();
                        frmNotasCreditosCxP.Show();
                    }



                    if (e.Node.Text == "Notas de Debitos CxP")
                    {
                        //verificar si fue llamado anteriormente
                        if (frmNotasDebitosCxP == null)
                        {
                            frmNotasDebitosCxP             = new Frm_NotasDebitosCxP();
                            frmNotasDebitosCxP.MdiParent   = this;
                            frmNotasDebitosCxP.FormClosed += new FormClosedEventHandler(frmNotasDebitosCxP_FormClosed);
                        }
                        frmNotasDebitosCxP.WindowState   = FormWindowState.Normal;
                        frmNotasDebitosCxP.StartPosition = FormStartPosition.CenterScreen;
                        frmNotasDebitosCxP.BringToFront();
                        frmNotasDebitosCxP.Show();
                    }


                    #endregion
                }//Fin Modulo de Compras

                else if (botonCLickeado == fue_Clickeado.Inventario) //solo si se hizo clic en btnInventario
                {
                    #region ModuloInventario

                    //visualizar modulo especifico
                    btnInventario_Click("Inventario", null);

                    if (e.Node.Text == "Categoria de Articulos")
                    {
                        //verificar si fue llamado anteriormente
                        if (frmCategoriaArticulos == null)
                        {
                            frmCategoriaArticulos             = new Frm_CategoriaArticulos();
                            frmCategoriaArticulos.MdiParent   = this;
                            frmCategoriaArticulos.FormClosed += new FormClosedEventHandler(frmCategoriaArticulos_FormClosed);
                        }
                        frmCategoriaArticulos.WindowState   = FormWindowState.Normal;
                        frmCategoriaArticulos.StartPosition = FormStartPosition.CenterScreen;
                        frmCategoriaArticulos.BringToFront();
                        frmCategoriaArticulos.Show();
                    }

                    if (e.Node.Text == "SubCategoria de Articulos")
                    {
                        //verificar si fue llamado anteriormente
                        if (frmSubCateArtic == null)
                        {
                            frmSubCateArtic             = new Frm_SubCategoriaArticulos();
                            frmSubCateArtic.MdiParent   = this;
                            frmSubCateArtic.FormClosed += new FormClosedEventHandler(frmSubCateArtic_FormClosed);
                        }
                        frmSubCateArtic.WindowState   = FormWindowState.Normal;
                        frmSubCateArtic.StartPosition = FormStartPosition.CenterScreen;
                        frmSubCateArtic.BringToFront();
                        frmSubCateArtic.Show();
                    }


                    if (e.Node.Text == "Almacen")
                    {
                        //verificar si fue llamado anteriormente
                        if (frmAlmacen == null)
                        {
                            frmAlmacen             = new Frm_Almacen();
                            frmAlmacen.MdiParent   = this;
                            frmAlmacen.FormClosed += new FormClosedEventHandler(frmAlmacen_FormClosed);
                        }
                        frmAlmacen.WindowState   = FormWindowState.Normal;
                        frmAlmacen.StartPosition = FormStartPosition.CenterScreen;
                        frmAlmacen.BringToFront();
                        frmAlmacen.Show();
                    }

                    if (e.Node.Text == "Marcas")
                    {
                        //verificar si fue llamado anteriormente
                        if (frmMarcas == null)
                        {
                            frmMarcas             = new Frm_Marcas();
                            frmMarcas.MdiParent   = this;
                            frmMarcas.FormClosed += new FormClosedEventHandler(frmMarcas_FormClosed);
                        }
                        frmMarcas.WindowState   = FormWindowState.Normal;
                        frmMarcas.StartPosition = FormStartPosition.CenterScreen;
                        frmMarcas.BringToFront();
                        frmMarcas.Show();
                    }

                    if (e.Node.Text == "Articulos")
                    {
                        //verificar si fue llamado anteriormente
                        if (frmArticulos == null)
                        {
                            frmArticulos             = new Frm_Articulos();
                            frmArticulos.MdiParent   = this;
                            frmArticulos.FormClosed += new FormClosedEventHandler(frmArticulos_FormClosed);
                        }
                        frmArticulos.WindowState   = FormWindowState.Normal;
                        frmArticulos.StartPosition = FormStartPosition.CenterScreen;
                        frmArticulos.BringToFront();
                        frmArticulos.Show();
                    }

                    if (e.Node.Text == "Tranferencia de Almacenes")
                    {
                        //verificar si fue llamado anteriormente
                        if (frmTransfAlmacenes == null)
                        {
                            frmTransfAlmacenes             = new Frm_TransferenciaAlmacenes();
                            frmTransfAlmacenes.MdiParent   = this;
                            frmTransfAlmacenes.FormClosed += new FormClosedEventHandler(frmTransfAlmacenes_FormClosed);
                        }
                        frmTransfAlmacenes.WindowState   = FormWindowState.Normal;
                        frmTransfAlmacenes.StartPosition = FormStartPosition.CenterScreen;
                        frmTransfAlmacenes.BringToFront();
                        frmTransfAlmacenes.Show();
                    }


                    #endregion
                }//Fin Modulo de Inventario

                else if (botonCLickeado == fue_Clickeado.Administracion) //solo si se hizo clic en btnAdministracion
                {
                    #region ModuloAdministracion

                    //visualizar modulo especifico
                    btnAdministracion_Click("Administracion", null);

                    if (e.Node.Text == "Datos de Compania")
                    {
                        //verificar si fue llamado anteriormente
                        if (frmCompania == null)
                        {
                            frmCompania             = new Frm_Compania();
                            frmCompania.MdiParent   = this;
                            frmCompania.FormClosed += new FormClosedEventHandler(frmCompania_FormClosed);
                        }
                        frmCompania.WindowState   = FormWindowState.Normal;
                        frmCompania.StartPosition = FormStartPosition.CenterScreen;
                        frmCompania.BringToFront();
                        frmCompania.Show();
                    }

                    if (e.Node.Text == "Empleados")
                    {
                        //verificar si fue llamado anteriormente
                        if (frmEmpleados == null)
                        {
                            frmEmpleados             = new Frm_Empleados();
                            frmEmpleados.MdiParent   = this;
                            frmEmpleados.FormClosed += new FormClosedEventHandler(frmEmpleados_FormClosed);
                        }
                        frmEmpleados.WindowState   = FormWindowState.Normal;
                        frmEmpleados.StartPosition = FormStartPosition.CenterScreen;
                        frmEmpleados.BringToFront();
                        frmEmpleados.Show();
                    }


                    if (e.Node.Text == "Usuarios")
                    {
                        //verificar si fue llamado anteriormente
                        if (frmUsuarios == null)
                        {
                            frmUsuarios             = new Frm_Usuarios();
                            frmUsuarios.MdiParent   = this;
                            frmUsuarios.FormClosed += new FormClosedEventHandler(frmUsuarios_FormClosed);
                        }
                        frmUsuarios.WindowState   = FormWindowState.Normal;
                        frmUsuarios.StartPosition = FormStartPosition.CenterScreen;
                        frmUsuarios.BringToFront();
                        frmUsuarios.Show();
                    }


                    if (e.Node.Text == "Impuestos")
                    {
                        //verificar si fue llamado anteriormente
                        if (frmImpuestos == null)
                        {
                            frmImpuestos             = new Frm_Impuestos();
                            frmImpuestos.MdiParent   = this;
                            frmImpuestos.FormClosed += new FormClosedEventHandler(frmImpuestos_FormClosed);
                        }
                        frmImpuestos.WindowState   = FormWindowState.Normal;
                        frmImpuestos.StartPosition = FormStartPosition.CenterScreen;
                        frmImpuestos.BringToFront();
                        frmImpuestos.Show();
                    }

                    if (e.Node.Text == "Modo de Pago")
                    {
                        //verificar si fue llamado anteriormente
                        if (frmModoPago == null)
                        {
                            frmModoPago             = new Frm_MododePago();
                            frmModoPago.MdiParent   = this;
                            frmModoPago.FormClosed += new FormClosedEventHandler(frmModoPago_FormClosed);
                        }
                        frmModoPago.WindowState   = FormWindowState.Normal;
                        frmModoPago.StartPosition = FormStartPosition.CenterScreen;
                        frmModoPago.BringToFront();
                        frmModoPago.Show();
                    }

                    if (e.Node.Text == "Numeracion")
                    {
                        //verificar si fue llamado anteriormente
                        if (frmNumeracion == null)
                        {
                            frmNumeracion             = new Frm_Numeracion();
                            frmNumeracion.MdiParent   = this;
                            frmNumeracion.FormClosed += new FormClosedEventHandler(frmNumeracion_FormClosed);
                        }
                        frmNumeracion.WindowState   = FormWindowState.Normal;
                        frmNumeracion.StartPosition = FormStartPosition.CenterScreen;
                        frmNumeracion.BringToFront();
                        frmNumeracion.Show();
                    }


                    if (e.Node.Text == "Gastos")
                    {
                        //verificar si fue llamado anteriormente
                        if (frmGastos == null)
                        {
                            frmGastos             = new Frm_Gastos();
                            frmGastos.MdiParent   = this;
                            frmGastos.FormClosed += new FormClosedEventHandler(frmGastos_FormClosed);
                        }
                        frmGastos.WindowState   = FormWindowState.Normal;
                        frmGastos.StartPosition = FormStartPosition.CenterScreen;
                        frmGastos.BringToFront();
                        frmGastos.Show();
                    }
                    #endregion
                }//Fin Modulo de Administracion
            }
            treeView1.Refresh();
        }