private void ReadData() { // 리뷰 클래스의 인스턴스 생성 ReviewsDB productReviews = new ReviewsDB(); // 상품코드 전달 및 코멘트 출력 this.DataList1.DataSource = productReviews.GetReviews(ProductID); //Convert.ToInt32(Request["ProductID"])); this.DataList1.DataBind(); }
// 코멘트 입력 protected void btnWrite_Click(object sender, System.EventArgs e) { int productID = ProductID; //Convert.ToInt32(Request["ProductID"]); ReviewsDB review = new ReviewsDB(); review.AddReview( // 5개 값 전달(저장) productID, this.txtCustomerName.Text, this.txtCustomerEmail.Text, Convert.ToInt32(this.lstRating.SelectedValue), this.txtComments.Text ); ReadData(); //다시 출력 }