Beispiel #1
0
 private void Update()
 {
     countChecked = 0;
     for (int i = films.Length - 1; i > -1; i--)
     {
         Film film = films.GetFilm(i);
         title = films.GetFilmDisplayedName(i);
         UpdateStatus();
         if (film.code == "")
         {
             continue;
         }
         DateTime dtPremiere = Convert.ToDateTime(films.GetFilmReleaseDate(i));
         DateTime dtNow      = DateTime.Now;
         DateTime dtCheck    = Convert.ToDateTime(film.dataCheck);
         TimeSpan ts1        = dtNow - dtPremiere;
         TimeSpan ts2        = dtNow - dtCheck;
         if (ts1.TotalDays / 10.0 > ts2.TotalDays)
         {
             continue;
         }
         countChecked++;
         FilmInfo filmInfo;
         try
         {
             filmInfo = ParsingService.GetFilmInfo(film.code);
         }
         catch
         {
             continue;
         }
         if (filmInfo.originalTitle != film.originalTitle ||
             filmInfo.year != film.year ||
             filmInfo.country != film.country ||
             filmInfo.director != film.director ||
             filmInfo.genre != film.genre ||
             filmInfo.actors != film.actors ||
             filmInfo.worldPremiere != film.worldDate ||
             filmInfo.russianPremiere != film.russianDate ||
             filmInfo.discPremiere != film.discDate)
         {
             LogUnit logUnit = new LogUnit
             {
                 filmInfo = filmInfo,
                 film     = film
             };
             log.Add(logUnit);
         }
         else
         {
             film.dataCheck = DateTime.Now.ToString();
             films.Edit(film, i);
         }
     }
     title = "";
     UpdateStatus();
 }
Beispiel #2
0
        private void FilmToForm(int index)
        {
            Film film = films.GetFilm(index);

            dgFilms.Rows[index].Cells[0].Value           = films.GetFilmDisplayedName(index);
            dgFilms.Rows[index].Cells[1].Value           = films.GetFilmReleaseDate(index);
            dgFilms.Rows[index].Cells[2].Value           = film.discDate;
            dgFilms.Rows[index].Cells[3].Value           = films.GetFilmQuality(index);
            dgFilms.Rows[index].Cells[3].Style.BackColor = films.GetFilmColor(index);
        }