Esempio n. 1
0
 public Profile GetMyProfile(string userId, string token)
 {
     int uId = Convert.ToInt32(userId);
     if (AuthService.ValidateAuthData(uId, token))
     {
         FoursquareOAuth fsqOAuth = new FoursquareOAuth(token);
         Profile res = fsqOAuth.GetProfileInfo(uId);
         return res;
     }
     return null;
 }
Esempio n. 2
0
 //
 // GET: /Profile/
 public NameValueCollection GetProfileInfo(int targetId)
 {
     string token = GetCurrentUserToken();
     Logic.FoursquareOAuth FSQOAuth = new FoursquareOAuth(token);
     Profile pf = FSQOAuth.GetProfileInfo(targetId);
     Models.FoursquareUserContext db = new FoursquareUserContext();
     int userID = FSQOAuth.GetUserId();
     FoursquareUserModel um = db.FoursquareUsers.Find(userID);
     NameValueCollection nv = pf.getInfo(true);
     nv["isPremium"] = um.IsPremium.ToString();
     return nv;
 }
Esempio n. 3
0
        public Profile GetProfile(string userId, string token, string targetId)
        {
            int uId = Convert.ToInt32(userId);
            int tId = Convert.ToInt32(targetId);

            if (AuthService.ValidateAuthData(uId, token))
            {
                FoursquareUserContext dbContext = new FoursquareUserContext();
                IMessageRepository repository = new MessageRepository(dbContext);
                FoursquareOAuth fsqOAuth = new FoursquareOAuth(token);
                if (fsqOAuth.CheckForFriendship(tId))
                {
                    Profile res = fsqOAuth.GetProfileInfo(tId);
                    return res;
                }

            }
            return null;
        }