Пример #1
0
 protected void ReviewButton_Click(object sender, EventArgs e)
 {
     try
     {
         int    customerID = ((BasePage)Page).GetLoggedCustomerID();
         string reviewText = ((TextBox)ReviewLoginView.FindControl("ReviewTextBox")).Text;
         if (string.IsNullOrWhiteSpace(reviewText))
         {
             return;
         }
         int reviewID = Reviews.AddProductReview(ProductID, customerID, reviewText);
         AddRatings(reviewID);
         ((TextBox)ReviewLoginView.FindControl("ReviewTextBox")).Text  = string.Empty;
         ((Literal)ReviewLoginView.FindControl("MessageLiteral")).Text = "Thank you. Your review ill be available Shortly.";
     }
     catch (Exception ex)
     {
         ((Literal)ReviewLoginView.FindControl("MessageLiteral")).Text = ex.Message;
     }
 }