public string GetTaskStepDetails()
        {
            BizProcess.Platform.WorkFlowTask bworkFlowTask = new BizProcess.Platform.WorkFlowTask();

            string flowid  = Request.QueryString["flowid"];
            string stepid  = Request.QueryString["stepid"];
            string groupid = Request.QueryString["groupid"];

            List <BizProcess.Data.Model.WorkFlowTask> tasks = bworkFlowTask.GetTaskList(flowid.ToGuid(), stepid.ToGuid(), groupid.ToGuid());

            string retJson = "";

            if (tasks.Count > 0)
            {
                //to do: permission check

                retJson  = "{";
                retJson += string.Format("\"flowid\":\"{0}\",", tasks[0].FlowID);
                retJson += string.Format("\"stepid\":\"{0}\",", tasks[0].StepID);
                retJson += string.Format("\"stepname\":\"{0}\",", tasks[0].StepName);
                retJson += string.Format("\"groupid\":\"{0}\",", tasks[0].GroupID);
                retJson += string.Format("\"instanceid\":\"{0}\",", tasks[0].InstanceID);
                retJson += string.Format("\"taskid\":\"{0}\"", tasks[0].ID);
                retJson += "}";
            }
            return(retJson);
        }
        public ActionResult DetailSubFlow()
        {
            BizProcess.Platform.WorkFlowTask bworkFlowTask = new BizProcess.Platform.WorkFlowTask();
            BizProcess.Platform.WorkFlow     bworkFlow     = new BizProcess.Platform.WorkFlow();

            string query = 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}",
                                         Request.QueryString["flowid"],
                                         Request.QueryString["groupid"],
                                         Request.QueryString["appid"],
                                         Request.QueryString["tabid"],
                                         Request.QueryString["title"].UrlEncode(),
                                         Request.QueryString["flowid"],
                                         Request.QueryString["sender"],
                                         Request.QueryString["date1"],
                                         Request.QueryString["date2"],
                                         Request.QueryString["iframeid"],
                                         Request.QueryString["openerid"],
                                         Request.QueryString["taskid"]
                                         );

            ViewBag.flowid       = Request.QueryString["flowid"];
            ViewBag.groupid      = Request.QueryString["groupid"];
            ViewBag.displayModel = Request.QueryString["displaymodel"];
            ViewBag.wfInstall    = null;
            ViewBag.query        = query;

            string taskid       = Request.QueryString["taskid"];
            string displayModel = Request.QueryString["displaymodel"];

            if (!taskid.IsGuid())
            {
                return(View(new List <BizProcess.Data.Model.WorkFlowTask>()));
            }
            var task = bworkFlowTask.Get(taskid.ToGuid());

            if (task == null || !task.SubFlowGroupID.HasValue)
            {
                return(View(new List <BizProcess.Data.Model.WorkFlowTask>()));
            }
            var subFlowTasks = bworkFlowTask.GetTaskList(Guid.Empty, task.SubFlowGroupID.Value);

            if (subFlowTasks.Count == 0)
            {
                return(View(new List <BizProcess.Data.Model.WorkFlowTask>()));
            }

            var wfInstall = bworkFlow.GetWorkFlowRunModel(subFlowTasks.First().FlowID);
            var tasks     = subFlowTasks.OrderBy(p => p.Sort);

            ViewBag.wfInstall = wfInstall;
            ViewBag.flowid    = subFlowTasks.First().FlowID.ToString();
            return(View(tasks));
        }
        public ActionResult Detail()
        {
            BizProcess.Platform.WorkFlowTask bworkFlowTask = new BizProcess.Platform.WorkFlowTask();
            BizProcess.Platform.WorkFlow     bworkFlow     = new BizProcess.Platform.WorkFlow();

            string flowid       = Request.QueryString["flowid1"] ?? Request.QueryString["flowid"];
            string groupid      = Request.QueryString["groupid"];
            string displayModel = Request.QueryString["displaymodel"];

            if (displayModel.IsNullOrEmpty())
            {
                displayModel = "1";
            }

            var    wfInstall = bworkFlow.GetWorkFlowRunModel(flowid);
            var    tasks     = bworkFlowTask.GetTaskList(flowid.ToGuid(), groupid.ToGuid()).OrderBy(p => p.Sort);
            string query     = string.Format("&flowid1={0}&groupid={1}&appid={2}&tabid={3}&title={4}&flowid={5}&sender={6}&date1={7}&date2={8}&iframeid={9}&openerid={10}",
                                             flowid, groupid,
                                             Request.QueryString["appid"],
                                             Request.QueryString["tabid"],
                                             Request.QueryString["title"].UrlEncode(),
                                             Request.QueryString["flowid"],
                                             Request.QueryString["sender"],
                                             Request.QueryString["date1"],
                                             Request.QueryString["date2"],
                                             Request.QueryString["iframeid"],
                                             Request.QueryString["openerid"]
                                             );

            ViewBag.flowid       = flowid;
            ViewBag.groupid      = groupid;
            ViewBag.displayModel = displayModel;
            ViewBag.wfInstall    = wfInstall;
            ViewBag.query        = query;
            return(View(tasks));
        }