Beispiel #1
0
        /// <summary>
        /// 提交反馈意见
        /// </summary>
        /// <param name="from"></param>
        /// <returns></returns>
        public string SubmitFeedback([FromForm] FeedbackFrom from)
        {
            Func <ResponseResult> funcAction = () =>
            {
                var responseModel = new ResponseResult
                {
                    Content   = _YoungoServer.SubmitFeedback(from),
                    IsSuccess = true,
                    ErrorMsg  = ""
                };
                return(responseModel);
            };

            return(ActionResponseGetString(funcAction));
        }
Beispiel #2
0
        /// <summary>
        /// 提交反馈意见
        /// </summary>
        /// <param name="from"></param>
        /// <returns></returns>
        public bool SubmitFeedback(FeedbackFrom from)
        {
            Feedback model = new Feedback
            {
                Content = from.Content,
                Type    = from.Type,
                Phone   = from.Phone
            };

            if (_db.Insertable(model).ExecuteCommand() > 0)
            {
                return(true);
            }
            else
            {
                throw new Exception("发送消息异常!");
            }
        }