Exemplo n.º 1
0
        public ProfilePageModel.RootObject parseData(String json)
        {
            JavaScriptSerializer js = new JavaScriptSerializer();

            ProfilePageModel.RootObject model = js.Deserialize <ProfilePageModel.RootObject>(json);
            return(model);
        }
Exemplo n.º 2
0
 private void getPackageInfo(String fbId, int packId)
 {
     using (var pack = new TourCrowDBEntities())
     {
         var pck_id    = from p in pack.USER_PACKAGE where p.PackageID == packId select p.PlaceID;
         var pck_count = pck_id.ToList();
         ViewBag.pck_count = pck_id.Count();
         List <string> pname = new List <string>();
         List <string> padd  = new List <string>();
         List <string> pimg  = new List <string>();
         int           i     = 0;
         foreach (var placeId in pck_count)
         {
             String json = place_details(placeId);
             ProfilePageModel.RootObject model = parseData(json);
             pname.Add(model.result.name);
             padd.Add(model.result.formatted_address);
             pimg.Add(model.result.photos[0].photo_reference);
             i++;
         }
         ViewBag.pname = pname;
         ViewBag.padd  = padd;
         ViewBag.pimg  = pimg;
     }
 }