예제 #1
0
 public void CreateProductComment(ProductComment productComment)
 {
     using (SqlConnection connection = base.GetConnection())
     {
         SqlCommand command = new SqlCommand("_ProductCommentUpdate", connection) {
             CommandType = CommandType.StoredProcedure
         };
         command.Parameters.AddWithValue("@Type", 0);
         command.Parameters.AddWithValue("@CommentID", 0);
         command.Parameters.AddWithValue("@ProductID", productComment.ProductID);
         command.Parameters.AddWithValue("@FullName", productComment.FullName);
         command.Parameters.AddWithValue("@Email", productComment.Email);
         command.Parameters.AddWithValue("@Title", productComment.Title);
         command.Parameters.AddWithValue("@Content", productComment.Content);
         command.Parameters.AddWithValue("@DateCreated", productComment.DateCreated);
         command.Parameters.AddWithValue("@Actived", productComment.Actived);
         connection.Open();
         if (command.ExecuteNonQuery() <= 0)
         {
             throw new DataAccessException("Lỗi kh\x00f4ng thể tao moi");
         }
         command.Dispose();
     }
 }
예제 #2
0
 public void CreateProductComment(ProductComment productComment)
 {
     new ProductCommentDAO().CreateProductComment(productComment);
 }
예제 #3
0
 public void UpdateProductComment(ProductComment productComment)
 {
     new ProductCommentDAO().UpdateProductComment(productComment);
 }