Esempio n. 1
0
        private void bw_DoWork(object sender, DoWorkEventArgs e)
        {
            try
            {
                DateTime dtSelectedDate = DateTime.Now;

                Dispatcher.Invoke(DispatcherPriority.Background, new Action(() => dtSelectedDate = Convert.ToDateTime(dprStartingDate.SelectedDate)));

                IEnumerable <Movie> movies = new MovieTimingsRepository().GetMovies(dtSelectedDate);

                if (movies == null || movies.Count() == 0)
                {
                    Dispatcher.Invoke(DispatcherPriority.Background, new Action(() => ManageLoadingDataVisibility(false)));

                    return;
                }

                Dispatcher.Invoke(DispatcherPriority.Background, new Action(() => Helper.LoadDropDownSource(cmbMovie, movies, "MovieName", "Id")));
            }
            catch (Exception ex)
            {
                ManageLoadingDataVisibility(false);
                LogExceptions.LogException(ex);
            }
        }
Esempio n. 2
0
        private void cmbMovie_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            try
            {
                ManageLoadingDataVisibility(true);

                IEnumerable <Movie> movieTimes = new MovieTimingsRepository().GetMovieDates(Convert.ToInt32(cmbMovie.SelectedValue), Convert.ToDateTime(dprStartingDate.SelectedDate));

                if (movieTimes == null || movieTimes.Count() == 0)
                {
                    ManageLoadingDataVisibility(false);

                    return;
                }

                Dispatcher.Invoke(DispatcherPriority.Background, new Action(() => Helper.LoadDropDownSource(cmbMovieTime, movieTimes, "S_Date", "S_Date")));
            }
            catch (Exception ex)
            {
                ManageLoadingDataVisibility(false);
                LogExceptions.LogException(ex);
            }
        }