public static void Xuat(TreeViewItem th, BaiHocDTO bh) { foreach (BaiHocVanHocDTO bhvh in bh.ArrBaiHocVanHoc) { th.Items.Add(BaiHocVanHocGUI.The_Hien(bhvh)); } th.Tag = bh; }
private void LessonPage_Loaded(object sender, RoutedEventArgs e) { TreeViewItem th = new TreeViewItem(); th = Bai10; string filename = "BaiVanHoc10.xml"; BaiHocDTO bh1 = new BaiHocDTO(); bh1 = BaiHocBUS.LayBaiHoc(filename); BaiHocGUI.Xuat(th, bh1); }
public static BaiHocDTO LayBaiHoc(string BaiHoc_XML) { BaiHocDTO BaiHoc = new BaiHocDTO(); XmlDocument XmlD = new XmlDocument(); XmlD.Load(BaiHoc_XML); XmlElement Root = XmlD.DocumentElement; BaiHoc = KhoiTao(Root); return BaiHoc; }
public static BaiHocDTO KhoiTao(XmlElement Root) { BaiHocDTO BaiHoc = new BaiHocDTO(); BaiHoc.SoThuTu = int.Parse(Root.GetAttribute("SoThuTu")); BaiHoc.ArrBaiHocVanHoc = new ArrayList(); foreach (XmlElement Node in Root.ChildNodes) { BaiHoc.ArrBaiHocVanHoc.Add(BaiHocVanHocDAO.KhoiTao(Node)); } return BaiHoc; }