コード例 #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
 /// <summary>
 /// 更新意见
 /// </summary>
 /// <param name="appLibrary">意见实体</param>
 public int Update(Model.FlowComment flowComments)
 {
     ClearCache();
     using (var db = new DataContext())
     {
         db.Update(flowComments);
         return(db.SaveChanges());
     }
 }
コード例 #3
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("保存成功!");
 }
コード例 #4
0
 /// <summary>
 /// 更新意见
 /// </summary>
 /// <param name="flowComment">意见实体</param>
 public int Update(Model.FlowComment flowComment)
 {
     return(flowCommentData.Update(flowComment));
 }
コード例 #5
0
 /// <summary>
 /// 添加一个意见
 /// </summary>
 /// <param name="flowComment"></param>
 /// <returns></returns>
 public int Add(Model.FlowComment flowComment)
 {
     return(flowCommentData.Add(flowComment));
 }