private void Admin_MailboxPage_Loaded(object sender, RoutedEventArgs e) { ws = new kidmathwebserviceSoapClient(); dsthongbao = ws.getDatathongBaoAsync().Result.Body.getDatathongBaoResult.ToList <thongBao>(); dsthongbao = dsthongbao.FindAll(thongbao => thongbao.username != ""); foreach (var thongbao in dsthongbao) { if (thongbao.tinhTrang == 'd') { thongbao.loaiThongBao = "Đã duyệt"; } else if (thongbao.tieuDe == "Yêu cầu nạp tiền" && thongbao.tinhTrang == 'c') { thongbao.loaiThongBao = "Nạp tiền"; } else if (thongbao.tieuDe != "Yêu cầu nạp tiền" && thongbao.tinhTrang == 'c') { thongbao.loaiThongBao = "Phản hồi"; } } foreach (var thongbao in dsthongbao) { //c : chưa duyệt ; d: đã duyệt if (thongbao.tinhTrang == 'd') { thongbao.loaiThongBao = "Đã duyệt"; } } gvdsachthongbao.ItemsSource = dsthongbao; }