protected void btnSearch_Click(object sender, EventArgs e) { 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") { gvReviewReportedAttraction.Visible = true; gvReviewA.Visible = true; //get all the data from feedbackDB by calling the method List <Review> revList = ReviewDB.getAllAttractionReportedReviewByName(tbxName.Text); gvReviewReportedAttraction.DataSource = revList; gvReviewReportedAttraction.DataBind(); List <Review> rvList = ReviewDB.getAllAttractionReportedReview(); //get all the data from feedbackDB by calling the method List <Review> dvList = ReviewDB.getAllAttractionReviewByName(tbxName.Text); gvReviewA.DataSource = dvList; gvReviewA.DataBind(); List <Review> fbNormalList = ReviewDB.getAllAttractionReview(); } else if (ddlSP.SelectedItem.Text == "Hotel Owner") { gvReviewReportedHotel.Visible = true; gvReviewH.Visible = true; //get all the data from feedbackDB by calling the method List <Review> revList = ReviewDB.getAllHotelReportedReviewByName(tbxName.Text); gvReviewReportedHotel.DataSource = revList; gvReviewReportedHotel.DataBind(); List <Review> rvList = ReviewDB.getAllHotelReportedReviewByName(tbxName.Text); //get all the data from feedbackDB by calling the method List <Review> dvList = ReviewDB.getAllHotelReviewByName(tbxName.Text); gvReviewH.DataSource = dvList; gvReviewH.DataBind(); List <Review> fbNormalList = ReviewDB.getAllHotelReviewByName(tbxName.Text); } else if (ddlSP.SelectedItem.Text == "Restaurant Owner") { gvReviewReportedRestaurant.Visible = true; gvReviewR.Visible = true; //get all the data from feedbackDB by calling the method List <Review> revList = ReviewDB.getAllRestaurantReportedReviewByName(tbxName.Text); gvReviewReportedRestaurant.DataSource = revList; gvReviewReportedRestaurant.DataBind(); List <Review> rvList = ReviewDB.getAllRestaurantReportedReviewByName(tbxName.Text); //get all the data from feedbackDB by calling the method List <Review> dvList = ReviewDB.getAllRestaurantReviewByName(tbxName.Text); gvReviewR.DataSource = dvList; gvReviewR.DataBind(); List <Review> fbNormalList = ReviewDB.getAllRestaurantReviewByName(tbxName.Text); } }
protected void gvReviewReportedAttraction_PageIndexChanging(object sender, GridViewPageEventArgs e) { pnlEdit.Visible = false; //to perform paging gvReviewReportedAttraction.PageIndex = e.NewPageIndex; if (tbxName.Text == "") { //to get all the data from feedbackDB by calling method List <Review> revList = ReviewDB.getAllAttractionReportedReview(); gvReviewReportedAttraction.DataSource = revList; gvReviewReportedAttraction.DataBind(); } else { //to get all the data from feedbackDB by calling method and search by name List <Review> revList = ReviewDB.getAllAttractionReportedReviewByName(tbxName.Text); gvReviewReportedAttraction.DataSource = revList; gvReviewReportedAttraction.DataBind(); } }
protected void gvReviewReportedAttraction_RowDeleting(object sender, GridViewDeleteEventArgs e) { lblDelete.Visible = true; //get the list from FeedbackDB by calling the method and get the session List <Review> fbList = ReviewDB.getAllAttractionReportedReview(); //to perform paging Review fb = fbList[gvReviewReportedAttraction.PageIndex * gvReviewReportedAttraction.PageSize + e.RowIndex]; pnlEdit.Visible = false; //call the delete method from FeedbackDB int result = ReviewDB.deleteReview(fb); if (result > 0) { lblDelete.Text = "Feedback Deleted!"; gvReviewReportedAttraction.DataSource = ReviewDB.getAllAttractionReportedReview(); gvReviewReportedAttraction.DataBind(); } }
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(); } }