示例#1
0
    protected void gvReviewR_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        lblDelete.Visible = true;
        //get the list from FeedbackDB by calling the method and get the session
        List <Review> fbNormalList = ReviewDB.getAllRestaurantReview();

        //to perform paging
        Review fb = fbNormalList[gvReviewR.PageIndex * gvReviewR.PageSize + e.RowIndex];

        pnlEdit.Visible = false;

        //call the delete method from FeedbackDB
        int result = ReviewDB.deleteReview(fb);

        if (result > 0)
        {
            lblDelete.Text       = "Feedback Deleted!";
            gvReviewR.DataSource = ReviewDB.getAllRestaurantReview();
            gvReviewR.DataBind();
        }
    }