Ejemplo n.º 1
0
        public IHttpActionResult Submit()
        {
            try
            {
                var request  = Context.GetCurrentRequest();
                var formInfo = FormManager.GetFormInfoByPost(request);
                if (formInfo == null)
                {
                    return(NotFound());
                }
                if (!request.IsAdminLoggin || !request.AdminPermissions.HasSitePermissions(formInfo.SiteId, FormUtils.PluginId))
                {
                    return(Unauthorized());
                }

                var logId   = request.GetPostInt("logId");
                var logInfo = LogDao.GetLogInfo(logId);
                if (logInfo == null)
                {
                    return(NotFound());
                }

                logInfo.ReplyContent = request.GetPostString("replyContent");

                LogDao.Reply(formInfo, logInfo);

                return(Ok(new{}));
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }