public JsonResult getRegionAds(int id)
 {
     //Need to filter by AdID
     RegionMap rm = new RegionMap();
     List<AddsHistory> Ad = InitData.lstAddsHistory.Where(kvp => kvp.ID == id).ToList<AddsHistory>();
     //rm.AdId = InitData.lstAdds[0].AdId;
     rm.region = Ad[0].Region;
     rm.hits = Ad[0].Views;
     return Json(rm);
 }
Пример #2
0
        public JsonResult getRegionAds(int id)
        {
            //Need to filter by AdID
            List<RegionMap> rmList = new List<RegionMap>();
            RegionMap rm = new RegionMap();
            //List<AddsHistory> Ad = InitData.lstAddsHistory.Where(kvp => kvp.ID == id).ToList<AddsHistory>();
            List<AddsHistory> Ad = InitData.lstAddsHistory;
            //rm.AdId = InitData.lstAdds[0].AdId;
            //rm.region = Ad[0].Region;
            //rm.hits = Ad[0].Views;

            #region test data
            rm.region = "California";
            rm.hits = 233;
            rmList.Add(rm);

            rm = new RegionMap();
            rm.region = "Texas";
            rm.hits = 319;
            rmList.Add(rm);

            rm = new RegionMap();
            rm.region = "New York";
            rm.hits = 386;
            rmList.Add(rm);
            #endregion

            return Json(rmList);
        }