private void openReview2(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex > -1) { List<Review> reviews = (List<Review>)dataGridView3.DataSource; Review review = reviews[e.RowIndex]; ModifyReviewForm form = new ModifyReviewForm(review); form.ShowDialog(); } else { if (e.ColumnIndex == 1) { ReviewManager.sortByAuthor(((List<Review>)dataGridView3.DataSource)); } else if (e.ColumnIndex == 2) { ReviewManager.sortByMovie(((List<Review>)dataGridView3.DataSource)); } else if (e.ColumnIndex == 3) { ReviewManager.sortByRating(((List<Review>)dataGridView3.DataSource)); } dataGridView3.Refresh(); } }
private void openReview(object sender, DataGridViewCellEventArgs e) { if(e.RowIndex > -1) { List<Review> reviews = (List<Review>)reviewsGrid.DataSource; Review review = reviews[e.RowIndex]; ModifyReviewForm form = new ModifyReviewForm(review); form.ShowDialog(); } }
private void reviewButton_Click(object sender, EventArgs e) { ModifyReviewForm form; Review r = ApplicationManager.loggedIn.getReview(movieTitleLabel.Text); if (r != null) { form = new ModifyReviewForm(r, ApplicationManager.loggedIn.username); } else { form = new ModifyReviewForm(movieTitleLabel.Text, ApplicationManager.loggedIn.username); } form.ShowDialog(); }
private void selectReview(object sender, DataGridViewCellEventArgs e) { if(e.RowIndex > -1) { List<Review> reviews = (List<Review>)reviewGrid.DataSource; Review review = reviews[e.RowIndex]; ModifyReviewForm form = new ModifyReviewForm(review); form.ShowDialog(); } else if(lastClicked == e.ColumnIndex) { List<Review> reviews = (List<Review>)reviewGrid.DataSource; reviews.Reverse(); reviewGrid.Refresh(); } else { if(e.ColumnIndex == 2) { ReviewManager.sortByMovie(((List<Review>)reviewGrid.DataSource)); } else if(e.ColumnIndex == 3) { ReviewManager.sortByRating(((List<Review>)reviewGrid.DataSource)); } else if (e.ColumnIndex == 4) { ReviewManager.sortByContentLength(((List<Review>)reviewGrid.DataSource)); } else if (e.ColumnIndex == 5) { ReviewManager.sortByCreationTime(((List<Review>)reviewGrid.DataSource)); } else if (e.ColumnIndex == 6) { ReviewManager.sortByDateTime(((List<Review>)reviewGrid.DataSource)); } lastClicked = e.ColumnIndex; reviewGrid.Refresh(); } }