Пример #1
0
        public void GetCityData(City city, DateTime date, Action<City> OnComplete)
        {
            this._city = city;
            this._date = date;
            this.OnCompleteShows = OnComplete;

            var wc = new WebClient();
            wc.DownloadStringCompleted += new DownloadStringCompletedEventHandler(GetCinepolisShowsComplete);
            wc.DownloadStringAsync(new Uri(string.Format(ShowsRootPath, city.Code, date.ToString("yyyyMMdd"))));
        }
Пример #2
0
        private City FillCityWithData(City city, ShowtimeData data)
        {
            city.Movies = data.Movies;
            city.Theaters = data.Theaters;

            foreach (var cartelera in data.Carteleras)
            {
                var theater = city.Theaters.Where(x => x.Code == cartelera.TheaterCode).SingleOrDefault();

                //cinepolis bug
                if (theater == null)
                    continue;

                foreach (var sala in cartelera.ShowtimeRooms)
                    theater.Showtimes.AddRange(sala.Showtimes);
            }
            return city;
        }
Пример #3
0
        private void DataLoadedFromInternet(City result)
        {
            AppState state = null;
            if (result == null)
                MessageBox.Show(Utils.GetMessage(Error.NoServerAvailable));
            else
                state = new AppState() { City = result, Date = SettingsManager.CurrentDate, TheaterCode = SettingsManager.TheaterCode };

            ShowData(state);
        }
Пример #4
0
 private City ReadCity(XmlReader reader)
 {
     var c = new City();
     string val;
     if (GetAttribute(reader, "idPais", out val))
         c.CountryCode = val;
     while (reader.Read() && reader.Name != "ciudad" || reader.NodeType != XmlNodeType.EndElement)
     {
         if (GetValue(reader, "nombre", out val))
             c.Name = val;
         if (GetValue(reader, "id", out val))
             c.Code = val;
     }
     return c;
 }