コード例 #1
0
ファイル: BaiTapDao.cs プロジェクト: mylgoehy/tiengvietlop7
        public static BaiTapDto[] LayBaiTapTheoTieuDeVanBan(string filename, string tieude)
        {
            ArrayList myList = new ArrayList();

            BaiTapDto[] danh_sach_bai_tap;
            XmlDocument tai_lieu          = LT_XML.Doc(filename);
            XmlNodeList danh_sach_van_ban = tai_lieu.GetElementsByTagName("VANBAN");

            foreach (XmlElement vb in danh_sach_van_ban)
            {
                if (vb.GetAttribute("TieuDe") == tieude)
                {
                    XmlNode nut_dh = vb.NextSibling;
                    foreach (XmlElement nut_bt in nut_dh.ChildNodes)
                    {
                        BaiTapDto bt = Khoi_Tao(nut_bt);
                        myList.Add(bt);
                    }
                    break;
                }
            }

            danh_sach_bai_tap = (BaiTapDto[])myList.ToArray(typeof(BaiTapDto));
            return(danh_sach_bai_tap);
        }
コード例 #2
0
        public static BaiHocDto LayBaiDoc(string ten_file)
        {
            BaiHocDto   kq       = new BaiHocDto();
            XmlDocument tai_lieu = LT_XML.Doc(ten_file);
            XmlElement  Goc      = tai_lieu.DocumentElement;

            kq = Khoi_Tao(Goc);
            return(kq);
        }
コード例 #3
0
        public static VanBanDto LayVanBanTheoTieuDe(string filename, string tieude)
        {
            VanBanDto   kq                = new VanBanDto();
            XmlDocument tai_lieu          = LT_XML.Doc(filename);
            XmlNodeList danh_sach_van_ban = tai_lieu.GetElementsByTagName("VANBAN");

            foreach (XmlElement vb in danh_sach_van_ban)
            {
                if (vb.GetAttribute("TieuDe") == tieude)
                {
                    kq = Khoi_Tao(vb);
                    break;
                }
            }

            return(kq);
        }