protected void btnSubmit_Click(object sender, EventArgs e) { //Account a = new Account(); Account a = (Account)Session["Account"]; //int fac_id = (int)Session["fac_id"]; Review r = new Review(); r.rating = Rating1.CurrentRating; r.comment = txtComment.Text; if (Validation.isEmpty(r.comment)) { lblComment.Text = "Please write comment"; } else { lblComment.Text = ""; Rating1.CurrentRating = 0; txtComment.Text = ""; r.accountId = a.accountID; r.facilityId = facilityId; ReviewControlSystem.CreateReview(r); BindRatings(); BindComments(); Response.Write("<script type=\"text/javascript\">alert('Review Added!')</script>"); } }
private void BindComments() { Comments.DataSource = ReviewControlSystem.GetAllReviews(facilityId); Comments.DataBind(); }
public void BindRatings() { double i = ReviewControlSystem.GetAverageRating(facilityId); lblRatingNumber.Text = lblRating.Text = double.IsNaN(i)?"No Ratings Yet":i.ToString(); }