Example #1
0
 public void Update(RatingDetailModel model)
 {
     using (var dbContext = _dbContextSqlFactory.CreateDbContext())
     {
         var entity = RatingMapper.MapRatingDetailModelToEntity(model);
         dbContext.Ratings.Update(entity);
         dbContext.SaveChanges();
     }
 }
Example #2
0
 public RatingDetailModel Create(RatingDetailModel model)
 {
     using (var dbContext = _dbContextSqlFactory.CreateDbContext())
     {
         var entity = RatingMapper.MapRatingDetailModelToEntity(model);
         dbContext.Ratings.Add(entity);
         dbContext.SaveChanges();
         return(RatingMapper.MapRatingEntityToDetailModel(entity));
     }
 }
Example #3
0
 private void OnMovieSelectedReceived(MovieSelectedWrapper movieWrapper)
 {
     CanDeleteFlag        = true;
     DisplayDetailModel   = WrapperMappers.ToMovieDetailModel(movieWrapper);
     EditDetailModel      = null;
     RatingNewDetailModel = new RatingDetailModel();
     LoadActors();
     LoadDirectors();
     LoadRatings();
 }
Example #4
0
 public static RatingEntity MapRatingDetailModelToEntity(RatingDetailModel model)
 {
     return(new RatingEntity
     {
         Id = model.Id,
         RatedMovieId = model.RatedMovieId,
         Nick = model.Nick,
         NumericEvaluation = model.NumericEvaluation,
         Review = model.Review
     });
 }
Example #5
0
        private void OnCloseSearchRatingsView(RatingDetailModel ratingDetail)
        {
            var listModel = new MovieListModel()
            {
                Id = ratingDetail.RatedMovieId
            };

            Messenger.Default.Send(listModel);

            ToggleSearchView = false;
            ToggleTabView    = true;
            SearchQuery      = null;
        }
Example #6
0
 private void DiscardNewRating(object x = null)
 {
     ShowRatingAddForm       = Visibility.Collapsed;
     ShowRatingAddFormButton = Visibility.Visible;
     RatingNewDetailModel    = new RatingDetailModel();
 }