예제 #1
0
        private void MainForum_Loaded(object sender, RoutedEventArgs e)
        {
            DateTime now = DateTime.Now;

            ws = new kidmathwebserviceSoapClient();
            List <mainForum> dsbaiviet = new List <mainForum>();

            dsbaiviet = ws.getDatamainForumAsync().Result.Body.getDatamainForumResult.ToList <mainForum>();
            dsbaiviet = dsbaiviet.FindAll(baiviet => baiviet.tinhTrang != "pheduyet");
            grview_dsbinhluan.ItemsSource        = dsbaiviet;
            grview_dsbinhluanmoinhat.ItemsSource = dsbaiviet.FindAll(baiviet => baiviet.luotxem > 30);
        }
예제 #2
0
        private void timkhoacungtag(object sender, RoutedEventArgs e)
        {
            Button    btntag = sender as Button;
            mainForum temp   = btntag.DataContext as mainForum;

            ws = new kidmathwebserviceSoapClient();
            List <mainForum> dsbaiviet2 = new List <mainForum>();

            dsbaiviet2 = ws.getDatamainForumAsync().Result.Body.getDatamainForumResult.ToList <mainForum>();
            dsbaiviet2 = dsbaiviet2.FindAll(baiviet => baiviet.tinhTrang != "pheduyet" && baiviet.tag == temp.tag);
            grview_dsbinhluan.ItemsSource = dsbaiviet2;
        }
        private void Forum_Baiviet_Loaded(object sender, RoutedEventArgs e)
        {
            txtblock_noidung.Text      = baivietdangxem.noiDung;
            txtblock_tenNguoiDung.Text = baivietdangxem.tenNguoiDung;
            txtblock_tieude.Text       = baivietdangxem.tieuDe;
            txtblock_username.Text     = '@' + baivietdangxem.username;
            btn_content.Content        = baivietdangxem.tag;
            Luotxem.Text      = Convert.ToString(baivietdangxem.luotxem);
            luotbinhluan.Text = Convert.ToString(baivietdangxem.luotbinhluan);
            ngayDang.Text     = Convert.ToString(baivietdangxem.ngayDuyet);
            ws = new kidmathwebserviceSoapClient();
            List <mainForum> dsbaiviet  = new List <mainForum>();
            List <mainForum> dsbaiviet1 = new List <mainForum>();
            List <mainForum> dsbaiviet2 = new List <mainForum>();

            dsbaiviet  = ws.getDatamainForumAsync().Result.Body.getDatamainForumResult.ToList <mainForum>();
            dsbaiviet1 = dsbaiviet.FindAll(baiviet => baiviet.idbaiviet != baivietdangxem.idbaiviet);
            grview_cacbaivietkhac.ItemsSource = dsbaiviet;
            dsbaiviet2 = dsbaiviet.FindAll(baiviet => baiviet.username == baivietdangxem.username);
            grview_cacbaivietcungtacgia.ItemsSource = dsbaiviet2;
            cacbaivietcungtacgia.Text = "Các bài viết khác từ " + baivietdangxem.tenNguoiDung;
            binhluan.Text             = "Bình luận( " + baivietdangxem.luotbinhluan + "):";
            fr_binhluan.Navigate(typeof(binhLuan_Forum));
        }
        private void Admin_forum_Loaded(object sender, RoutedEventArgs e)
        {
            ws = new kidmathwebserviceSoapClient();
            List <mainForum> dsbaiviet = new List <mainForum>();

            dsbaiviet = ws.getDatamainForumAsync().Result.Body.getDatamainForumResult.ToList <mainForum>();

            foreach (var baiviet in dsbaiviet)
            {
                if (baiviet.tinhTrang == "chuapheduyet")
                {
                    baiviet.tinhTrang = "Phê duyệt";
                }
                else if (baiviet.tinhTrang == "dongbinhluan")
                {
                    baiviet.tinhTrang = "Mở khóa bình luận";
                }
                else if (baiviet.tinhTrang == "dapheduyet")
                {
                    baiviet.tinhTrang = "Khóa bình luận";
                }
            }
            gvdsachthongbao.ItemsSource = dsbaiviet;
        }