Ejemplo n.º 1
0
 public ShowPosts(Users user, ForumV2Entities f)
 {
     forumEntities = f; 
     curUser = user;
     InitializeComponent();
     this.Title = "Messages: " + user.UserName;
     int privForumID = (from q in forumEntities.Forum
                        where q.ForumName == "usersprivateforum"
                        select q.ForumID).First();
     var posts = from q in forumEntities.Post
                 where q.UserId == curUser.UserId && q.ForumID != privForumID
                 select q;
     ObservableCollection<Post> col = new ObservableCollection<Post>(posts);
     dataGrid1.ItemsSource = col;
 }
Ejemplo n.º 2
0
 public ShowUserProfile(Users LogUser,Users selectUser, ForumV2Entities forum, CDatabase db)
 {
     LoginedUser = LogUser;
     curUser = selectUser;
     forumEntities = forum;
     DB = db;
     InitializeComponent();
     foreach (Roles r in forumEntities.Roles)
     {
         switch (r.RoleName)
         {
             case "Admin": RoleAdminID = r.RoleId; break;
             case "Moderator": RoleModerID = r.RoleId; break;
             case "LockedUser": RoleBannedID = r.RoleId; break;
         }
     }
     FillProfile();
 }
Ejemplo n.º 3
0
 public CDatabase(ForumV2Entities ForumEntities)
 {
     forumEntities = ForumEntities;
 }