public void ActualizarGrupo(FinancieraGrupo nuevo, FinancieraGrupo original)
        {
            EmpeñosDC entidades = new EmpeñosDC(new clsConeccionDB().StringConn());

            entidades.FinancieraGrupos.Attach(nuevo, original);
            entidades.SubmitChanges();
        }
        public FrmArticulos()
        {
            InitializeComponent(); DataColumn num = new DataColumn
            {
                ColumnName        = "Clave",
                DataType          = Type.GetType("System.Int32"),
                AutoIncrement     = true,
                AutoIncrementSeed = 1,
                AutoIncrementStep = 1,
                ReadOnly          = true,
                Unique            = true
            };
            _dtprecios.Columns.Add(num);
            _dtprecios.Columns.Add("Tipo", Type.GetType("System.String"));
            _dtprecios.Columns.Add("Contado", Type.GetType("System.Decimal"));
            _dtprecios.Columns.Add("Apartado", Type.GetType("System.Decimal"));
            var precios =
                new EmpeñosDC(new clsConeccionDB().StringConn()).Precios.Select(p => new { p.Tipo, Contado = p.VentaContado, Apartado = p.VentaApartado });

            foreach (var pre in precios)
            {
                _dtprecios.Rows.Add(new object[] { null, pre.Tipo, pre.Contado, pre.Apartado });
            }
            _dtprecios.Rows.Add(new object[] { null, "Varios", 0M, 0M });
            cboTipo.Properties.DataSource    = _dtprecios;
            cboTipo.Properties.DisplayMember = "Tipo";
            cboTipo.Properties.ValueMember   = "Clave";
        }
        private void xrVarios_SummaryGetResult(object sender, SummaryGetResultEventArgs e)
        {
            decimal total = new EmpeñosDC(new clsConeccionDB().StringConn()).DetallesBoletas.Where(p => p.Prenda != null && (p.Prenda.Tipo == "Varios" && p.Boleta.FechaPrestamo == DateTime.Today.Date)).Sum(p => p.Prenda != null ? (decimal?)p.Prenda.Peso : 0) ?? 0;

            e.Result  = total;
            e.Handled = true;
        }
        private void barButtonItem1_ItemClick(object sender, ItemClickEventArgs e)
        {
            DataSet inv  = new DataSet("Inventario");
            var     evig = new EmpeñosDC(new clsConeccionDB().StringConn()).Boletas
                           .Where(emp => emp.EstadoBoleta == "Vigente")
                           .Select(emp => new { emp.Folio, emp.Cliente, emp.PesoEmpeño, emp.Prestamo, emp.TipoEmpeño });
            DataTable dtevi = new LinqToDataTable().ObtenerDataTable2(evig);

            dtevi.TableName = "InventarioSoftEmpeños";
            DataTable datosSucursal = new DataTable("Sucursal");

            datosSucursal.Columns.Add("Sucursal", Type.GetType("System.String"));
            datosSucursal.Columns.Add("Direccion", Type.GetType("System.String"));
            //datosSucursal.Columns.Add("Boletas", Type.GetType("System.Int32"));
            DataRow filasucursal = datosSucursal.NewRow();

            filasucursal[0] = new clsModificarConfiguracion().configGetValue("Empresa");
            filasucursal[1] = new clsModificarConfiguracion().configGetValue("Direccion");
            datosSucursal.Rows.Add(filasucursal);
            dtevi.Columns.Add("Verificado", Type.GetType("System.Boolean"));
            foreach (DataRow fila in dtevi.Rows)
            {
                fila["Verificado"] = false;
            }
            inv.Tables.Add(datosSucursal);
            inv.Tables.Add(dtevi);

            string rutaescritorio = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);

            inv.WriteXml(rutaescritorio + @"\InventarioSoftEmpeños.xml", XmlWriteMode.WriteSchema);
            //inv.WriteXmlSchema(rutaescritorio + @"\InventarioSoftEmpeñosSchema.xml");
            MessageBox.Show("Se ha creado un Archivo el Escritorio 'InventarioSoftEmpeños.xml' \n Copielo donde se encuentra su aplicacion de inventario");
        }
        public static decimal SaldoEnCaja()
        {
            EmpeñosDC _entidades = new EmpeñosDC(new clsConeccionDB().StringConn());
            Caja      caja       = _entidades.Cajas.FirstOrDefault(c => c.FechaCajaAbierto.Date == DateTime.Today.Date);

            if (caja != null)
            {
                decimal cajaInicial =
                    caja.CajaInicial; //(from c in _mapeoCasaEmpenios.Cajas
                //where c.FechaCajaAbierto == DateTime.Today.Date && c.Estado
                //select (decimal?)c.CajaInicial).Sum()??0;
                decimal com = (from c in _entidades.Compras
                               where c.FechaCompra == DateTime.Today.Date && c.Estado == true
                               select(decimal?) c.TotalCompra).Sum() ?? 0;
                decimal empe = (from e in _entidades.Boletas
                                where e.FechaPrestamo == DateTime.Today.Date && e.EstadoBoleta != "Cancelado"
                                select(decimal?) e.Prestamo).Sum() ?? 0;
                decimal inte = (from i in _entidades.PagosInteres
                                where i.FechaPago == DateTime.Today.Date && i.Estado == true
                                select(decimal?) i.TotalPagar).Sum() ?? 0;
                decimal desem = (from d in _entidades.Desempeños
                                 where d.FechaDesempeño == DateTime.Today.Date && d.Estado == true
                                 select(decimal?) d.TotalPagar).Sum() ?? 0;
                decimal ret = (from r in _entidades.Transacciones
                               where r.FechaTransaccion == DateTime.Today.Date && r.TipoTransaccion == "Retiro" && r.Estado == true
                               select(decimal?) r.Cantidad).Sum() ?? 0;
                decimal dep = (from depo in _entidades.Transacciones
                               where depo.FechaTransaccion == DateTime.Today.Date && depo.TipoTransaccion == "Deposito" && depo.Estado == true        //DateTime.Now
                               select(decimal?) depo.Cantidad).Sum() ?? 0;
                decimal ventas = (from vc in _entidades.Ventas
                                  where vc.TipoVenta == "Contado" && vc.Estado == "Pagado" && vc.FechaVenta == DateTime.Today.Date
                                  select(decimal?) vc.TotalVenta).Sum() ?? 0;
                decimal apartados = (from vc in _entidades.Ventas
                                     where vc.TipoVenta == "Apartado" && vc.Estado != "Cancelado" && vc.FechaVenta == DateTime.Today.Date
                                     select(decimal?) vc.Enganche).Sum() ?? 0;
                decimal abonos = (from abo in _entidades.PagosVentas
                                  where abo.Estado && abo.FechaPago == DateTime.Today.Date
                                  select(decimal?) abo.Abono).Sum() ?? 0;
                decimal pagoF = (from pf in _entidades.PagosFinanciamientos
                                 where pf.Estado && pf.FechaPago.Date == DateTime.Today.Date
                                 select(decimal?) pf.TotalPago).Sum() ?? 0;
                decimal finan = (from pf in _entidades.Prestamos
                                 where pf.Estado != "Cancelado" && pf.FechaPrestamo.Date == DateTime.Today.Date
                                 select(decimal?) pf.Cantidad).Sum() ?? 0;
                decimal engan = (from pf in _entidades.Prestamos
                                 where pf.Estado != "Cancelado" && pf.FechaPrestamo.Date == DateTime.Today.Date
                                 select(decimal?) pf.Enganche).Sum() ?? 0;
                decimal creditos = (from pf in _entidades.FinancieraCreditos
                                    where pf.Estado == "Activo" && pf.FechaInicio.Date == DateTime.Today.Date
                                    select(decimal?) pf.Prestamo).Sum() ?? 0;
                decimal pagCre = (from pf in _entidades.FinancieraPagos
                                  where pf.Estado && pf.FechaPago.Date == DateTime.Today.Date
                                  select(decimal?) pf.TotalPago).Sum() ?? 0;


                decimal saldo = (cajaInicial + inte + desem + dep + pagoF + engan + ventas + abonos + apartados + pagCre) - (empe + com + finan + ret + creditos);
                return(saldo);
            }
            return(0M);
        }
