Esempio n. 1
0
        private void PersonsWhoComment(object sender, RoutedEventArgs e)
        {
            CommWindow main = new CommWindow(currentPost.Id, repository.GetUserId(PersonNickName), PersonNickName, PersonNickName2)
            {
                WindowStartupLocation = WindowStartupLocation.CenterScreen
            };

            main.ShowDialog();
            this.Close();
        }
Esempio n. 2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            uS.AddComment(Id1, Id2, tb1.Text);
            Posts posts = new Posts();

            posts = uS.GetPostsById(Id1);
            Comments comm = new Comments();

            comm.comm    = tb1.Text;
            comm.OwnerId = uR.GetUserId(Nick2);
            posts.comment.Add(comm);
            uS.UpdatePost(Id1, posts);
        }
Esempio n. 3
0
        public SearchWindow(string nick, string nick2)
        {
            InitializeComponent();
            PersonNickName  = nick;
            PersonNickName2 = nick2;
            //
            repository     = new UR();
            services       = new US();
            postServices   = new PS();
            postRepository = new PR();
            //
            user                = new User();
            user                = repository.GetUserByNick(PersonNickName);
            UserName.Content    = user.person.Name;
            UserSurname.Content = user.person.Surname;
            UserMail.Content    = user.person.Mail;
            //
            currentPost = new Posts();
            posts       = new List <Posts>();
            posts       = postRepository.GetPostsByUserId(repository.GetUserId(PersonNickName));
            if (posts != null && posts.Count > 0)
            {
                currentPost = posts[indexOfPost];

                DG1.ItemsSource = currentPost.comment;
                isAnyPosts      = true;
            }
            else
            {
                Main.Content = "No posts yet";
            }
            //
            if (tempLike)
            {
                btnLike.Background = Brushes.Green;
                tempLike           = true;
            }

            user = repository.GetUserByNick(PersonNickName2);
            if (services.CheckAlreadyFollow(user.Nick, PersonNickName))
            {
                btnFollow.Background = Brushes.Green;
            }
        }
Esempio n. 4
0
        public ucMyProfile(string nick)
        {
            this.Nick = nick;
            InitializeComponent();
            uR = new UR();
            pR = new PR();
            Posts pr = new Posts();
            User  ur = new User();

            ur = uR.GetUserByNick(Nick);


            List <string> List1 = new List <string>();
            List <string> List2 = new List <string>();

            List1 = ur.Followers;
            List2 = ur.Following;
            List <Posts> lis = new List <Posts>();

            lis = pR.GetPostsByUserId(uR.GetUserId(Nick));
            dataGridView1.ItemsSource = List1;
            dataGridView2.ItemsSource = List2;
            dataGridView3.ItemsSource = lis;
        }