Esempio n. 1
0
        public ActionResult FlowCopyFor(FormCollection collection)
        {
            RoadFlow.Platform.WorkFlow     workFlow      = new RoadFlow.Platform.WorkFlow();
            RoadFlow.Platform.WorkFlowTask workFlowTask1 = new RoadFlow.Platform.WorkFlowTask();
            string            str1             = this.Request.QueryString["flowid"];
            string            stepid           = this.Request.QueryString["stepid"];
            string            str2             = this.Request.QueryString["groupid"];
            string            str3             = this.Request.QueryString["instanceid"];
            string            flowID           = str1;
            int               num              = 1;
            WorkFlowInstalled workFlowRunModel = workFlow.GetWorkFlowRunModel(flowID, num != 0);

            if (workFlowRunModel == null)
            {
                this.Response.Write("未找到流程运行实体");
                this.Response.End();
                return((ActionResult)null);
            }
            if (workFlowRunModel.Steps.Where <Step>((Func <Step, bool>)(p => p.ID == stepid.ToGuid())).Count <Step>() == 0)
            {
                this.Response.Write("未找到当前步骤");
                this.Response.End();
                return((ActionResult)null);
            }
            RoadFlow.Data.Model.WorkFlowTask workFlowTask2 = workFlowTask1.Get(this.Request.QueryString["taskid"].ToGuid());
            if (workFlowTask2 == null)
            {
                this.Response.Write("当前任务为空,请先保存再抄送!");
                this.Response.End();
                return((ActionResult)null);
            }
            if (collection != null)
            {
                List <RoadFlow.Data.Model.WorkFlowTask> taskList = workFlowTask1.GetTaskList(workFlowTask2.ID, true);
                List <RoadFlow.Data.Model.Users>        allUsers = new RoadFlow.Platform.Organize().GetAllUsers(this.Request.Form["user"] ?? "");
                StringBuilder stringBuilder = new StringBuilder();
                foreach (RoadFlow.Data.Model.Users users in allUsers)
                {
                    RoadFlow.Data.Model.Users user = users;
                    if (taskList.Find((Predicate <RoadFlow.Data.Model.WorkFlowTask>)(p => p.ReceiveID == user.ID)) == null)
                    {
                        Step step = workFlowRunModel.Steps.Where <Step>((Func <Step, bool>)(p => p.ID == this.Request.QueryString["stepid"].ToGuid())).First <Step>();
                        RoadFlow.Data.Model.WorkFlowTask model = new RoadFlow.Data.Model.WorkFlowTask();
                        if (step.WorkTime > Decimal.Zero)
                        {
                            model.CompletedTime = new DateTime?(DateTimeNew.Now.AddHours((double)step.WorkTime));
                        }
                        model.FlowID      = workFlowTask2.FlowID;
                        model.GroupID     = workFlowTask2.GroupID;
                        model.ID          = Guid.NewGuid();
                        model.Type        = 5;
                        model.InstanceID  = workFlowTask2.InstanceID;
                        model.Note        = "抄送任务";
                        model.PrevID      = workFlowTask2.PrevID;
                        model.PrevStepID  = workFlowTask2.PrevStepID;
                        model.ReceiveID   = user.ID;
                        model.ReceiveName = user.Name;
                        model.ReceiveTime = DateTimeNew.Now;
                        model.SenderID    = workFlowTask2.ReceiveID;
                        model.SenderName  = workFlowTask2.ReceiveName;
                        model.SenderTime  = model.ReceiveTime;
                        model.Status      = 0;
                        model.StepID      = workFlowTask2.StepID;
                        model.StepName    = workFlowTask2.StepName;
                        model.Sort        = workFlowTask2.Sort;
                        model.Title       = workFlowTask2.Title;
                        workFlowTask1.Add(model);
                        stringBuilder.Append(model.ReceiveName);
                        stringBuilder.Append(",");
                    }
                }
                // ISSUE: reference to a compiler-generated field
                if (WorkFlowRunController.\u003C\u003Eo__18.\u003C\u003Ep__0 == null)
                {
                    // ISSUE: reference to a compiler-generated field
                    WorkFlowRunController.\u003C\u003Eo__18.\u003C\u003Ep__0 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "script", typeof(WorkFlowRunController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2]
                    {
                        CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null),
                        CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, (string)null)
                    }));
                }
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated field
                object obj = WorkFlowRunController.\u003C\u003Eo__18.\u003C\u003Ep__0.Target((CallSite)WorkFlowRunController.\u003C\u003Eo__18.\u003C\u003Ep__0, this.ViewBag, "alert('成功抄送给:" + stringBuilder.ToString().TrimEnd(',') + "');new RoadUI.Window().close();");
            }
            return((ActionResult)this.View());
        }