public bool LetUserComment(EditProductMv editProduct) { var data = new LichSuBinhLuan() { MaNguoiDung = editProduct.UserID, MaBaiViet = editProduct.ProductId, NoiDungBinhLuan = editProduct.Content }; return(cl.BinhLuanSanPham(data)); }
public ActionResult DeleteComment(EditProductMv edit) { var id = edit.ProductId; if (new ProductDao().DeleteComment(edit.ID)) { return(RedirectToAction("ContentProduct", "Home", new { id = id })); } else { return(RedirectToAction("ContentProduct", "Home", new { id = id })); } }
public ActionResult LetUserComment(EditProductMv editProduct) { var id = editProduct.ProductId; var userSession = (UserLogin)Session[CommonConstants.USER_SESSION]; if (userSession != null) { editProduct.UserID = userSession.UserID; if (new ProductDao().LetUserComment(editProduct)) { return(RedirectToAction("ContentProduct", "Home", new { id = id })); } else { TempData[CommonConstants.Message] = "khoong thanh cong"; return(RedirectToAction("ContentProduct", "Home", new { id = id })); } } else { return(RedirectToAction("Login", "Account")); } }