Пример #1
0
        private void LocationActions(NameValueCollection QueryString,FacebookLayer fb)
        {
            Database db = new Database();
            SocialerMapDBObject obj = new SocialerMapDBObject();

            if (QueryString["action"] == "delete")
            {
                obj.LocationID = Request.QueryString["locationID"];
                db.deleteSocialerObj(obj);
            }
            else if (QueryString["action"] == "add")
            {
                obj.Fid = fb.user.facebookID;
                obj.Date = Request.QueryString["Date"];
                obj.Latitude = Request.QueryString["Latitude"];
                obj.Longitude = Request.QueryString["Longitude"];
                obj.postToWall = Convert.ToBoolean(Request.QueryString["postwall"]);
                obj.Desc = Request.QueryString["description"];
                db.InsertSocialerObj(obj);
                if (obj.postToWall)
                {
                    dynamic parameters = new ExpandoObject();
                    parameters.message = "Checked in via SocialerMap";
                    parameters.link = "www.socialermap.com/default.aspx?fid=" + fb.user.facebookID;
                    parameters.name = QueryString["description"];
                    parameters.privacy = new
                    {
                        value = "ALL_FRIENDS",
                    };
                    fb.fbClient.Post("/me/feed", parameters);
                }
            }
        }
Пример #2
0
 private void LocationActions(NameValueCollection QueryString, FacebookLayer fb)
 {
     Database db = new Database();
     SocialerMapDbObject obj = new SocialerMapDbObject();
     switch (QueryString["action"])
     {
         case "delete":
             obj.LocationId = Request.QueryString["locationID"];
             db.DeleteSocialerObj(obj, fb.User.FacebookId);
             break;
         case "add":
             obj.UserId = fb.User.FacebookId;
             obj.Date = Request.QueryString["Date"];
             obj.Latitude = Request.QueryString["Latitude"];
             obj.Longitude = Request.QueryString["Longitude"];
             obj.PostToWall = Convert.ToBoolean(Request.QueryString["postwall"]);
             obj.Desc = Request.QueryString["description"];
             obj.Common = Convert.ToBoolean(Request.QueryString["common"]);
             string locationID = db.InsertSocialerObj(obj);
             if (obj.PostToWall)
             {
                 dynamic parameters = new ExpandoObject();
                 parameters.message = "Checked in via SocialerMap";
                 parameters.link = "http://apps.facebook.com/socialermapfbapp/Default.aspx?locationID=" +
                                   locationID;
                 parameters.name = QueryString["description"];
                 parameters.picture = "http://www.socialermap.com/socialermapfbapp/Resources/icon.png";
                 parameters.caption = "Find where i am at " + obj.Date;
                 parameters.privacy = new
                     {
                     value = "ALL_FRIENDS",
                 };
                 fb.fbClient.Post("/me/feed", parameters);
             }
             break;
     }
 }