Esempio n. 1
0
 public static bool IsOrganizedByFriendOfFriend(this Event e, Account account, IDataService ds)
 {
     var s = new EventOrganizedByFriendOfFriendQuery(account);
     var q = s.GetQuery().Clone()
             .JoinQueryOver<Account>(c => c.Organizers)
             .Where(a => a == account);
     return ds.Event.ExecuteQuery(q).RowCount() > 0;
 }
Esempio n. 2
0
        public PromotionInstance(Account sender, Account recipient, Promotion ev, Deal deal, string message)
        {
            this.Sender = sender;

            this.Promotion = ev;
            this.Deal = deal;
            this.Recipient = recipient;
            this.Message = message;
            this.CreateDateTime = DateTime.UtcNow;
            // by default response is null
            this.Status = new PromotionInstanceStatus();
        }
Esempio n. 3
0
 public static Account GetAccount(string firstName, string lastName)
 {
     var a = new Account()
     {
         FirstName = firstName,
         LastName = lastName,
         UserName = GetUserName(firstName, lastName)
     };
     a.FacebookLogon = GetFacebookLogon();
     a.Email = String.Format("{0}@example.com", a.UserName);
     a.Address = GetRandomAddress();
     return a;
 }
Esempio n. 4
0
        public void Init()
        {
            myself = EntityHelper.GetAccount("mySelf", "lastName");
            friend = EntityHelper.GetAccount("friend", "lastName");
            friend2 = EntityHelper.GetAccount("friend2", "lastName");
            friend3 = EntityHelper.GetAccount("friend3", "lastName");
            friend4 = EntityHelper.GetAccount("friend4", "lastName");

            myself.Connections = new Connection[] { new Connection(myself.FacebookLogon.FacebookId, friend.FacebookLogon.FacebookId), new Connection(myself.FacebookLogon.FacebookId, friend2.FacebookLogon.FacebookId) };
            friend.Connections = new Connection[] { new Connection(friend.FacebookLogon.FacebookId, myself.FacebookLogon.FacebookId) };
            friend2.Connections = new Connection[] { new Connection(friend2.FacebookLogon.FacebookId, myself.FacebookLogon.FacebookId), new Connection(friend2.FacebookLogon.FacebookId, friend.FacebookLogon.FacebookId), new Connection(friend2.FacebookLogon.FacebookId, friend3.FacebookLogon.FacebookId) };
            friend3.Connections = new Connection[] { new Connection(friend3.FacebookLogon.FacebookId, friend2.FacebookLogon.FacebookId), new Connection(friend3.FacebookLogon.FacebookId, friend4.FacebookLogon.FacebookId) };
            friend4.Connections = new Connection[] { new Connection(friend4.FacebookLogon.FacebookId, friend3.FacebookLogon.FacebookId) };
        }
Esempio n. 5
0
        public void GenerateJson()
        {
            Account acc1 = new Account();
            acc1.UserName = "******";
            acc1.ImageUrl = "FOO BAR";

            Account acc2 = new Account();
            acc2.UserName = "******";
            acc2.ImageUrl = "FOO BAR";

            List<Account> la = new List<Account>();
            la.Add(acc1);
            la.Add(acc2);

            AccountListJson alj = new AccountListJson(la);
            string x = alj.DisplayJSON();
            JavaScriptSerializer jss = new JavaScriptSerializer();
            IEnumerable<AccountListJson.UserJson> alj2 = jss.Deserialize<AccountListJson.UserJson[]>(x);
        }
Esempio n. 6
0
 public static bool IsFriendOfFriend(this Account account, Account ab, IDataService ds)
 {
     var q = new ConnectionIsFriendOfFriendQuery(account, ab);
     return ds.Connection.ExecuteQuery(q).RowCount() > 0;
 }
Esempio n. 7
0
 public BusinessUser(Account user, Role role)
 {
     this.User = user;
     this.Role = role;
 }
Esempio n. 8
0
 private void SetActionsAccount(Account account)
 {
     this.EventActions.Account = account;
 }
Esempio n. 9
0
        public void GetFacebookLoginInformation(string id)
        {
            FacebookClient fc = new FacebookClient(FacebookWebContext.Current.AccessToken);

            dynamic json = fc.Get(id);
            // need to instantiate a new account for this user
            this.Account = new Account();
            HydrateUserFromJson(json);
        }