Beispiel #1
0
        private MarketStatusItemViewModel MapMarketStatusTopGainers(MarketStatusModel source, MarketStatusModel[] arr)
        {
            var item = Mapper.Map <MarketStatusItemViewModel>(source);

            item.Badge      = arr.Any(a => a.StockCode == source.StockCode) ? "most-active" : string.Empty;
            item.BadgeClass = !string.IsNullOrEmpty(item.Badge) ? "default" : string.Empty;
            return(item);
        }
Beispiel #2
0
        private MarketStatusItemViewModel MapMarketStatusMostActive(MarketStatusModel source, MarketStatus status)
        {
            var item = Mapper.Map <MarketStatusItemViewModel>(source);

            item.Badge      = status.TopGainer.Any(a => a.StockCode == source.StockCode) ? "top-gainer" : string.Empty;
            item.BadgeClass = !string.IsNullOrEmpty(item.Badge) ? "success" : string.Empty;

            if (string.IsNullOrEmpty(item.Badge))
            {
                item.Badge      = status.TopLoser.Any(a => a.StockCode == source.StockCode) ? "top-loser" : string.Empty;
                item.BadgeClass = !string.IsNullOrEmpty(item.Badge) ? "danger" : string.Empty;
            }


            return(item);
        }