Пример #1
0
        public IActionResult Edit()
        {
            Business.FlowComment flowComment      = new Business.FlowComment();
            Model.FlowComment    flowCommentModel = null;
            string commentId = Request.Querys("commentid");
            string isOneSelf = Request.Querys("isoneself");

            if (commentId.IsGuid(out Guid cid))
            {
                flowCommentModel = flowComment.Get(cid);
            }
            if (null == flowCommentModel)
            {
                flowCommentModel = new Model.FlowComment
                {
                    Id      = Guid.NewGuid(),
                    Sort    = flowComment.GetMaxSort(),
                    AddType = "1".Equals(isOneSelf) ? 0 : 1
                };
                if ("1".Equals(isOneSelf))
                {
                    flowCommentModel.UserId = Current.UserId;
                }
            }
            ViewData["isOneSelf"]   = isOneSelf;
            ViewData["queryString"] = Request.UrlQuery();
            return(View(flowCommentModel));
        }
Пример #2
0
 public string Save(Model.FlowComment flowCommentModel)
 {
     if (!Request.Forms("UserId").IsNullOrWhiteSpace())
     {
         flowCommentModel.UserId = new Business.User().GetUserId(Request.Forms("UserId"));
     }
     Business.FlowComment flowComment = new Business.FlowComment();
     if (Request.Querys("commentid").IsGuid(out Guid guid))
     {
         var    oldModel = flowComment.Get(guid);
         string oldJSON  = null == oldModel ? "" : oldModel.ToString();
         flowComment.Update(flowCommentModel);
         Business.Log.Add("修改了流程意见-" + flowCommentModel.Id, type: Business.Log.Type.系统管理, oldContents: oldJSON, newContents: flowCommentModel.ToString());
     }
     else
     {
         flowComment.Add(flowCommentModel);
         Business.Log.Add("添加了流程意见-" + flowCommentModel.Id, flowCommentModel.ToString(), Business.Log.Type.系统管理);
     }
     return("保存成功!");
 }