Exemple #6
0
        private void xrAutos_SummaryGetResult(object sender, SummaryGetResultEventArgs e)
        {
            decimal total = new EmpeñosDC(new clsConeccionDB().StringConn()).DetallesBoletas.Where(p => p.Prenda != null && (p.Prenda.Tipo == "Automovil" && p.Boleta.EstadoBoleta == "Vigente")).Sum(p => p.Prenda != null ? (decimal?)p.Prenda.Peso : 0) ?? 0;

            e.Result  = total;
            e.Handled = true;
        }
        private void XrptTiketsInteres_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            Configuracione config = new EmpeñosDC(new clsConeccionDB().StringConn()).Configuraciones.FirstOrDefault();

            DatosConfig.DataSource = config;
            PageHeight             = 520 + (33 * ((Cotizacion)DatosInforme.DataSource).Tables[1].Rows.Count);
        }
        private void btnAgregarPrenda_Click(object sender, EventArgs e)
        {
            if (Convert.ToDecimal(txtAvaluo.EditValue) == 0M)
            {
                return;
            }
            if (cboTipoPrenda.Text == "Dolares")
            {
                decimal precio =
                    new EmpeñosDC(new clsConeccionDB().StringConn()).Configuraciones.First().PrecioCompraDolar;
                _dtArticulos.Rows.Add(new[]
                                      { cboTipoPrenda.Text, txtPesoEmpenio.EditValue, precio, txtAvaluo.EditValue });
            }
            else
            {
                decimal precio =
                    new EmpeñosDC(new clsConeccionDB().StringConn()).Precios.First(
                        p => p.Tipo == cboTipoPrenda.Text).Compra;
                _dtArticulos.Rows.Add(new[] { cboTipoPrenda.Text, txtPesoEmpenio.EditValue, precio, txtAvaluo.EditValue });
            }

            new ManejadorControles().LimpiarControles(txtPesoEmpenio);
            cboTipoPrenda.EditValue = cboTipoPrenda.Properties.GetDataSourceValue(cboTipoPrenda.Properties.ValueMember, 0);
            cboTipoPrenda.Focus();
            txtTotalCompra.EditValue = _dtArticulos.Rows.Cast <DataRow>().Aggregate <DataRow, decimal>(0M, (current, row) => current + (decimal)row["ImporteArticulo"]);
        }
