コード例 #1
0
        public JsonResult SaveReply(string entity)
        {
            var       result = false;
            string    msg    = "提交失败,请稍后再试!";
            UserReply model  = JsonConvert.DeserializeObject <UserReply>(entity);

            model.FromReplyID     = string.IsNullOrEmpty(model.FromReplyID) ? "" : model.FromReplyID;
            model.FromReplyUserID = string.IsNullOrEmpty(model.FromReplyUserID) ? "" : model.FromReplyUserID;
            result = UserReplyBusiness.CreateUserReply(model.GUID.Replace("ZSXJ,", ""), model.Content, model.Title, CurrentUser.UserID, model.FromReplyID, model.FromReplyUserID, model.Type, model.GUID.IndexOf("ZSXJ,"), ref msg);
            JsonDictionary.Add("result", result);
            JsonDictionary.Add("ErrMsg", msg);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
コード例 #2
0
ファイル: HelpController.cs プロジェクト: Michauxquan/ZPY
        public JsonResult SaveReply(string entity)
        {
            var    result = false;
            string msg    = "提交失败,请稍后再试!";

            if (CurrentUser == null)
            {
                msg = "您尚未登录,请登录后在操作!";
            }
            else
            {
                UserReply model = JsonConvert.DeserializeObject <UserReply>(entity);
                model.FromReplyID     = string.IsNullOrEmpty(model.FromReplyID) ? "" : model.FromReplyID;
                model.FromReplyUserID = string.IsNullOrEmpty(model.FromReplyUserID) ? "" : model.FromReplyUserID;
                result = UserReplyBusiness.CreateUserReply(model.GUID, model.Content, CurrentUser.UserID, model.FromReplyID, model.FromReplyUserID, model.Type);
            }
            JsonDictionary.Add("result", result);
            JsonDictionary.Add("errorMsg", msg);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }