protected void btnDelete_Click(object sender, EventArgs e) { string token = Request.QueryString["Token"]; Models.Review review = ReviewController.GetReviewByToken(token); if (review != null) { ReviewController.DeleteReview(review.Id); lblError.Text = ""; Response.Redirect("ReviewPage.aspx?Token=" + token); } }
protected void Page_Load(object sender, EventArgs e) { string RoleID; if (Session["RoleId"] != null) { RoleID = Session["RoleId"].ToString(); } else { if (Request.Cookies["remember"] != null) { RoleID = Request.Cookies["remember"].Value; } else { RoleID = "-1"; } } ShowAdditionalNavBar(RoleID); string token = Request.QueryString["Token"]; if (token == null) { Response.Redirect("../RedeemToken/RedeemTokenPage.aspx"); } else { Show currentShow = ShowController.GetShowByToken(token); User currentSeller = UserController.GetUserById(currentShow.SellerId); Models.Review currentReview = ReviewController.GetReviewByToken(token); showButton(currentReview); showRating(currentReview); lblShowName.Text = currentShow.Name; lblShowSellerName.Text = currentSeller.Name; lblShowDescription.Text = currentShow.Description; } }
protected void btnUpdate_Click(object sender, EventArgs e) { string s_rating = txtRating.Text; string description = txtDescription.Text; string token = Request.QueryString["Token"]; string response = ReviewController.CheckReview(s_rating, description); if (response != "") { lblError.Text = response; } else { int rating = int.Parse(s_rating); Models.Review review = ReviewController.GetReviewByToken(token); ReviewController.UpdateReview(review.Id, rating, description); lblError.Text = ""; Response.Redirect("ReviewPage.aspx?Token=" + token); } }