コード例 #1
0
        /// <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!");
                }
            }
        }
コード例 #2
0
ファイル: Startup.cs プロジェクト: djsall/progpar-assignm
        public Startup()
        {
            InitializeComponent();

            LocationsHandler locations = new LocationsHandler();
            MovieHandler     movie     = new MovieHandler();

            CityDropDown.DataSource  = locations.cities;
            GenreDropDown.DataSource = movie.movieTypes;
        }