private void RejectManuscriptAgain() { ManuscriptToUpdate.ManuscriptId = SelectedUnderReviewManuscript.ManuscriptId; ManuscriptToUpdate.IssueId = 3; ManuscriptToUpdate.DateAccepted = new DateTime(2099, 1, 1); ManuscriptToUpdate.ManuscriptStatus = 2; ManuscriptToUpdate.NumberOfPagesOccupied = 0; ManuscriptToUpdate.OrderInIssue = 0; ManuscriptToUpdate.BeginningPageNumber = 0; _updateManuscriptService.UpdateManuscript(ManuscriptToUpdate); MessageBox.Show($"Manuscript entitled as '{SelectedUnderReviewManuscript.ManuscriptTitle}' has been rejected.", "Success!", MessageBoxButton.OK, MessageBoxImage.Information); //Refresh DB _manuscriptService = new ListManuscriptService(_context); _issueService = new ListIssueService(_context); _reviewService = new ListReviewService(_context); var manuscripts = _manuscriptService.GetManuscriptList().ToList(); var issues = _issueService.GetIssueList().ToList(); var reviews = _reviewService.GetReviewList().ToList(); ManuscriptList = new ObservableCollection <ManuscriptListDto>(manuscripts); IssueList = new ObservableCollection <IssueListDto>(issues); ReviewList = new ObservableCollection <ReviewListDto>(reviews); //Refresh ListBox SelectedManuscriptReviewList.Clear(); foreach (var review in SelectedManuscriptReviewList) { SelectedManuscriptReviewList.Remove(review); } UnderReviewManuscriptList.Remove(SelectedUnderReviewManuscript); }
private void LoadSelectedManuscriptReviewList() { if (SelectedManuscriptReviewList.Count != 0) { SelectedManuscriptReviewList.Clear(); foreach (var review in SelectedManuscriptReviewList) { SelectedManuscriptReviewList.Remove(review); } } foreach (var review in ReviewList) { if (SelectedUnderReviewManuscript.ManuscriptId == review.ManuscriptId) { SelectedManuscriptReviewList.Add(review); } } }