Пример #1
0
        public List<Movie> GetMoviesPlanetTus(string city, string date)
        {
            //hack fix later
            if (city.Equals("Novomesto"))
            {
                city = "Novo mesto";
            }

            PlanetTus planettus = new PlanetTus();
            DownloadXmlData dxd = new DownloadXmlData();
            dxd.GetXmlResult(planettus);
            string s = dxd.GetXml();

            List<Movie> movies = new List<Movie>();

            string dateFormat = "yyyyMMdd";
            DateTime dt = DateTime.ParseExact(date, dateFormat, null);
            movies = planettus.Parse(s, city, dt);

            return movies;
        }
Пример #2
0
        static void Main(string[] args)
        {
            /*
            Kolosej kolosej = new Kolosej();
            DownloadXmlData dxd = new DownloadXmlData();
            dxd.GetXmlResult(kolosej);
            string s = dxd.GetXml();

            List<Movie> movies = new List<Movie>();

            movies = kolosej.Parse(s, "Maribor", DateTime.Now);
            Console.WriteLine(s);
             */

            PlanetTus pt = new PlanetTus();
            DownloadXmlData dxd = new DownloadXmlData();
            dxd.GetXmlResult(pt);
            string s = dxd.GetXml();

            List<Movie> movies = new List<Movie>();

            movies = pt.Parse(s, "Maribor", DateTime.Now);
            Console.WriteLine(s);

            //Console.WriteLine("###############################################");

            //XDocument doc = XDocument.Parse(s);
            ////get all movies
            //List<XElement> movieListElement = (from e in doc.Descendants("movie") select e).ToList();

            //foreach (XElement xe in movieListElement)
            //{
            //    Console.WriteLine(xe.Name);
            //}
            //Console.WriteLine();
        }