Ejemplo n.º 1
0
 public void AddComment(UserComment UserComment)
 {
     if (UserComments == null)
     {
         UserComments = new List<UserComment>();
     }
     UserComments.Add(UserComment);
 }
Ejemplo n.º 2
0
 public ActionResult AddComment(int id, UserComment _UserComment)
 {
     Product ViewProduct = Product.GetProduct(Convert.ToInt32(id));
     ViewData["Product"] = ViewProduct;
     if (ModelState.IsValid) {
         ViewProduct.AddComment(_UserComment);
         ViewData["SuccessMessgae"] = "Comment Successfully Add";
     }
     return View(_UserComment);
 }
Ejemplo n.º 3
0
 public static void AddComment(int ProductId, string Comment, string UserName)
 {
     Product Product = Products[ProductId];
     UserComment UserComment = new UserComment(Comment, UserName);
     Product.AddComment(UserComment);
 }