private void OnAllReviewsCommandExecute() { ClientReviews.Clear(); ClientReviews.AddItems(_unitOfWork.ClientReviews.GetAll()); _refreshReviewsAction = OnAllReviewsCommandExecute; IsMyReviews = false; }
private void OnMyReviewsCommandExecute() { ClientReviews.Clear(); ClientReviews.AddItems(_unitOfWork.ClientReviews.GetAll() .Where(cr => cr.UserId == _user.Id)); _refreshReviewsAction = OnMyReviewsCommandExecute; IsMyReviews = true; }
private void OnEditReviewCommandExecute() { var visualizer = DependencyResolver.Resolve <IUIVisualizerService>(); visualizer.ShowDialog(new AddReviewViewModel(SelectedClientReview)); int id = SelectedClientReview.Id; _refreshReviewsAction(); SelectedClientReview = ClientReviews.FirstOrDefault(cr => cr.Id == id); }
private void OnSaveAnswerCommandExecute() { int id = SelectedClientReview.Id; _binder.SaveAnswer(AdminAnswer, id); RefreshReviewsCollection(); SelectedClientReview = ClientReviews.First(c => c.Id == id); var root = ViewModelManager.GetFirstOrDefaultInstance <MainWindowViewModel>(); root.ChangePageWithDialog(new ShortMessageViewModel("Ответ сохранен!"), 1500); // выбираем тот же отзыв }
public void AddClientReviewAsync(ClientReviews review) { _context.Add(review); }
private void RefreshReviewsCollection() { ClientReviews.Clear(); ClientReviews.AddItems(_unitOfWork.ClientReviews.GetAll()); }