Example #1
0
        private void txtProducto_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                com_CotizacionPedidoDet_Info row = (com_CotizacionPedidoDet_Info)gv_detalle.GetFocusedRow();
                if (row == null)
                {
                    return;
                }

                if (row.IdProducto != null)
                {
                    FrmCom_ProductoComprasAnteriores frm = new FrmCom_ProductoComprasAnteriores();
                    frm.IdProducto = row.IdProducto ?? 0;
                    frm.ShowDialog();

                    var det = frm.info;
                    if (det != null && det.IdProveedor != 0)
                    {
                        row.A               = true;
                        row.IdProveedor     = det.IdProveedor;
                        row.cd_precioCompra = det.do_precioCompra;
                        row.cd_porc_des     = det.do_porc_des;
                        row.cd_descuento    = det.do_descuento;
                        row.cd_precioFinal  = det.do_precioFinal;

                        row.cd_subtotal = row.cd_Cantidad * row.cd_precioFinal;

                        var impuesto = lst_impuesto.Where(q => q.IdCod_Impuesto == row.IdCod_Impuesto).FirstOrDefault();
                        if (impuesto != null)
                        {
                            row.Por_Iva = impuesto.porcentaje;
                        }
                        else
                        {
                            row.Por_Iva = 0;
                        }

                        row.cd_iva   = row.cd_subtotal * (row.Por_Iva / 100);
                        row.cd_total = row.cd_subtotal + row.cd_iva;
                    }
                    gc_detalle.RefreshDataSource();
                    btn_Buscar.Focus();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Ha ocurrido un error comunĂ­quese con sistemas, Error:" + ex.Message);
            }
        }
Example #2
0
        private void txtProducto_Click(object sender, EventArgs e)
        {
            try
            {
                com_CotizacionPedidoDet_Info row = (com_CotizacionPedidoDet_Info)gv_detalle.GetFocusedRow();
                if (row == null)
                {
                    return;
                }

                if (row.IdProducto != null)
                {
                    FrmCom_ProductoComprasAnteriores frm = new FrmCom_ProductoComprasAnteriores();
                    frm.IdProducto = row.IdProducto ?? 0;
                    frm.ShowDialog();
                }
            }
            catch (Exception)
            {
            }
        }