public void AddFriend(string Username, string Friend) { User NewUser = this.GetUserByUsername(Username); User NewFriend = this.GetUserByUsername(Friend); Relation RL = new Relation(); RL.Userid = NewUser.userid; RL.FriendId = NewFriend.userid; DB.Relations.InsertOnSubmit(RL); DB.SubmitChanges(); Relation RL1 = new Relation(); RL1.Userid = NewFriend.userid; RL1.FriendId = NewUser.userid; DB.Relations.InsertOnSubmit(RL1); DB.SubmitChanges(); if (ClientCallBacks.ContainsKey(Friend)) { ClientCallBacks[Friend].UserLoggedin(Username); } }
private void detach_Relations(Relation entity) { this.SendPropertyChanging(); entity.user = null; }
private void attach_Relations(Relation entity) { this.SendPropertyChanging(); entity.user = this; }
partial void DeleteRelation(Relation instance);
partial void UpdateRelation(Relation instance);
partial void InsertRelation(Relation instance);