Esempio n. 1
0
 public void AddNewFilm()
 {
     SelectedFilm = new FilmDisplayModel
     {
         ReleaseDate = DateTime.Today
     };
 }
Esempio n. 2
0
 private void GetInputs(FilmDisplayModel film)
 {
     film.Title       = FilmTitle;
     film.Description = FilmDescription;
     film.ImageLink   = FilmImage;
     film.TrailerLink = FilmTrailer;
     film.ReleaseDate = FilmReleaseDate;
     film.Runtime     = FilmRuntime;
     film.Language    = FilmLanguage;
 }
Esempio n. 3
0
 private void SetInputs(FilmDisplayModel film)
 {
     FilmTitle       = film.Title;
     FilmDescription = film.Description;
     FilmImage       = film.ImageLink;
     FilmTrailer     = film.TrailerLink;
     FilmReleaseDate = film.ReleaseDate;
     FilmRuntime     = film.Runtime;
     FilmLanguage    = film.Language;
 }
Esempio n. 4
0
        private async Task HandleDeleteFilm(FilmDisplayModel film)
        {
            try
            {
                await _events.PublishOnUIThreadAsync(new LoadingOnEvent());

                await _filmEndpoint.DeleteFilm(film.Id);

                Films.Remove(film);
                SelectedFilm = null;
            }
            catch (Exception ex)
            {
                throw;
            }
            finally
            {
                await _events.PublishOnUIThreadAsync(new LoadingOffEvent());
            }
        }
Esempio n. 5
0
        private async Task HandleEditFilm(FilmDisplayModel film)
        {
            try
            {
                await _events.PublishOnUIThreadAsync(new LoadingOnEvent());

                GetInputs(film);
                await _filmEndpoint.EditFilm(FilmDisplayModelToModel(film));

                SelectedFilm = null;
            }
            catch (Exception ex)
            {
                throw;
            }
            finally
            {
                await _events.PublishOnUIThreadAsync(new LoadingOffEvent());
            }
        }
Esempio n. 6
0
        private async Task HandleAddFilm(FilmDisplayModel film)
        {
            try
            {
                await _events.PublishOnUIThreadAsync(new LoadingOnEvent());

                GetInputs(film);
                film.Id = Guid.NewGuid().ToString();
                await _filmEndpoint.AddFilm(FilmDisplayModelToModel(film));

                Films.Add(film);
                SelectedFilm = null;
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                await _events.PublishOnUIThreadAsync(new LoadingOffEvent());
            }
        }
Esempio n. 7
0
 private FilmModel FilmDisplayModelToModel(FilmDisplayModel film)
 {
     return(_mapper.Map <FilmModel>(film));
 }