Ejemplo n.º 1
0
        public void Crear_Impresion_Cotizacion()
        {
            RN_Cotizacion cotizacion = new RN_Cotizacion();
            DataTable     datos      = new DataTable();

            datos = cotizacion.RN_Buscar_Cotizaciones_Editar(Convert.ToString(this.Tag));
            Rpte_Cotizacion reportEjemplo = new Rpte_Cotizacion();

            this.VzrCoti.ReportSource = reportEjemplo;
            reportEjemplo.SetDataSource(datos);
            reportEjemplo.Refresh();

            this.VzrCoti.ReportSource = reportEjemplo;
        }
Ejemplo n.º 2
0
        private void Guardar_Cotizacion()
        {
            RN_Cotizacion          obj        = new RN_Cotizacion();
            EN_Cotizacion          coti       = new EN_Cotizacion();
            Frm_Filtro             fil        = new Frm_Filtro();
            Frm_Exito              ex         = new Frm_Exito();
            Frm_Advertencia        adv        = new Frm_Advertencia();
            Frm_Print_Cotizaciones informeCot = new Frm_Print_Cotizaciones();

            try
            {
                GuardarPedido();
                if (BD_Pedido.guarda == true && BD_Pedido.detalleguarda == true)
                {
                    txtNroCotiza.Text    = RN_TipoDoc.RN_Nro_id(11);
                    coti.IdCotizacion    = txtNroCotiza.Text;
                    coti.IdPedido        = txtIdPedido.Text;
                    coti.FechaCotizacion = dtp_FechaEmi.Value;
                    coti.Vigencia        = Convert.ToInt32(nud_vigencia.Value);
                    coti.TotalCoti       = Convert.ToDouble(lbl_TotalPagar.Text);
                    coti.Condiciones     = txt_condicion.Text;
                    if (chk_sinIgv.Checked == true)
                    {
                        coti.PrecioConIgv = "No";
                    }
                    else
                    {
                        coti.PrecioConIgv = "Si";
                    }
                    coti.EstadoCoti = "Pendiente";

                    obj.RN_Registrar_Cotizacion(coti);

                    if (BD_Cotizacion.guardo == true)
                    {
                        //Mandar a imprimir cotizacion
                        fil.Show();
                        informeCot.Tag = txtNroCotiza.Text;
                        informeCot.Crear_Impresion_Cotizacion();
                        informeCot.ShowDialog();
                        fil.Hide();


                        RN_TipoDoc.RN_Actualizar_NumeroCorrelativo_Producto(11);
                        fil.Show();
                        ex.lbl_Msm1.Text = "Cotizacion Guardada Exitosamente.";
                        ex.ShowDialog();
                        fil.Hide();

                        pnl_sinProd.Visible = true;
                        lsv_Det.Items.Clear();
                        txt_cliente.Text   = "";
                        txtNroCotiza.Text  = "";
                        txtIdPedido.Text   = "";
                        lblIdCliente.Text  = "-";
                        txt_condicion.Text = ""; chk_sinIgv.Checked = false;
                        nud_vigencia.Value = 1;
                    }
                }
            }
            catch (Exception e)
            {
                fil.Show();
                adv.lbl_Msm1.Text = "Error al guardar la cotización: " + e.Message;
                adv.ShowDialog();
                fil.Hide();
            }
        }