コード例 #1
0
        public ActionResult Edit(FormCollection collection)
        {
            RoadFlow.Platform.WorkFlowComment   workFlowComment  = new RoadFlow.Platform.WorkFlowComment();
            RoadFlow.Data.Model.WorkFlowComment workFlowComment2 = null;
            string str    = base.Request.QueryString["id"];
            string empty  = string.Empty;
            string empty2 = string.Empty;
            string empty3 = string.Empty;
            bool   flag   = "1" == base.Request.QueryString["isoneself"];
            Guid   test;

            if (str.IsGuid(out test))
            {
                workFlowComment2 = workFlowComment.Get(test);
                empty            = workFlowComment2.MemberID;
                empty2           = workFlowComment2.Comment;
                empty3           = workFlowComment2.Sort.ToString();
            }
            string oldXML = workFlowComment2.Serialize();

            if (collection != null)
            {
                empty  = (flag ? ("u_" + RoadFlow.Platform.Users.CurrentUserID.ToString()) : base.Request.Form["Member"]);
                empty2 = base.Request.Form["Comment"];
                empty3 = base.Request.Form["Sort"];
                bool num = !str.IsGuid();
                if (workFlowComment2 == null)
                {
                    workFlowComment2 = new RoadFlow.Data.Model.WorkFlowComment
                    {
                        ID   = Guid.NewGuid(),
                        Type = (flag ? 1 : 0)
                    };
                }
                workFlowComment2.MemberID = (empty.IsNullOrEmpty() ? "" : empty.Trim());
                workFlowComment2.Comment  = (empty2.IsNullOrEmpty() ? "" : empty2.Trim());
                workFlowComment2.Sort     = (empty3.IsInt() ? empty3.ToInt() : workFlowComment.GetManagerMaxSort());
                if (num)
                {
                    workFlowComment.Add(workFlowComment2);
                    RoadFlow.Platform.Log.Add("添加了流程意见", workFlowComment2.Serialize(), RoadFlow.Platform.Log.Types.流程相关);
                }
                else
                {
                    workFlowComment.Update(workFlowComment2);
                    RoadFlow.Platform.Log.Add("修改了流程意见", "", RoadFlow.Platform.Log.Types.流程相关, oldXML, workFlowComment2.Serialize());
                }
                workFlowComment.RefreshCache();
                base.ViewBag.Script = "new RoadUI.Window().reloadOpener();alert('保存成功!');";
            }
            if (workFlowComment2 == null)
            {
                workFlowComment2      = new RoadFlow.Data.Model.WorkFlowComment();
                workFlowComment2.Sort = workFlowComment.GetManagerMaxSort() + 5;
            }
            return(View(workFlowComment2));
        }
コード例 #2
0
 public string Delete()
 {
     RoadFlow.Platform.WorkFlowComment workFlowComment = new RoadFlow.Platform.WorkFlowComment();
     string[] array = base.Request.Form["ids"].Split(',');
     for (int i = 0; i < array.Length; i++)
     {
         Guid test;
         if (array[i].IsGuid(out test))
         {
             RoadFlow.Data.Model.WorkFlowComment workFlowComment2 = workFlowComment.Get(test);
             if (workFlowComment2 != null)
             {
                 workFlowComment.Delete(test);
                 RoadFlow.Platform.Log.Add("删除了流程意见", workFlowComment2.Serialize(), RoadFlow.Platform.Log.Types.流程相关);
             }
         }
     }
     workFlowComment.RefreshCache();
     return("删除成功!");
 }