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(); } }