Exemplo n.º 1
0
        public string SubmitComment([FromForm] CommentFrom CommentFrom)
        {
            Func <ResponseResult> funcAction = () =>
            {
                var responseModel = new ResponseResult
                {
                    Content   = _YoungoServer.SubmitComment(CommentFrom),
                    IsSuccess = true,
                    ErrorMsg  = ""
                };
                return(responseModel);
            };

            return(ActionResponseGetString(funcAction));
        }
Exemplo n.º 2
0
        /// <summary>
        /// 提交评论
        /// </summary>
        /// <param name="CommentFrom"></param>
        /// <returns></returns>
        public bool SubmitComment(CommentFrom CommentFrom)
        {
            CustomerComment comment = new CustomerComment
            {
                CustomerID = CommentFrom.CustomerID,
                OrderID    = CommentFrom.OrderID,
                ProductID  = CommentFrom.ProductID,
                Reply      = CommentFrom.Reply
            };

            if (_db.Insertable(comment).ExecuteCommand() > 0)
            {
                return(ChangeCustomerSign(CommentFrom.CustomerID, SignEnum.添加评论10点积分));
            }
            else
            {
                throw new Exception("提交评论异常!");
            }
        }