<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebForm.Platform.WorkFlowRun.Default" %> <% string flowid = Request.QueryString["flowid"]; string instanceid = Request.QueryString["instanceid"]; string taskid = Request.QueryString["taskid"]; string stepid = Request.QueryString["stepid"]; string groupid = Request.QueryString["groupid"]; string display = Request.QueryString["display"] ?? "0"; RoadFlow.Platform.WorkFlow bworkFlow = new RoadFlow.Platform.WorkFlow(); RoadFlow.Platform.WorkFlowTask btask = new RoadFlow.Platform.WorkFlowTask(); RoadFlow.Platform.WorkFlowButtons bworkFlowButtons = new RoadFlow.Platform.WorkFlowButtons(); RoadFlow.Platform.AppLibrary bappLibrary = new RoadFlow.Platform.AppLibrary(); Guid flowID; if (!flowid.IsGuid(out flowID)) { Response.Write("流程ID为空!"); Response.End(); } var wfInstalled = bworkFlow.GetWorkFlowRunModel(flowID); if (wfInstalled == null) { Response.Write("未找到流程运行时!"); Response.End(); } else if (wfInstalled.Status == 3) { Response.Write("该流程已被卸载,不能发起新的流程实例!"); Response.End(); } else if (wfInstalled.Status == 4) { Response.Write("该流程已被删除,不能发起新的实例!"); Response.End(); } Guid stepID; if (!stepid.IsGuid(out stepID)) { stepID = wfInstalled.FirstStepID; } RoadFlow.Data.Model.WorkFlowInstalledSub.Step currentStep = wfInstalled.Steps.ToList().Find(p => p.ID == stepID); if (currentStep == null) { Response.Write("未找到流程步骤!"); Response.End(); } int isArchives = currentStep.Archives;//是否要归档 string query = string.Format("flowid={0}&instanceid={1}&taskid={2}&stepid={3}&groupid={4}&appid={5}&tabid={6}", flowID, instanceid, taskid, stepID, groupid, Request.QueryString["appid"], Request.QueryString["tabid"]); //是否是抄送任务 bool isCopyFor = false; //更新打开时间 Guid taskgid; //如果是执行,并且任务ID为GUID,则更新打开时间和状态,检查当前任务是否可以执行。 if ("0" == display && taskid.IsGuid(out taskgid)) { btask.UpdateOpenTime(taskgid, RoadFlow.Utility.DateTimeNew.Now, true); var task = btask.Get(taskgid); if (task != null) { if ("1" != display && task.Status.In(2, 3, 4, 5)) { Response.Write(""); Response.End(); } else if ("1" != display && task.ReceiveID != RoadFlow.Platform.Users.CurrentUserID) { Response.Write(""); Response.End(); } isCopyFor = task.Type == 5; } } var form = currentStep.Forms.First();//目前只显示一个表单 var appLibrary = bappLibrary.Get(form.ID, true); string src = appLibrary == null ? "" : WebForm.Common.Tools.BaseUrl + appLibrary.Address; bool isCustomeForm = appLibrary != null && appLibrary.Code.IsNullOrEmpty();//是否是自定义表单 int debugType = wfInstalled.Debug; wfInstalled.DebugUsers.RemoveAll(p => p == null); bool isDebug = (debugType == 1 || debugType == 2) && wfInstalled.DebugUsers.Exists(p => p.ID == RoadFlow.Platform.Users.CurrentUserID); bool isSign = currentStep.SignatureType == 1 || currentStep.SignatureType == 2;//是否有意见 int signType = currentStep.SignatureType; %>
<%if ("0" == display){ //display为0表示执行,1表示查看 %>
<% //如果是抄送,只显示完成按钮 List buttons = new List(); if (isCopyFor) { buttons.Add(new RoadFlow.Data.Model.WorkFlowInstalledSub.StepSet.Button() { ID = "954EFFA8-03B8-461A-AAA8-8727D090DCB9", Note = "完成", Sort = 0 }); } else { foreach (var button in currentStep.Buttons) { buttons.Add(button); } } foreach (var button in buttons) { if (button == null) { continue; } Guid buttonID; if (button.ID.IsGuid(out buttonID)) { var button1 = bworkFlowButtons.Get(buttonID, true); if (button1 == null) { continue; } var funName = string.Concat("fun_", button1.ID.ToString("N"), "()"); %> "> <%=button1.Title %> <%}else if (string.Compare(button.ID, "other_splitline", true) == 0){ //显示其它特定按钮如分隔线| %>   <%}%> <%}%>
<%if (isDebug && debugType == 1){%>

<%}else{%> <%}%> <%} %>
" id="form_body_div"> <% if (!src.IsNullOrEmpty()) { if (!isCustomeForm) { System.Text.StringBuilder sb = new System.Text.StringBuilder(); System.IO.TextWriter tw = new System.IO.StringWriter(sb); Server.Execute(src, tw); Response.Write(sb.ToString().RemovePageTag()); } else { Response.Write(""); Response.Write(""); Response.Write(""); //Response.Write(""); src = src.IndexOf('?') >= 0 ? src + Request.Url.Query.Substring(1) : src + Request.Url.Query; Response.Write(""); } } %>
<% if (isSign && "0" == display && !isCopyFor) { string commentsOptions = new RoadFlow.Platform.WorkFlowComment().GetOptionsStringByUserID(RoadFlow.Platform.Users.CurrentUserID); %>
处理意见:  <%if (signType == 2){%> <% string signFile = string.Concat(Server.MapPath("../../Files/UserSigns/"), RoadFlow.Platform.Users.CurrentUserID, ".gif"); string signSrc = string.Concat("../../Files/UserSigns/", RoadFlow.Platform.Users.CurrentUserID, ".gif"); if (!System.IO.File.Exists(signFile)) { System.Drawing.Bitmap img = new RoadFlow.Platform.WorkFlow().CreateSignImage(RoadFlow.Platform.Users.CurrentUserName); if (img != null) { img.Save(signFile, System.Drawing.Imaging.ImageFormat.Gif); } } %> <%}%>
<%}%>
<% if (currentStep.OpinionDisplay == 1)//如果步骤设置为要显示意见 { Server.Execute("ShowComment.aspx"); } %>