Exemple #9
0
        private void xrTableCell11_EvaluateBinding(object sender, BindingEventArgs e)
        {
            Venta vent =
                new EmpeñosDC(new clsConeccionDB().StringConn()).Ventas.Single(c => c.Clave == Convert.ToInt32(e.Value));

            e.Value = vent.Saldo - vent.PagosVentas.Where(pv => pv.Estado).Sum(pv => pv.Abono);
        }
Exemple #10
0
        private void rptFinanciamientos_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            var prestamos =
                new EmpeñosDC(new clsConeccionDB().StringConn()).Prestamos.Where(
                    finan => finan.Estado == "Vigente").Select(finan => finan);

            DatosInforme.DataSource = prestamos;
        }
        private void ImprimirNotaCompra()
        {
            Configuracione empre = new EmpeñosDC(new clsConeccionDB().StringConn()).Configuraciones.First();

            string empresa     = new clsModificarConfiguracion().configGetValue("Empresa");
            string razonSocial = new clsModificarConfiguracion().configGetValue("RazonSocial");
            string rfc         = new clsModificarConfiguracion().configGetValue("RFC");
            string curp        = new clsModificarConfiguracion().configGetValue("CURP");
            string dirc        = String.Format("{0} CP {1}", empre.Direccion, empre.CodigoPostal);
            int    padRe       = ((40 - empresa.Length) / 2) + empresa.Length;
            int    padRrs      = ((40 - razonSocial.Length) / 2) + razonSocial.Length;
            int    padRrfc     = ((40 - rfc.Length) / 2) + rfc.Length;
            int    padRcurp    = ((40 - curp.Length) / 2) + curp.Length;

            Ticket ticket = new Ticket(5);

            ticket.AddHeaderLine("            CASA  DE  EMPEÑOS           ");
            ticket.AddHeaderLine("                                        ");
            ticket.AddHeaderLine(empresa.PadLeft(padRe));
            ticket.AddHeaderLine(razonSocial.PadLeft(padRrs));
            ticket.AddHeaderLine(rfc.PadLeft(padRrfc));
            ticket.AddHeaderLine(curp.PadLeft(padRcurp));
            if (dirc.Length > 40)
            {
                int currentChar = 0;
                int itemLenght  = dirc.Length;

                while (itemLenght > 40)
                {
                    ticket.AddHeaderLine(dirc.Substring(currentChar, 40));
                    currentChar += 40;
                    itemLenght  -= 40;
                }
                ticket.AddHeaderLine(dirc.Substring(currentChar));
            }
            else
            {
                ticket.AddHeaderLine(dirc);
            }
            ticket.AddHeaderLine(empre.Municipio);
            ticket.AddHeaderLine("             TICKET DE VENTA            ");
            Usuario usu = new EmpeñosDC(new clsConeccionDB().StringConn()).Usuarios.Single(u => u.CveUsuario == Convert.ToInt32(new clsModificarConfiguracion().configGetValue("IDUsuarioApp")));

            ticket.AddSubHeaderLine("ATENDIO: " + usu.Nombre);
            ticket.AddSubHeaderLine("FOLIO COMPRA: " + txtCveCompra.Text);
            ticket.AddSubHeaderLine(String.Format("FECHA VENTA: {0} {1}", DateTime.Today.ToString("dd/MMM/yyyy"), DateTime.Now.ToShortTimeString()));

            foreach (DataRow pRow in _dtArticulos.Rows)
            {
                ticket.AddItem(pRow[1].ToString(), SacarTipo(pRow[0].ToString()), Convert.ToDecimal(pRow[2]).ToString("C"), Convert.ToDecimal(pRow[3]).ToString("C"), "");
            }
            ticket.AddTotal("TOTAL VENTA: ", Convert.ToDecimal(txtTotalCompra.EditValue).ToString("C"));
            ticket.AddFooterLine("");
            ticket.AddFooterLine("");
            ticket.AddFooterLine("");
            ticket.AddFooterLine("");
            ticket.PrintTicket(new clsModificarConfiguracion().configGetValue("ImpresoraTickets"));
        }
