示例#1
0
        public ActionResult BoxBanner(byte priority = 2)
        {
            if (priority == (byte)Globals.PriorityBanner.RightAngle)
            {
                if (Request.Cookies[_cookieName] != null)
                {
                    return(null);
                }

                //CreateCookie();
            }

            var banners = new BannerController().ListBannerByPriority(priority, _isClearCache);

            if (banners == null || banners.Count == 0)
            {
                return(null);
            }

            if (priority == (byte)Globals.PriorityBanner.Rating)
            {
                var tmp      = banners.ToArray();
                var bannerId = tmp[_rd.Next(0, tmp.Length)].BannerId;
                return(PartialView(banners.Where(p => p.BannerId == bannerId).ToList()));
            }
            return(PartialView(banners));
        }