Exemplo n.º 1
0
        /// <summary>
        /// 用户提交评论
        /// </summary>
        /// <param name="OrderId">订单id</param>
        /// <param name="GoodId">商品id</param>
        /// <param name="StarRating">星级</param>
        /// <param name="Content">评论内容</param>
        /// <returns></returns>
        public JsonResult IsComment(string OrderId, string GoodId, string StarRating, string Content)
        {
            int userid = Convert.ToInt32(Session["userid"]);

            //如果都为true
            if (CommentBll.AddUserComment(userid, Convert.ToInt32(GoodId), Content, Convert.ToInt32(StarRating)) && OrderBll.IsComment(Convert.ToInt32(OrderId)))
            {
                return(Json(1, JsonRequestBehavior.AllowGet));
            }
            return(Json(0, JsonRequestBehavior.AllowGet));
        }