Ejemplo n.º 1
0
        private void btnGuardar_Click(object sender, RoutedEventArgs e)
        {
            // LineaDetalleVentas lineaDetalle = new LineaDetalleVentas();
            FacturaVentasLogica logica = new FacturaVentasLogica();

            if (Validaciones() == true)
            {
                txtTextBlockDialogo2.Text = error;
                dialogoMENS.IsOpen        = true;
                return;
            }
            else
            {
                var    idDevolucion = Guid.NewGuid().ToString();
                Bodega bodega       = (Bodega)cboBodegas.SelectedItem;

                Usuario usuarioGlobal = new Usuario();
                usuarioGlobal = (Usuario)App.Current.Properties["usuarioSesion"];

                logica.InsertarDevolucion(lineaDetalle, idDevolucion, fecha.SelectedDate.Value, Convert.ToInt32(txtCantidad.Text), cboTipo.Text, bodega.Id, usuarioGlobal.Empresa.IdEmpresa);
                dialogo.IsOpen           = true;
                txtTextBlockDialogo.Text = "Registro procesado";

                txtBuscar.Text   = "";
                txtCantidad.Text = "";
                fecha.Text       = "";
            }
        }
Ejemplo n.º 2
0
        private void btnGuardar_Click(object sender, RoutedEventArgs e)
        {
            if (Validaciones() == true)
            {
                txtTextBlockDialogo.Text = error;
                dialogoMENS.IsOpen       = true;
                return;
            }
            else
            {
                FacturaVentasLogica pl      = new FacturaVentasLogica();
                Usuario             usuario = new Usuario();
                usuario = (Usuario)App.Current.Properties["usuarioSesion"];
                DataTable dt = pl.ReporteTotalVentas(fechaInicio.SelectedDate.Value, fechaFin.SelectedDate.Value);

                ReporteTotalVentas.Reset();
                ReportDataSource rd = new ReportDataSource("DataSet1", dt);
                ReporteTotalVentas.LocalReport.DataSources.Add(rd);

                //Array que contendrá los parámetros
                ReportParameter[] parameters = new ReportParameter[3];
                //Establecemos el valor de los parámetros
                parameters[0] = new ReportParameter("paramUsuario", usuario.Nombre);
                parameters[1] = new ReportParameter("fechaInicio", fechaInicio.SelectedDate.Value.ToString());
                parameters[2] = new ReportParameter("fechaFin", fechaFin.SelectedDate.Value.ToString());

                ReporteTotalVentas.LocalReport.ReportEmbeddedResource = "PracticaProfesionalVivarsan.Reportes.ReporteTotalVentas.rdlc";
                ReporteTotalVentas.LocalReport.SetParameters(parameters);
                ReporteTotalVentas.RefreshReport();
            }
        }
Ejemplo n.º 3
0
 private void btnGuardar_Click(object sender, RoutedEventArgs e)
 {
     if (Validaciones() == true)
     {
         txtTextBlockDialogo.Text = error;
         dialogoMENS.IsOpen       = true;
         return;
     }
     else
     {
         frmVentasCliente    frm    = new frmVentasCliente();
         FacturaVentasLogica log    = new FacturaVentasLogica();
         ClienteLogica       pl     = new ClienteLogica();
         Cliente             c      = pl.obtenerCliente(txtId.Text);
         DateTime            inicio = fechaInicio.SelectedDate.Value;
         DateTime            fin    = fechaFin.SelectedDate.Value;
         frm.GenerarReporte(c.Nombre, log.ReporteTotalVentasCl(inicio, fin, c.Id), inicio, fin);
         frm.Show();
     }
 }
Ejemplo n.º 4
0
        private void Refrescar(int idFactura)
        {
            try
            {
                FacturaVentasLogica       logica = new FacturaVentasLogica();
                List <LineaDetalleVentas> lista  = new List <LineaDetalleVentas>();

                lista = logica.obtenerLineaDetalleVentas(idFactura);

                if (lista.Count == 0)
                {
                    this.dialogo.IsOpen           = true;
                    this.txtTextBlockDialogo.Text = "El # Factura no existe";
                    this.popup.IsOpen             = false;
                    return;
                }

                dataGrid.ItemsSource = lista;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }