コード例 #1
0
        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();
            }
        }
コード例 #2
0
        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();
            }
        }
コード例 #3
0
        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();
        }
コード例 #4
0
        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();
            }
        }