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 text2 = base.Request.QueryString["groupid"]; WorkFlowInstalled workFlowRunModel = workFlow.GetWorkFlowRunModel(text); IOrderedEnumerable <RoadFlow.Data.Model.WorkFlowTask> orderedEnumerable = from p in workFlowTask.GetTaskList(MyExtensions.ToGuid(text), MyExtensions.ToGuid(text2)) 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 (MyExtensions.In(item.Status, new int[2] { 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"] = MyExtensions.ToDateTimeStringS(item.ReceiveTime); jsonData2["ReceiveName"] = item.ReceiveName; jsonData2["CompletedTime1"] = (item.CompletedTime1.HasValue ? MyExtensions.ToDateTimeStringS(item.CompletedTime1.Value) : ""); 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(MyExtensions.ToGuid(text), MyExtensions.ToGuid(text2)) 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"] = MyExtensions.ToDateTimeStringS(item.SenderTime); jsonData2["ReceiveName"] = item.ReceiveName; jsonData2["CompletedTime1"] = (item.CompletedTime1.HasValue ? MyExtensions.ToDateTimeStringS(item.CompletedTime1.Value) : ""); 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)); }