// GET: Songs
        public ActionResult SongsView()
        {
            SongsGrid songs = new SongsGrid();

            if (SessionBag.Current.SongsXml != null && SessionBag.Current.SongsXml is XmlDocument &&
                SessionBag.Current.SongsXmlReference != null && SessionBag.Current.SongsXmlReference is XmlDocument)
            {
                XmlDocument doc    = SessionBag.Current.SongsXml as XmlDocument;
                XmlDocument docref = SessionBag.Current.SongsXmlReference as XmlDocument;
                XmlNodeList nodes  = doc.SelectNodes("/Root/Data");
                foreach (XmlNode node in nodes)
                {
                    songs.songs.Add(new MVCSongs(node));
                }
                nodes = docref.SelectNodes("/Root/Data");
                foreach (XmlNode node in nodes)
                {
                    songs.songsref.Add(new MVCSongs(node));
                }

                //songs.songs.Sort();
                songs.Bind();
                ViewData.Model = songs;
            }

            return(View());
        }
Пример #2
0
        public ActionResult SongsView(int offset = 0)
        {
            if (offset > 0)
            {
                IncrementOffset();
            }
            else if (offset < 0)
            {
                DecrementOffset();
            }
            if (SetSongsPageDirty() == true)
            {
                GetSongs();
            }
            SongsGrid songs = new SongsGrid();

            songs.sortby       = SessionBag.Current.SongsPageOrder;
            songs.bydisk       = SessionBag.Current.SongsPageByDisk;
            songs.searchstring = SessionBag.Current.SongsPageSearchString;
            if (SessionBag.Current.SongsXml != null && SessionBag.Current.SongsXml is XmlDocument &&
                SessionBag.Current.SongsXmlReference != null && SessionBag.Current.SongsXmlReference is XmlDocument)
            {
                XmlDocument doc    = SessionBag.Current.SongsXml as XmlDocument;
                XmlDocument docref = SessionBag.Current.SongsXmlReference as XmlDocument;
                XmlNodeList nodes  = doc.SelectNodes("/Root/Data");
                foreach (XmlNode node in nodes)
                {
                    songs.songs.Add(new MVCSongs(node));
                }
                nodes = docref.SelectNodes("/Root/Data");
                foreach (XmlNode node in nodes)
                {
                    songs.songsref.Add(new MVCSongs(node));
                }
                //songs.songs.Sort();
                songs.offset += 50;
                songs.Bind();
                ViewData.Model = songs;
            }

            return(View());
        }