Esempio n. 1
0
        //
        // GET: /api/User/Get
        public Profile Get(Guid?id)
        {
            var profile = new Profile()
            {
                Identifier = id.HasValue ? id.Value : User.Identifier(),
            };

            var callerId = User.IdentifierSafe();

            return(profileCore.Search(profile, callerId));
        }
Esempio n. 2
0
        public override void Execute()
        {
            var facebook    = new FacebookCore();
            var profileCore = new ProfileCore();
            var emailCore   = new EmailCore();

            var profiles = profileCore.Search(null, null, null, true, short.MaxValue, int.MaxValue);

            foreach (var profile in profiles)
            {
                try
                {
                    var user = profileCore.SearchSingle <ProfileFull>(profile.Identifier, profile.Key, null, true);
                    if (!string.IsNullOrWhiteSpace(user.FacebookAccessToken) && Guid.Empty != user.Identifier)
                    {
                        var emails = facebook.ImportFriends(user);
                        foreach (var email in emails)
                        {
                            emailCore.NewFriend(email);
                        }
                    }

                    Thread.Sleep(500);
                }
                catch (Exception ex)
                {
                    Trace.WriteLine(ex.ToString());
                }
            }
        }
Esempio n. 3
0
        // GET:/Admin/GoingGlobal
        public ActionResult GoingGlobal()
        {
            var profiles = from p in profileCore.Search(null, null, null, true, short.MaxValue)
                           where p.Longitude != 0 && p.Latitude != 0
                           select p;

            return(View(profiles));
        }
Esempio n. 4
0
        /// <summary>
        /// /Profile/Search
        /// </summary>
        /// <param name="s">Search</param>
        /// <returns></returns>
        public ActionResult Index(string s, Guid?user)
        {
            var callerId = User.IdentifierSafe();

            if (user.HasValue && user.Value == callerId.Value)
            {
                return(RedirectToAction("friends", "dashboard"));
            }

            var results = new SearchResults <Profile>()
            {
                SearchDisplayText = s,
                Manifest          = profileCore.Search(s, user, callerId),
            };

            return(View(results));
        }