Exemple #12
0
        private void xr24_SummaryGetResult(object sender, SummaryGetResultEventArgs e)
        {
            decimal valor =
                new EmpeñosDC(new clsConeccionDB().StringConn()).Articulos.Where(
                    v => v.Kilates == "Oro 24Kt" && (v.FechaRegistro >= Convert.ToDateTime(FechaInicial.Value) && v.FechaRegistro <= Convert.ToDateTime(FechaFinal.Value)) && v.Estado != "Baja").Sum(v => (decimal?)v.Peso) ??
                0;

            e.Result  = valor;
            e.Handled = true;
        }
Exemple #13
0
        private void xr22_SummaryGetResult(object sender, SummaryGetResultEventArgs e)
        {
            decimal valor =
                new EmpeñosDC(new clsConeccionDB().StringConn()).Articulos.Where(
                    v => v.Kilates == "Oro 22Kt" && v.FechaRegistro == DateTime.Today.Date && v.Estado != "Baja").Sum(v => (decimal?)v.Peso) ??
                0;

            e.Result  = valor;
            e.Handled = true;
        }
        public static bool  CajaEstado()
        {
            var caj = new EmpeñosDC(new clsConeccionDB().StringConn()).Cajas.SingleOrDefault(
                c => c.FechaCajaAbierto.Date == DateTime.Today.Date);

            if (caj != null)
            {
                return(caj.Estado);
            }
            return(true);
        }
        private bool VericarHorario()
        {
            string  dia = DateTime.Today.Date.ToString("dddd");
            Horario hr  = new EmpeñosDC(new clsConeccionDB().StringConn()).Horarios.SingleOrDefault(h => h.Dia == dia);

            if (hr != null && ((TimeSpan.Compare(DateTime.Now.TimeOfDay, hr.HoraInicial.TimeOfDay) >= 0) &&
                               (TimeSpan.Compare(DateTime.Now.TimeOfDay, hr.HoraFinal.TimeOfDay) <= 0)))
            {
                return(true);
            }
            return(false);
        }
