public static frmCotizacionDeCompra GetInstancia()
 {
     if (_Instancia == null)
     {
         _Instancia = new frmCotizacionDeCompra();
     }
     return(_Instancia);
 }
        private void DGFiltro_Resultados_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                frmOrdenDeCompra      frmOComp     = frmOrdenDeCompra.GetInstancia();
                frmProducto           frmProd      = frmProducto.GetInstancia();
                frmProducto           frmProdStock = frmProducto.GetInstancia();
                frmInventario_Ingreso frmInv       = frmInventario_Ingreso.GetInstancia();
                frmCotizacionDeCompra frmCComp     = frmCotizacionDeCompra.GetInstancia();

                //Variables Para Los Filtros
                string idbodega, bodega, documento;

                if (frmInv.Filtro)
                {
                    idbodega  = this.DGFiltro_Resultados.CurrentRow.Cells[0].Value.ToString();
                    bodega    = this.DGFiltro_Resultados.CurrentRow.Cells[1].Value.ToString();
                    documento = this.DGFiltro_Resultados.CurrentRow.Cells[2].Value.ToString();
                    frmInv.setBodega(idbodega, bodega, documento);
                    this.Hide();
                }

                if (frmCComp.Filtro)
                {
                    idbodega  = this.DGFiltro_Resultados.CurrentRow.Cells[0].Value.ToString();
                    bodega    = this.DGFiltro_Resultados.CurrentRow.Cells[1].Value.ToString();
                    documento = this.DGFiltro_Resultados.CurrentRow.Cells[2].Value.ToString();
                    frmCComp.setBodega(idbodega, bodega, documento);
                    this.Hide();
                }

                if (frmOComp.Filtro)
                {
                    idbodega  = this.DGFiltro_Resultados.CurrentRow.Cells[0].Value.ToString();
                    bodega    = this.DGFiltro_Resultados.CurrentRow.Cells[1].Value.ToString();
                    documento = this.DGFiltro_Resultados.CurrentRow.Cells[2].Value.ToString();
                    frmOComp.setBodega(idbodega, bodega, documento);
                    this.Hide();
                }

                if (frmProd.Filtro)
                {
                    idbodega = this.DGFiltro_Resultados.CurrentRow.Cells[0].Value.ToString();
                    bodega   = this.DGFiltro_Resultados.CurrentRow.Cells[1].Value.ToString();
                    frmProd.setUbicacion(idbodega, bodega);
                    this.Hide();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + ex.StackTrace);
            }
        }
Пример #3
0
        private void DGFiltro_Resultados_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                frmProducto           frmPro  = frmProducto.GetInstancia();
                frmOrdenDeCompra      frmOCom = frmOrdenDeCompra.GetInstancia();
                frmInventario_Ingreso frmInv  = frmInventario_Ingreso.GetInstancia();
                frmCotizacionDeCompra frmCot  = frmCotizacionDeCompra.GetInstancia();

                //Variables para realizar los Filtro
                string idproveedor, proveedor, documento;

                if (frmPro.Examinar_Proveedor)
                {
                    idproveedor = this.DGFiltro_Resultados.CurrentRow.Cells[0].Value.ToString();
                    proveedor   = this.DGFiltro_Resultados.CurrentRow.Cells[1].Value.ToString();
                    documento   = this.DGFiltro_Resultados.CurrentRow.Cells[3].Value.ToString();
                    frmPro.setProveedor(idproveedor, proveedor, documento);
                    this.Hide();
                }

                if (frmInv.Examinar)
                {
                    idproveedor = this.DGFiltro_Resultados.CurrentRow.Cells[0].Value.ToString();
                    proveedor   = this.DGFiltro_Resultados.CurrentRow.Cells[1].Value.ToString();
                    documento   = this.DGFiltro_Resultados.CurrentRow.Cells[3].Value.ToString();
                    frmInv.setProveedor(idproveedor, proveedor, documento);
                    this.Hide();
                }

                if (frmCot.Examinar)
                {
                    idproveedor = this.DGFiltro_Resultados.CurrentRow.Cells[0].Value.ToString();
                    proveedor   = this.DGFiltro_Resultados.CurrentRow.Cells[1].Value.ToString();
                    documento   = this.DGFiltro_Resultados.CurrentRow.Cells[3].Value.ToString();
                    frmCot.setProveedor(idproveedor, proveedor, documento);
                    this.Hide();
                }

                if (frmOCom.Examinar)
                {
                    idproveedor = this.DGFiltro_Resultados.CurrentRow.Cells[0].Value.ToString();
                    proveedor   = this.DGFiltro_Resultados.CurrentRow.Cells[1].Value.ToString();
                    documento   = this.DGFiltro_Resultados.CurrentRow.Cells[3].Value.ToString();
                    frmOCom.setProveedor(idproveedor, proveedor, documento);
                    this.Hide();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + ex.StackTrace);
            }
        }
        private void cotizacionesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmCotizacionDeCompra frmCotizacionDeCompra = frmCotizacionDeCompra.GetInstancia();

            frmCotizacionDeCompra.MdiParent = this;
            frmCotizacionDeCompra.Show();

            frmCotizacionDeCompra.Guardar    = Convert.ToString(this.SQL_Guardar);
            frmCotizacionDeCompra.Editar     = Convert.ToString(this.SQL_Editar);
            frmCotizacionDeCompra.Eliminar   = Convert.ToString(this.SQL_Eliminar);
            frmCotizacionDeCompra.Consultar  = Convert.ToString(this.SQL_Consultar);
            frmCotizacionDeCompra.Imprimir   = Convert.ToString(this.SQL_Imprimir);
            frmCotizacionDeCompra.Idempleado = Convert.ToInt32(this.Idempleado);
        }
Пример #5
0
        private void btnAgregar_Click(object sender, EventArgs e)
        {
            try
            {
                frmOrdenDeCompra      frmOC  = frmOrdenDeCompra.GetInstancia();
                frmInventario_Ingreso frmBI  = frmInventario_Ingreso.GetInstancia();
                frmCotizacionDeCompra frmCot = frmCotizacionDeCompra.GetInstancia();
                frmProducto           frmPD  = frmProducto.GetInstancia();

                //Variables Para Los Filtros
                string idproducto, producto;

                if (frmBI.Examinar)
                {
                    idproducto = this.DGFiltro_General.CurrentRow.Cells[0].Value.ToString();
                    producto   = Convert.ToString(this.DGFiltro_General.CurrentRow.Cells[2].Value);
                    frmBI.setProducto(idproducto, producto);
                    this.Hide();
                }

                if (frmOC.Examinar)
                {
                    idproducto = this.DGFiltro_General.CurrentRow.Cells[0].Value.ToString();
                    producto   = Convert.ToString(this.DGFiltro_General.CurrentRow.Cells[2].Value);
                    frmOC.setProducto(idproducto, producto);
                    this.Hide();
                }

                if (frmCot.Examinar)
                {
                    idproducto = this.DGFiltro_General.CurrentRow.Cells[0].Value.ToString();
                    producto   = Convert.ToString(this.DGFiltro_General.CurrentRow.Cells[2].Value);
                    frmCot.setProducto(idproducto, producto);
                    this.Hide();
                }

                //if (frmOCom.Examinar)
                //{
                //    idproducto = this.DGFiltro_General.CurrentRow.Cells[0].Value.ToString();
                //    producto = Convert.ToString(this.DGFiltro_General.CurrentRow.Cells[2].Value);
                //    frmOCom.setProducto(idproducto, producto);
                //    this.Hide();
                //}
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + ex.StackTrace);
            }
        }
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            try
            {
                frmCotizacionDeCompra frmCotCompra = frmCotizacionDeCompra.GetInstancia();
                frmCotCompra.Guardar_SQL();

                //Se cierra el formulario de totalizacion
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + ex.StackTrace);
            }
        }
        private void AutoComplementar()
        {
            try
            {
                //
                frmCotizacionDeCompra frmCotiCompra = frmCotizacionDeCompra.GetInstancia();

                //
                double ValorFinal, Operacion, SubTotal;

                //
                this.TBSubTotal.Text             = frmCotiCompra.TBSubTotal.Text;
                this.TBDescuento_Porcentaje.Text = frmCotiCompra.TBDescuento.Text;
                this.TBValorGeneral.Text         = frmCotiCompra.TBValorFinal.Text;

                //
                this.TBCreditoMora.Text       = frmCotiCompra.TBCreditoEnMora.Text;
                this.TBCreditoDisponible.Text = frmCotiCompra.TBCreditoDisponible.Text;

                //
                SubTotal   = Convert.ToDouble(TBSubTotal.Text);
                ValorFinal = Convert.ToDouble(TBValorGeneral.Text);
                Operacion  = SubTotal - ValorFinal;

                //Formato de Texboxt
                this.TBDescuento.Text = Operacion.ToString("##,##0.00");

                //Validacion de Chexbox
                if (CHVencimiento.Checked)
                {
                    this.Vencimiento = 1;
                }
                else
                {
                    this.Vencimiento = 0;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + ex.StackTrace);
            }
        }
 private void frmCotizacionDeCompra_FormClosing(object sender, FormClosingEventArgs e)
 {
     _Instancia = null;
 }