Exemple #1
0
        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);
            }
        }
Exemple #2
0
        protected void btnRate_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);
                TransactionDetail trDetail = TransactionController.GetDetailTransactionByToken(token);
                ReviewController.InsertNewReview(trDetail.Id, rating, description);
                lblError.Text = "";
                Response.Redirect("ReviewPage.aspx?Token=" + token);
            }
        }