Ejemplo n.º 1
0
 public string Delete()
 {
     RoadFlow.Platform.WorkFlowDelegation workFlowDelegation = new RoadFlow.Platform.WorkFlowDelegation();
     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.WorkFlowDelegation workFlowDelegation2 = workFlowDelegation.Get(test);
             if (workFlowDelegation2 != null)
             {
                 workFlowDelegation.Delete(test);
                 RoadFlow.Platform.Log.Add("删除了流程意见", workFlowDelegation2.Serialize(), RoadFlow.Platform.Log.Types.流程相关);
             }
         }
     }
     workFlowDelegation.RefreshCache();
     return("删除成功!");
 }
Ejemplo n.º 2
0
        public ActionResult Edit(FormCollection collection)
        {
            RoadFlow.Platform.WorkFlowDelegation   workFlowDelegation  = new RoadFlow.Platform.WorkFlowDelegation();
            RoadFlow.Data.Model.WorkFlowDelegation workFlowDelegation2 = null;
            string str    = base.Request.QueryString["id"];
            string empty  = string.Empty;
            string empty2 = string.Empty;
            string empty3 = string.Empty;
            string empty4 = string.Empty;
            string text   = string.Empty;
            string empty5 = string.Empty;
            bool   flag   = "1" == base.Request.QueryString["isoneself"];
            Guid   test;

            if (str.IsGuid(out test))
            {
                workFlowDelegation2 = workFlowDelegation.Get(test);
                if (workFlowDelegation2 != null)
                {
                    text = workFlowDelegation2.FlowID.ToString();
                }
            }
            string oldXML = workFlowDelegation2.Serialize();

            if (collection != null)
            {
                empty  = base.Request.Form["UserID"];
                empty2 = base.Request.Form["ToUserID"];
                empty3 = base.Request.Form["StartTime"];
                empty4 = base.Request.Form["EndTime"];
                text   = base.Request.Form["FlowID"];
                empty5 = base.Request.Form["Note"];
                bool num = !str.IsGuid();
                if (workFlowDelegation2 == null)
                {
                    workFlowDelegation2 = new RoadFlow.Data.Model.WorkFlowDelegation
                    {
                        ID = Guid.NewGuid()
                    };
                }
                workFlowDelegation2.UserID  = (flag ? RoadFlow.Platform.Users.CurrentUserID : RoadFlow.Platform.Users.RemovePrefix(empty).ToGuid());
                workFlowDelegation2.EndTime = empty4.ToDateTime();
                if (text.IsGuid())
                {
                    workFlowDelegation2.FlowID = text.ToGuid();
                }
                else
                {
                    workFlowDelegation2.FlowID = null;
                }
                workFlowDelegation2.Note      = (empty5.IsNullOrEmpty() ? null : empty5);
                workFlowDelegation2.StartTime = empty3.ToDateTime();
                workFlowDelegation2.ToUserID  = RoadFlow.Platform.Users.RemovePrefix(empty2).ToGuid();
                workFlowDelegation2.WriteTime = DateTimeNew.Now;
                if (num)
                {
                    workFlowDelegation.Add(workFlowDelegation2);
                    RoadFlow.Platform.Log.Add("添加了工作委托", workFlowDelegation2.Serialize(), RoadFlow.Platform.Log.Types.流程相关);
                }
                else
                {
                    workFlowDelegation.Update(workFlowDelegation2);
                    RoadFlow.Platform.Log.Add("修改了工作委托", "", RoadFlow.Platform.Log.Types.流程相关, oldXML, workFlowDelegation2.Serialize());
                }
                workFlowDelegation.RefreshCache();
                base.ViewBag.Script = "alert('保存成功!');new RoadUI.Window().getOpenerWindow().query();new RoadUI.Window().close();";
            }
            base.ViewBag.FlowOptions = new RoadFlow.Platform.WorkFlow().GetOptions(text);
            return(View((workFlowDelegation2 == null) ? new RoadFlow.Data.Model.WorkFlowDelegation
            {
                UserID = RoadFlow.Platform.Users.CurrentUserID
            } : workFlowDelegation2));
        }