Ejemplo n.º 1
0
        private void Dispatch()
        {
            MejoresPuntasOfertaEntity ofertaEntity = null;

            while (this.ofertasQueue.TryTake(out ofertaEntity, -1))
            {
                FixDAL.InsertarOferta20Min(ofertaEntity);
            }
        }
Ejemplo n.º 2
0
        public static void InsertarOferta20Min(MejoresPuntasOfertaEntity mejorPunta)
        {
            List <SqlParameter> lista = new List <SqlParameter>();

            lista.Add(SqlServerHelper.GetParam("@IdProducto", mejorPunta.IdProducto));
            lista.Add(SqlServerHelper.GetParam("@IdMoneda", mejorPunta.IdMoneda));
            lista.Add(SqlServerHelper.GetParam("@PrecioCompra", mejorPunta.PrecioCompra));
            lista.Add(SqlServerHelper.GetParam("@PrecioVenta", mejorPunta.PrecioVenta));
            lista.Add(SqlServerHelper.GetParam("@FechaHoy", DateTime.Now));
            lista.Add(SqlServerHelper.GetParam("@IdPlazo", mejorPunta.IdPlazo));
            lista.Add(SqlServerHelper.GetParam("@IdMercado", mejorPunta.IdMercado));
            lista.Add(SqlServerHelper.GetParam("@Rueda", mejorPunta.Rueda));
            SqlServerHelper.ExecuteNonQuery("precios_owner.HIS_ActualizarOfertas20Min", lista);
        }
Ejemplo n.º 3
0
        public void EncolarMejorOferta20Minutos(byte idMercado, byte idMoneda, int idProducto, byte tipoPlazoLiquidacionOrden, FixOfertasEntity ofertas)
        {
            MejoresPuntasOfertaEntity MPO = new MejoresPuntasOfertaEntity();

            MPO.IdMercado  = idMercado;
            MPO.IdMoneda   = idMoneda;
            MPO.IdProducto = idProducto;
            MPO.IdPlazo    = tipoPlazoLiquidacionOrden;
            FixOfertaEntity oferta = ofertas.Ofertas.Find(x => x.NumeroPosicion == 1 && x.TipoOferta == FixTipoEntradaEnum.Bid);

            MPO.PrecioCompra = oferta?.Precio;
            oferta           = ofertas.Ofertas.Find(x => x.NumeroPosicion == 1 && x.TipoOferta == FixTipoEntradaEnum.Offer);
            MPO.PrecioVenta  = oferta?.Precio;
            MPO.Rueda        = CachingManager.Instance.GetProductoById(idProducto).Rueda;
            OfertasHelperService.Instance.EnQueueMessage(MPO);
        }
Ejemplo n.º 4
0
 public void EnQueueMessage(MejoresPuntasOfertaEntity ofertaEntity)
 {
     this.ofertasQueue.Add(ofertaEntity);
 }