public ActionResult DetailSubFlow()
        {
            RoadFlow.Platform.WorkFlowTask workFlowTask = new RoadFlow.Platform.WorkFlowTask();
            RoadFlow.Platform.WorkFlow     workFlow     = new RoadFlow.Platform.WorkFlow();
            string text = string.Format("&flowid1={0}&groupid={1}&appid={2}&tabid={3}&title={4}&flowid={5}&sender={6}&date1={7}&date2={8}&iframeid={9}&openerid={10}&taskid={11}", base.Request.QueryString["flowid"], base.Request.QueryString["groupid"], base.Request.QueryString["appid"], base.Request.QueryString["tabid"], base.Request.QueryString["title"].UrlEncode(), base.Request.QueryString["flowid"], base.Request.QueryString["sender"], base.Request.QueryString["date1"], base.Request.QueryString["date2"], base.Request.QueryString["iframeid"], base.Request.QueryString["openerid"], base.Request.QueryString["taskid"]);

            base.ViewBag.flowid       = base.Request.QueryString["flowid"];
            base.ViewBag.groupid      = base.Request.QueryString["groupid"];
            base.ViewBag.displayModel = base.Request.QueryString["displaymodel"];
            base.ViewBag.wfInstall    = null;
            base.ViewBag.query        = text;
            string str   = base.Request.QueryString["taskid"];
            string text2 = base.Request.QueryString["displaymodel"];

            if (!str.IsGuid())
            {
                return(View(new List <RoadFlow.Data.Model.WorkFlowTask>()));
            }
            RoadFlow.Data.Model.WorkFlowTask workFlowTask2 = workFlowTask.Get(str.ToGuid());
            if (workFlowTask2 == null || workFlowTask2.SubFlowGroupID.IsNullOrEmpty())
            {
                return(View(new List <RoadFlow.Data.Model.WorkFlowTask>()));
            }
            List <RoadFlow.Data.Model.WorkFlowTask> list = new List <RoadFlow.Data.Model.WorkFlowTask>();

            string[] array = workFlowTask2.SubFlowGroupID.Split(',');
            foreach (string str2 in array)
            {
                list.AddRange(workFlowTask.GetTaskList(Guid.Empty, str2.ToGuid()));
            }
            if (list.Count == 0)
            {
                base.Response.Write("未找到任务");
                base.Response.End();
                return(null);
            }
            WorkFlowInstalled workFlowRunModel = workFlow.GetWorkFlowRunModel(list.FirstOrDefault().FlowID);

            base.ViewBag.wfInstall = workFlowRunModel;
            base.ViewBag.flowid    = list.FirstOrDefault().FlowID.ToString();
            return(View(list));
        }
        public ActionResult InstanceManage()
        {
            RoadFlow.Platform.WorkFlowTask workFlowTask = new RoadFlow.Platform.WorkFlowTask();
            RoadFlow.Platform.WorkFlow     workFlow     = new RoadFlow.Platform.WorkFlow();
            string            text             = base.Request.QueryString["flowid1"];
            string            str              = base.Request.QueryString["groupid"];
            WorkFlowInstalled workFlowRunModel = workFlow.GetWorkFlowRunModel(text);
            IOrderedEnumerable <RoadFlow.Data.Model.WorkFlowTask> orderedEnumerable = from p in workFlowTask.GetTaskList(text.ToGuid(), str.ToGuid())
                                                                                      orderby p.Sort
                                                                                      select p;
            JsonData jsonData = new JsonData();

            foreach (RoadFlow.Data.Model.WorkFlowTask item in orderedEnumerable)
            {
                StringBuilder stringBuilder = new StringBuilder();
                stringBuilder.Append("<a style=\"background:url(" + base.Url.Content("~/Images/ico/permission.gif") + ") no-repeat left center; padding-left:18px;\" href=\"javascript:void(0);\" onclick=\"cngStatus('" + item.ID + "');\">状态</a>");
                if (item.Status.In(0, 1))
                {
                    stringBuilder.Append("<a style=\"background:url(" + base.Url.Content("~/Images/ico/arrow_medium_lower_left.png") + ") no-repeat left center; padding-left:16px;\" href=\"javascript:void(0);\" onclick=\"designate('" + item.ID + "');\">指派</a>");
                    stringBuilder.Append("<a style=\"background:url(" + base.Url.Content("~/Images/ico/arrow_medium_lower_right.png") + ") no-repeat left center; padding-left:16px;\" href=\"javascript:void(0);\" onclick=\"goTo('" + item.ID + "');\">跳转</a>");
                }
                JsonData jsonData2 = new JsonData();
                jsonData2["id"]             = item.ID.ToString();
                jsonData2["StepID"]         = workFlow.GetStepName(item.StepID, workFlowRunModel);
                jsonData2["SenderName"]     = item.SenderName;
                jsonData2["ReceiveTime"]    = item.ReceiveTime.ToDateTimeStringS();
                jsonData2["ReceiveName"]    = item.ReceiveName;
                jsonData2["CompletedTime1"] = (item.CompletedTime1.HasValue ? item.CompletedTime1.Value.ToDateTimeStringS() : "");
                jsonData2["Status"]         = workFlowTask.GetStatusTitle(item.Status);
                jsonData2["Comment"]        = item.Comment;
                jsonData2["Opation"]        = stringBuilder.ToString();
                jsonData.Add(jsonData2);
            }
            base.ViewBag.list = jsonData.ToJson();
            return(View());
        }
        public ActionResult Detail()
        {
            RoadFlow.Platform.WorkFlowTask workFlowTask = new RoadFlow.Platform.WorkFlowTask();
            RoadFlow.Platform.WorkFlow     workFlow     = new RoadFlow.Platform.WorkFlow();
            string            text             = base.Request.QueryString["flowid1"] ?? base.Request.QueryString["flowid"];
            string            text2            = base.Request.QueryString["groupid"];
            string            text3            = base.Request.QueryString["displaymodel"];
            WorkFlowInstalled workFlowRunModel = workFlow.GetWorkFlowRunModel(text);
            IOrderedEnumerable <RoadFlow.Data.Model.WorkFlowTask> orderedEnumerable = from p in workFlowTask.GetTaskList(text.ToGuid(), text2.ToGuid())
                                                                                      where p.Status != -1
                                                                                      orderby p.Sort, p.StepSort
            select p;
            string text4 = string.Format("&flowid1={0}&groupid={1}&appid={2}&tabid={3}&iframeid={4}&openerid={5}", text, text2, base.Request.QueryString["appid"], base.Request.QueryString["tabid"], base.Request.QueryString["iframeid"], base.Request.QueryString["openerid"]);
            string text5 = string.Format("&groupid={0}&appid={1}&tabid={2}&ismobile={3}", text2, base.Request.QueryString["appid"], base.Request.QueryString["tabid"], base.Request.QueryString["ismobile"]);

            base.ViewBag.flowid       = text;
            base.ViewBag.groupid      = text2;
            base.ViewBag.displayModel = text3;
            base.ViewBag.wfInstall    = workFlowRunModel;
            base.ViewBag.query        = text4;
            base.ViewBag.query1       = text5;
            JsonData jsonData = new JsonData();

            foreach (RoadFlow.Data.Model.WorkFlowTask item in orderedEnumerable)
            {
                JsonData jsonData2 = new JsonData();
                jsonData2["StepName"]       = item.StepName;
                jsonData2["SenderName"]     = item.SenderName;
                jsonData2["SenderTime"]     = item.SenderTime.ToDateTimeStringS();
                jsonData2["ReceiveName"]    = item.ReceiveName;
                jsonData2["CompletedTime1"] = (item.CompletedTime1.HasValue ? item.CompletedTime1.Value.ToDateTimeStringS() : "");
                jsonData2["StatusTitle"]    = workFlowTask.GetStatusTitle(item.Status);
                jsonData2["Comment"]        = item.Comment;
                jsonData2["Note"]           = item.Note;
                jsonData.Add(jsonData2);
            }
            base.ViewBag.list = (jsonData.IsArray ? jsonData.ToJson() : "{}");
            return(View(orderedEnumerable));
        }
 public ActionResult FlowCopyFor(FormCollection collection)
 {
     RoadFlow.Platform.WorkFlow workFlow = new RoadFlow.Platform.WorkFlow();
     RoadFlow.Platform.WorkFlowTask workFlowTask = new RoadFlow.Platform.WorkFlowTask();
     WorkFlowInstalled workFlowInstalled = null;
     RoadFlow.Data.Model.WorkFlowTask workFlowTask2 = null;
     string flowID = base.Request.QueryString["flowid"];
     string stepid = base.Request.QueryString["stepid"];
     string text = base.Request.QueryString["groupid"];
     string text2 = base.Request.QueryString["instanceid"];
     workFlowInstalled = workFlow.GetWorkFlowRunModel(flowID);
     if (workFlowInstalled == null)
     {
         base.Response.Write("未找到流程运行实体");
         base.Response.End();
         return null;
     }
     if ((from p in workFlowInstalled.Steps
     where p.ID == stepid.ToGuid()
     select p).Count() == 0)
     {
         base.Response.Write("未找到当前步骤");
         base.Response.End();
         return null;
     }
     workFlowTask2 = workFlowTask.Get(base.Request.QueryString["taskid"].ToGuid());
     if (workFlowTask2 == null)
     {
         base.Response.Write("当前任务为空,请先保存再抄送!");
         base.Response.End();
         return null;
     }
     if (collection != null)
     {
         List<RoadFlow.Data.Model.WorkFlowTask> taskList = workFlowTask.GetTaskList(workFlowTask2.ID);
         List<RoadFlow.Data.Model.Users> allUsers = new RoadFlow.Platform.Organize().GetAllUsers(base.Request.Form["user"] ?? "");
         StringBuilder stringBuilder = new StringBuilder();
         foreach (RoadFlow.Data.Model.Users item in allUsers)
         {
             if (taskList.Find((RoadFlow.Data.Model.WorkFlowTask p) => p.ReceiveID == item.ID) == null)
             {
                 Step step = (from p in workFlowInstalled.Steps
                 where p.ID == base.Request.QueryString["stepid"].ToGuid()
                 select p).First();
                 RoadFlow.Data.Model.WorkFlowTask workFlowTask3 = new RoadFlow.Data.Model.WorkFlowTask();
                 if (step.WorkTime > decimal.Zero)
                 {
                     workFlowTask3.CompletedTime = DateTimeNew.Now.AddHours((double)step.WorkTime);
                 }
                 workFlowTask3.FlowID = workFlowTask2.FlowID;
                 workFlowTask3.GroupID = workFlowTask2.GroupID;
                 workFlowTask3.ID = Guid.NewGuid();
                 workFlowTask3.Type = 5;
                 workFlowTask3.InstanceID = workFlowTask2.InstanceID;
                 workFlowTask3.Note = "抄送任务";
                 workFlowTask3.PrevID = workFlowTask2.PrevID;
                 workFlowTask3.PrevStepID = workFlowTask2.PrevStepID;
                 workFlowTask3.ReceiveID = item.ID;
                 workFlowTask3.ReceiveName = item.Name;
                 workFlowTask3.ReceiveTime = DateTimeNew.Now;
                 workFlowTask3.SenderID = workFlowTask2.ReceiveID;
                 workFlowTask3.SenderName = workFlowTask2.ReceiveName;
                 workFlowTask3.SenderTime = workFlowTask3.ReceiveTime;
                 workFlowTask3.Status = 0;
                 workFlowTask3.StepID = workFlowTask2.StepID;
                 workFlowTask3.StepName = workFlowTask2.StepName;
                 workFlowTask3.Sort = workFlowTask2.Sort;
                 workFlowTask3.Title = workFlowTask2.Title;
                 workFlowTask.Add(workFlowTask3);
                 stringBuilder.Append(workFlowTask3.ReceiveName);
                 stringBuilder.Append(",");
             }
         }
         base.ViewBag.script = "alert('成功抄送给:" + stringBuilder.ToString().TrimEnd(',') + "');new RoadUI.Window().close();";
     }
     return View();
 }