Exemple #16
0
        private void xrLabel4_SummaryGetResult(object sender, SummaryGetResultEventArgs e)
        {
            decimal ventas =
                new EmpeñosDC(new clsConeccionDB().StringConn()).Ventas.Where(a => a.Estado == "Apartado" &&
                                                                              a.FechaVenta.AddMonths(
                                                                                  Convert.ToInt32(new clsModificarConfiguracion().configGetValue("VencimientoApartado"))).Date <
                                                                              DateTime.Today.Date)
                .Select(v => new { saldo = v.Saldo - v.PagosVentas.Where(p => p.Estado).Sum(p => p.Abono) }).Sum(arg => arg.saldo);

            e.Result  = ventas;
            e.Handled = true;
        }
        private void CreditoDevuelto(string clave)
        {
            Nuevo();
            FinancieraCredito credito = new EmpeñosDC(new clsConeccionDB().StringConn()).FinancieraCreditos.Single(cre => cre.Clave == Convert.ToInt32(clave));

            txtCveCredito.EditValue      = credito.Clave;
            dtpFechaCredito.EditValue    = credito.FechaModificacion;
            txtPlazo.EditValue           = credito.Plazos;
            txtNumPlazos.EditValue       = credito.NumeroPlazos;
            dtpFechaInicio.EditValue     = credito.FechaInicio;
            dtpFechaFinal.EditValue      = credito.FechaFinal;
            txtCantidadCredito.EditValue = credito.Prestamo;
            txtSaldoCredito.EditValue    = credito.SaldoActual;
            txtMontoPago.EditValue       = credito.Pago;
            txtBase.EditValue            = credito.Base;
            txtCveGrupo.EditValue        = credito.CveGrupo;
            txtNombreGrupo.EditValue     = credito.FinancieraGrupo.Nombre;
            var detgpo = new EmpeñosDC(new clsConeccionDB().StringConn()).FinancieraGruposDetalles.Where(det => det.CveGrupo == credito.CveGrupo)
                         .Select(det => new { det.FinancieraCliente.Nombre, det.Aprobado, det.Base, det.Tipo });

            txtLetrasRestantes.EditValue = (credito.NumeroPlazos - credito.FinancieraPagos.Count(c => c.Estado));
            gridIntegrantes.DataSource   = detgpo;
            if (credito.Estado == "Pagado" || credito.Estado == "Cancelado")
            {
                MessageBox.Show("Crédito " + credito.Estado, Application.ProductName);
                botonGuardar.Enabled = false;
                return;
            }
            grvIntegrantes.Columns[1].DisplayFormat.FormatType   = FormatType.Numeric;
            grvIntegrantes.Columns[1].DisplayFormat.FormatString = "$ #,##0.00";
            grvIntegrantes.Columns[2].DisplayFormat.FormatType   = FormatType.Numeric;
            grvIntegrantes.Columns[2].DisplayFormat.FormatString = "$ #,##0.00";

            CalcularPago(credito.FinancieraPagos.Count(c => c.Estado));
            gridPagos.DataSource = _dTpagos;
            grvPagos.Columns[0].AppearanceCell.TextOptions.HAlignment = HorzAlignment.Center;
            grvPagos.Columns[1].AppearanceCell.TextOptions.HAlignment = HorzAlignment.Center;
            grvPagos.Columns[1].DisplayFormat.FormatType   = FormatType.DateTime;
            grvPagos.Columns[1].DisplayFormat.FormatString = "dd-MMM-yyyy";
            grvPagos.Columns[2].DisplayFormat.FormatType   = FormatType.Numeric;
            grvPagos.Columns[2].DisplayFormat.FormatString = "$ #,##0.00";
            grvPagos.Columns[3].DisplayFormat.FormatType   = FormatType.Numeric;
            grvPagos.Columns[3].DisplayFormat.FormatString = "$ #,##0.00";
            grvPagos.Columns[4].DisplayFormat.FormatType   = FormatType.Numeric;
            grvPagos.Columns[4].DisplayFormat.FormatString = "$ #,##0.00";
            grvPagos.Columns[0].Width = 50;
            grvPagos.Columns["Pagar"].BestFit();
            grvPagos.Columns[0].OptionsColumn.AllowEdit = false;
            grvPagos.Columns[1].OptionsColumn.AllowEdit = false;
            grvPagos.Columns[2].OptionsColumn.AllowEdit = false;
            grvPagos.Columns[3].OptionsColumn.AllowEdit = false;
            grvPagos.Columns[4].OptionsColumn.AllowEdit = false;
        }
        private void GuardarArticulo_Click(object sender, EventArgs e)
        {
            try
            {
                if (!ClsVerificarCaja.CajaEstado())
                {
                    XtraMessageBox.Show("La Caja del Dia de hoy ya se ha cerrado\n SISTEMA BLOQUEADO", "Caja Cerrada",
                                        MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Application.Exit();
                }
                if ((int)txtClave.EditValue == 0)
                {
                    var art = new Articulo
                    {
                        Descripcion   = txtDescripcion.Text,
                        Peso          = Convert.ToDecimal(txtPeso.EditValue),
                        Kilates       = cboTipo.Text,
                        Precio        = Convert.ToDecimal(txtPrecio.EditValue),
                        PrecioCredito = Convert.ToDecimal(txtPrecioApartado.EditValue),
                        FechaRegistro = DateTime.Today.Date,
                        Estado        = "Disponible",
                        CveUsuario    = Convert.ToInt32(new clsModificarConfiguracion().configGetValue("IDUsuarioApp"))
                    };

                    txtClave.EditValue = new LogicaArticulos().InsertarArticulo(art);
                }
                else
                {
                    var      original = new EmpeñosDC(new clsConeccionDB().StringConn()).Articulos.Single(a => a.Clave == Convert.ToInt32(txtClave.EditValue));
                    Articulo art      = new Articulo
                    {
                        Clave         = original.Clave,
                        Descripcion   = txtDescripcion.Text,
                        Peso          = Convert.ToDecimal(txtPeso.EditValue),
                        Kilates       = cboTipo.Text,
                        Precio        = Convert.ToDecimal(txtPrecio.EditValue),
                        PrecioCredito = Convert.ToDecimal(txtPrecioApartado.EditValue),
                        FechaRegistro = Convert.ToDateTime(dtpFechaRegistro.EditValue).Date,
                        Estado        = original.Estado,
                        CveUsuario    = Convert.ToInt32(new clsModificarConfiguracion().configGetValue("IDUsuarioApp")),
                    };
                    new LogicaArticulos().ActualizarArticulo(art, original);
                } XtraMessageBox.Show("Articulo Guardado");
                new ManejadorControles().DesectivarTextBox(gpoContenedor, false);
                LlenargridArticulos();
            }
            catch (ValidationException vex)
            {
                XtraMessageBox.Show(vex.Message, "Validación de Datos", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
        private void txtPesoEmpenio_EditValueChanged(object sender, EventArgs e)
        {
            if (cboTipoPrenda.Text == "Dolares")
            {
                txtAvaluo.EditValue = _entidades.Configuraciones.First().PrecioCompraDolar *Convert.ToDecimal(txtPesoEmpenio.EditValue);
                return;
            }
            decimal precio =
                new EmpeñosDC(new clsConeccionDB().StringConn()).Precios.Single(
                    p => p.Tipo == cboTipoPrenda.Text).Compra;

            txtAvaluo.EditValue = precio *
                                  Convert.ToDecimal(txtPesoEmpenio.EditValue);
        }
Exemple #20
0
 private void CalcularAvaluo()
 {
     if (cboTipoPrenda.EditValue != null && Convert.ToDecimal(cboTipoPrenda.EditValue) < 9)
     {
         decimal precio =
             new EmpeñosDC(new clsConeccionDB().StringConn()).Precios.Single(
                 p => p.Tipo == cboTipoPrenda.Text).Empeño;
         txtAvaluo.EditValue = precio *
                               Convert.ToDecimal(txtPesoEmpenio.EditValue);
     }
     else
     {
         txtAvaluo.EditValue           = 0;
         txtAvaluo.Properties.ReadOnly = false;
     }
 }
        private void rptEmpeñosVigentes_ItemClick(object sender, ItemClickEventArgs e)
        {
            var bol = new EmpeñosDC(new clsConeccionDB().StringConn()).Boletas.Where(b => b.EstadoBoleta == "Vigente");

            if (bol.Any())
            {
                XrptEmpeñosVigentes rptbol = new XrptEmpeñosVigentes {
                    DataSource = bol
                };
                rptbol.ShowPreviewDialog();
            }
            else
            {
                XtraMessageBox.Show("No Hay Suficientes datos para mostrar el reporte", "Registros 0");
            }
        }
        private void rptEtiquetas_ItemClick(object sender, ItemClickEventArgs e)
        {
            var cod = new EmpeñosDC(new clsConeccionDB().StringConn()).Boletas.Where(b => b.FechaPrestamo == DateTime.Today.Date);

            if (cod.Any())
            {
                XrptCodigoBarras rptbol = new XrptCodigoBarras {
                    DataSource = cod
                };
                rptbol.ShowPreviewDialog();
            }
            else
            {
                XtraMessageBox.Show("No Hay Suficientes datos para mostrar el reporte", "Registros 0");
            }
        }
        private void rptCompras_ItemClick(object sender, ItemClickEventArgs e)
        {
            var com = new EmpeñosDC(new clsConeccionDB().StringConn()).Compras.Where(b => b.FechaCompra == DateTime.Today && b.Estado == true);

            if (com.Any())
            {
                XrptComprasDia rptbol = new XrptComprasDia {
                    DataSource = com
                };
                rptbol.ShowPreviewDialog();
            }
            else
            {
                XtraMessageBox.Show("No Hay Suficientes datos para mostrar el reporte", "Registros 0");
            }
        }
        private void rptPagosCreditos_ItemClick(object sender, ItemClickEventArgs e)
        {
            var dep = new EmpeñosDC(new clsConeccionDB().StringConn()).FinancieraPagos.Where(b => b.FechaPago == DateTime.Today && b.Estado);

            if (dep.Any())
            {
                XrptPagosCreditos rptbol = new XrptPagosCreditos
                {
                    DataSource = dep,
                };
                rptbol.ShowPreviewDialog();
            }
            else
            {
                XtraMessageBox.Show("No Hay Suficientes datos para mostrar el reporte", "Registros 0");
            }
        }
        private void rptArticulosDisponibles_ItemClick(object sender, ItemClickEventArgs e)
        {
            var art = new EmpeñosDC(new clsConeccionDB().StringConn()).Articulos.Where(
                v => v.Estado == "Disponible");

            if (art.Any())
            {
                XrptArticulosDisponibles articulos = new XrptArticulosDisponibles {
                    DataSource = art
                };
                articulos.ShowPreviewDialog();
            }
            else
            {
                XtraMessageBox.Show("No hay suficientes datos para mostrar el reporte", "Registros 0");
            }
        }
        private void rptFinanciamientosActivos_ItemClick(object sender, ItemClickEventArgs e)
        {
            var fin = new EmpeñosDC(new clsConeccionDB().StringConn()).Prestamos.Where(
                v => v.Estado == "Vigente");

            if (fin.Any())
            {
                XrptFinanciamientosActivos abo = new XrptFinanciamientosActivos {
                    DataSource = fin
                };
                abo.ShowPreviewDialog();
            }
            else
            {
                XtraMessageBox.Show("No hay suficientes datos para mostrar el reporte", "Registros 0");
            }
        }
        private void rptPagos_ItemClick(object sender, ItemClickEventArgs e)
        {
            var abonos = new EmpeñosDC(new clsConeccionDB().StringConn()).PagosFinanciamientos.Where(
                v => v.FechaPago == DateTime.Today.Date && v.Estado);

            if (abonos.Any())
            {
                XrptPagosFinanciamiento abo = new XrptPagosFinanciamiento {
                    DataSource = abonos
                };
                abo.ShowPreviewDialog();
            }
            else
            {
                XtraMessageBox.Show("No hay suficientes datos para mostrar el reporte", "Registros 0");
            }
        }
        private void rptVentas_ItemClick(object sender, ItemClickEventArgs e)
        {
            var vent = new EmpeñosDC(new clsConeccionDB().StringConn()).Ventas.Where(
                v => v.FechaVenta == DateTime.Today.Date && v.Estado != "Cancelado");

            if (vent.Any())
            {
                XrptVentasDia articulos = new XrptVentasDia {
                    DataSource = vent
                };
                articulos.ShowPreviewDialog();
            }
            else
            {
                XtraMessageBox.Show("No hay suficientes datos para mostrar el reporte", "Registros 0");
            }
        }
        private void rptIngresos_ItemClick(object sender, ItemClickEventArgs e)
        {
            var art = new EmpeñosDC(new clsConeccionDB().StringConn()).Articulos.Where(
                v => v.FechaRegistro == DateTime.Today.Date && v.Estado != "Baja");

            if (art.Any())
            {
                XrptIngresoArticulos articulos = new XrptIngresoArticulos {
                    DataSource = art
                };
                articulos.ShowPreviewDialog();
            }
            else
            {
                XtraMessageBox.Show("No hay suficientes datos para mostrar el reporte", "Registros 0");
            }
        }
        private void rptCancelaciones_ItemClick(object sender, ItemClickEventArgs e)
        {
            var canc = new EmpeñosDC(new clsConeccionDB().StringConn()).Cancelaciones.Where(
                v => v.FechaCancelacion == DateTime.Today.Date);

            if (canc.Any())
            {
                XrptCancelaciones articulos = new XrptCancelaciones {
                    DataSource = canc
                };
                articulos.ShowPreviewDialog();
            }
            else
            {
                XtraMessageBox.Show("No hay suficientes datos para mostrar el reporte", "Registros 0");
            }
        }