示例#1
0
        public ActionResult ViewAd(string id)
        {
            var ad = AdRotator.GetAdById(id);

            if (ad != null)
            {
                bool addImpression = this.Request.QueryString["noimpression"] == null;
                if (addImpression)
                {
                    StoredProcs.AdImpressions_IncrementCount(ad.FileName, DateTime.Now.Date, 1).Execute();
                }
                return(File(ad.DiskPath, MimeMapping.GetMimeMapping(ad.DiskPath)));
            }

            Logger.Error("Invalid Ad attempted to be loaded from: /fblast/{0}", id);
            return(HttpNotFound());
        }