예제 #1
0
        public JsonResult Comment(string comment, int pro_id)
        {
            tip t        = null;
            var datetime = System.DateTime.Now;

            Comment_Product z = new Comment_Product()
            {
                UserID      = (int)Session["userid"],
                Com_Content = comment,
                Com_Data    = datetime,
                Product_ID  = pro_id
            };

            db.Comment_Product.Add(z);
            try
            {
                db.SaveChanges();
                t = new tip
                {
                    message = "评论成功"
                };
            }
            catch (Exception d)
            {
                throw d;
            }
            return(base.Json(t));
        }
예제 #2
0
        //获取评论
        public Comment_Product GetCommentByPro_ID(int?id)
        {
            Comment_Product comment_Product = db.Comment_Product.Find(id);

            return(comment_Product);
        }
예제 #3
0
        //IStore iorder = DataAccess.GetOrder_UserId();
        //获取评论
        public Comment_Product GetCommentByID(int?id)
        {
            Comment_Product comment_Product = icomment.GetCommentByPro_ID(id);

            return(comment_Product);
        }