RoadFlow2.1 临时演示

Print.aspx 2.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Print.aspx.cs" Inherits="WebForm.Platform.WorkFlowRun.Print" %>
  2. <!DOCTYPE html>
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head runat="server">
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  6. <title></title>
  7. <link href="/Platform/WorkFlowRun/Scripts/Forms/flowform_print.css" rel="stylesheet" />
  8. <style type="text/css" media="print">
  9. .Noprint { display: none; }
  10. </style>
  11. </head>
  12. <body>
  13. <div id="buttondiv" class="Noprint" style="margin-left:20px;">
  14. <button onclick="print1();" style="margin-right:6px;">确认打印</button>
  15. <button onclick="window.close();">取消关闭</button>
  16. </div>
  17. <div style="width:98%; margin:-50px auto 0 auto;">
  18. <%
  19. string flowid = Request.QueryString["flowid"];
  20. string stepid = Request.QueryString["stepid"];
  21. string instanceid = Request.QueryString["instanceid"];
  22. string taskid = Request.QueryString["taskid"];
  23. string groupid = Request.QueryString["groupid"];
  24. if (instanceid.IsNullOrEmpty())
  25. {
  26. instanceid = Request.QueryString["instanceid1"];
  27. }
  28. RoadFlow.Platform.WorkFlow bworkFlow = new RoadFlow.Platform.WorkFlow();
  29. RoadFlow.Platform.WorkFlowTask btask = new RoadFlow.Platform.WorkFlowTask();
  30. RoadFlow.Data.Model.WorkFlowInstalled wfInstalled = bworkFlow.GetWorkFlowRunModel(flowid);
  31. if (wfInstalled == null)
  32. {
  33. Response.Write("未找到流程运行实体");
  34. Response.End();
  35. }
  36. var steps = wfInstalled.Steps.Where(p => p.ID == stepid.ToGuid());
  37. if (steps.Count() == 0)
  38. {
  39. Response.Write("未找到当前步骤");
  40. Response.End();
  41. }
  42. var currentStep = steps.First();
  43. if (currentStep.Forms.Count() == 0)
  44. {
  45. Response.Write("当前步骤没有表单");
  46. Response.End();
  47. }
  48. var form = new RoadFlow.Platform.AppLibrary().Get(currentStep.Forms.First().ID);
  49. if (form != null)
  50. {
  51. string src = form.Address;
  52. if (!src.IsNullOrEmpty())
  53. {
  54. System.Text.StringBuilder sb = new System.Text.StringBuilder();
  55. System.IO.TextWriter tw = new System.IO.StringWriter(sb);
  56. try
  57. {
  58. Server.Execute(src, tw);
  59. Response.Write(sb.ToString().RemovePageTag());
  60. }
  61. catch (Exception err)
  62. {
  63. Response.Write(err.Message);
  64. }
  65. }
  66. }
  67. %>
  68. </div>
  69. <div style="margin-top:-10px;">
  70. <%Server.Execute("ShowComment.aspx"); %>
  71. </div>
  72. <script type="text/javascript">
  73. function print1()
  74. {
  75. window.print();
  76. }
  77. </script>
  78. </body>
  79. </html>