/// <summary> /// Splits up movies for saving to database /// </summary> public static void saveMovies(int week, string[] movies, string selectedCinemaName) { MovieHandler mov = new MovieHandler(); foreach (var item in movies) { string[] line = item.Split('\t'); movie mT = new movie { genres = line[0], starring = line[1], producer = line[3], title = line[4], ScreeningDate = line[5], ScreeningTime = line[6], week = week, selectedCinemaName = selectedCinemaName }; bool playtimeCheck = int.TryParse(line[2], out mT.playtime), ageRestrictionCheck = int.TryParse(line[7], out mT.ageRestriction); if (playtimeCheck && ageRestrictionCheck) { pushToDb(mT); } else { MessageBox.Show("Számérték helyén más található a feldolgozandó fájlban. Kérem javítsa!"); } } }
public Startup() { InitializeComponent(); LocationsHandler locations = new LocationsHandler(); MovieHandler movie = new MovieHandler(); CityDropDown.DataSource = locations.cities; GenreDropDown.DataSource = movie.movieTypes; }