예제 #1
0
 protected void gvReviewReportedRestaurant_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     gvReviewReportedRestaurant.PageIndex = e.NewPageIndex;
     if (tbxName.Text == "")
     {
         //to get all the data from feedbackDB by calling method
         List <Review> dvList = ReviewDB.getAllHotelReportedReview();
         gvReviewReportedRestaurant.DataSource = dvList;
         gvReviewReportedRestaurant.DataBind();
     }
     else
     {
         //to get all the data from feedbackDB by calling method and search by name
         List <Review> revList = ReviewDB.getAllHotelReportedReviewByName(tbxName.Text);
         gvReviewReportedRestaurant.DataSource = revList;
         gvReviewReportedRestaurant.DataBind();
     }
 }
예제 #2
0
    protected void gvReviewReportedHotel_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.getAllHotelReportedReview();

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

        pnlEdit.Visible = false;

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

        if (result > 0)
        {
            lblDelete.Text = "Feedback Deleted!";
            gvReviewReportedHotel.DataSource = ReviewDB.getAllHotelReportedReview();
            gvReviewReportedHotel.DataBind();
        }
    }
예제 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //if session for admin is null
        if (Session["admin"] == null)
        {
            Response.Redirect("LoginForm.aspx"); //redirect to the loginform page
        }

        gvReviewReportedAttraction.Visible = false;
        gvReviewReportedHotel.Visible      = false;
        gvReviewReportedRestaurant.Visible = false;
        gvReviewH.Visible = false;
        gvReviewA.Visible = false;
        gvReviewR.Visible = false;
        lblDelete.Visible = false;
        pnlEdit.Visible   = false;

        if (ddlSP.SelectedItem.Text == "Attraction Owner") //admin checks the review for attraction owner
        {
            gvReviewReportedAttraction.Visible = true;
            gvReviewA.Visible = true;
            //get all the data from feedbackDB by calling the method
            List <Review> revList = ReviewDB.getAllAttractionReportedReview();
            gvReviewReportedAttraction.DataSource = revList;
            gvReviewReportedAttraction.DataBind();
            List <Review> rvList = ReviewDB.getAllAttractionReportedReview();

            //get all the data from feedbackDB by calling the method
            List <Review> dvList = ReviewDB.getAllAttractionReview();
            gvReviewA.DataSource = dvList;
            gvReviewA.DataBind();
            List <Review> fbNormalList = ReviewDB.getAllAttractionReview();
        }
        else if (ddlSP.SelectedItem.Text == "Hotel Owner") //admin checks the review for hotel owner
        {
            gvReviewReportedHotel.Visible = true;
            gvReviewH.Visible             = true;
            //get all the data from feedbackDB by calling the method
            List <Review> revList = ReviewDB.getAllHotelReportedReview();
            gvReviewReportedHotel.DataSource = revList;
            gvReviewReportedHotel.DataBind();
            List <Review> rvList = ReviewDB.getAllHotelReportedReview();

            //get all the data from feedbackDB by calling the method
            List <Review> dvList = ReviewDB.getAllHotelReview();
            gvReviewH.DataSource = dvList;
            gvReviewH.DataBind();
            List <Review> fbNormalList = ReviewDB.getAllHotelReview();
        }
        else if (ddlSP.SelectedItem.Text == "Restaurant Owner") //admin checks the review for restaurant owner
        {
            gvReviewReportedRestaurant.Visible = true;
            gvReviewR.Visible = true;
            //get all the data from feedbackDB by calling the method
            List <Review> revList = ReviewDB.getAllRestaurantReportedReview();
            gvReviewReportedRestaurant.DataSource = revList;
            gvReviewReportedRestaurant.DataBind();
            List <Review> rvList = ReviewDB.getAllRestaurantReportedReview();

            //get all the data from feedbackDB by calling the method
            List <Review> dvList = ReviewDB.getAllRestaurantReview();
            gvReviewR.DataSource = dvList;
            gvReviewR.DataBind();
            List <Review> fbNormalList = ReviewDB.getAllRestaurantReview();
        }
    }