예제 #1
0
        public override ArrayList GetData()
        {
            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.Load(System.Windows.Forms.Application.StartupPath + @"\\MusicList.xml");
            XmlNodeList nodelist = xmlDoc.SelectNodes("/ArrayOfMusic/Music");

            foreach (XmlNode item in nodelist)
            {
                CreateProduct prdct    = new CreateProduct();
                Music         my_music = (Music)CreateProduct.FactoryObjeYarat("Music");
                my_music.MusicAlbum1 = item.SelectSingleNode("MusicAlbum").InnerText;
                my_music.Name1       = item.SelectSingleNode("MusicArtist").InnerText;

                my_music.MusicSong1 = item.SelectSingleNode("MusicSong").InnerText;
                my_music.Song       = Properties.Resources.ResourceManager.GetObject(my_music.MusicSong1) as SoundPlayer;

                my_music.Category1 = item.SelectSingleNode("MusicCategory").InnerText;
                my_music.Price1    = float.Parse(item.SelectSingleNode("MusicPrice").InnerText);

                my_music.ImageName1 = item.SelectSingleNode("MusicImage").InnerText;
                my_music.Image      = Properties.Resources.ResourceManager.GetObject(my_music.ImageName1) as Image;

                allmusicrecord.Add(my_music);
            }
            return(allmusicrecord);
        }
예제 #2
0
        public override ArrayList GetData()
        {
            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.Load(System.Windows.Forms.Application.StartupPath + @"\\MagazineList.xml");
            XmlNodeList nodelist = xmlDoc.SelectNodes("/ArrayOfMagazine/Magazine");

            foreach (XmlNode item in nodelist)
            {
                CreateProduct prdct       = new CreateProduct();
                Magazine      my_magazine = (Magazine)CreateProduct.FactoryObjeYarat("Magazine");
                my_magazine.Name1              = item.SelectSingleNode("MagazineName").InnerText;
                my_magazine.Category1          = item.SelectSingleNode("MagazineCategory").InnerText;
                my_magazine.ImageName1         = item.SelectSingleNode("MagazineImage").InnerText;
                my_magazine.MagazinePublisher1 = item.SelectSingleNode("MagazinePublisher").InnerText;
                my_magazine.Price1             = float.Parse(item.SelectSingleNode("MagazinePrice").InnerText);
                my_magazine.Image              = Properties.Resources.ResourceManager.GetObject(my_magazine.ImageName1) as Image;
                allmagazinerecord.Add(my_magazine);
            }
            return(allmagazinerecord);
        }
예제 #3
0
        public override ArrayList GetData()
        {
            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.Load(System.Windows.Forms.Application.StartupPath + @"\\BookList.xml");
            XmlNodeList nodelist = xmlDoc.SelectNodes("/ArrayOfBook/Book");

            foreach (XmlNode item in nodelist)
            {
                CreateProduct prdct   = new CreateProduct();
                Book          my_book = (Book)CreateProduct.FactoryObjeYarat("Book");
                my_book.Name1            = item.SelectSingleNode("BookName").InnerText;
                my_book.ImageName1       = item.SelectSingleNode("BookImage").InnerText;
                my_book.BookAuthor1      = item.SelectSingleNode("BookAuthor").InnerText;
                my_book.BookDescription1 = item.SelectSingleNode("BookDescription").InnerText;
                my_book.Category1        = item.SelectSingleNode("BookCategory").InnerText;
                my_book.BookPageNumber1  = int.Parse(item.SelectSingleNode("BookPageNumber").InnerText);
                my_book.Price1           = float.Parse(item.SelectSingleNode("BookPrice").InnerText);
                my_book.Image            = Properties.Resources.ResourceManager.GetObject(my_book.ImageName1) as Image;
                allbookrecord.Add(my_book);
            }
            return(allbookrecord);
        }