コード例 #1
0
        public bool LetUserComment(EditProductMv editProduct)
        {
            var data = new LichSuBinhLuan()
            {
                MaNguoiDung     = editProduct.UserID,
                MaBaiViet       = editProduct.ProductId,
                NoiDungBinhLuan = editProduct.Content
            };

            return(cl.BinhLuanSanPham(data));
        }
コード例 #2
0
        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 }));
            }
        }
コード例 #3
0
        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"));
            }
        }