RoadFlow2.1 临时演示

Opation.aspx 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Opation.aspx.cs" Inherits="WebForm.Platform.WorkFlowDesigner.Opation" %>
  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. </head>
  8. <body>
  9. <%
  10. string op = Request.QueryString["op"];
  11. string title = string.Empty;
  12. switch (op)
  13. {
  14. case "save":
  15. title = "正在保存...";
  16. break;
  17. case "install":
  18. title = "正在安装...";
  19. break;
  20. case "uninstall":
  21. title = "正在卸载...";
  22. break;
  23. case "delete":
  24. title = "正在删除...";
  25. break;
  26. }
  27. %>
  28. <div style="margin:0 auto; text-align:center; padding-top:28px;">
  29. <div>
  30. <img src="../../Images/loading/load1.gif" alt="" />
  31. </div>
  32. <div style="margin-top:5px;">
  33. <%=title %>
  34. </div>
  35. </div>
  36. <script type="text/javascript">
  37. var op = "<%=op%>";
  38. var openerid = '<%=Request.QueryString["openerid"]%>';
  39. var frame = null;
  40. $(function ()
  41. {
  42. var iframes = top.frames;
  43. for (var i = 0; i < iframes.length; i++)
  44. {
  45. if (iframes[i].name == openerid + "_iframe")
  46. {
  47. frame = iframes[i]; break;
  48. }
  49. }
  50. if (frame == null) return;
  51. switch (op)
  52. {
  53. case "save":
  54. save();
  55. break;
  56. case "install":
  57. install();
  58. break;
  59. case "uninstall":
  60. uninstall(0);
  61. break;
  62. case "delete":
  63. uninstall(1);
  64. break;
  65. }
  66. });
  67. function save()
  68. {
  69. var json = JSON.stringify(frame.wf_json);
  70. $.ajax({
  71. url: "Save.ashx", type: "post", async: true, dataType: "text", data: { json: json }, success: function (txt)
  72. {
  73. if (1 == txt)
  74. {
  75. alert("保存成功!");
  76. }
  77. else
  78. {
  79. alert(txt);
  80. }
  81. window.setTimeout('new RoadUI.Window().close();', 1);
  82. }, error: function (obj) { alert(obj.responseText); window.setTimeout('new RoadUI.Window().close();', 1); }
  83. });
  84. }
  85. function install()
  86. {
  87. var json = JSON.stringify(frame.wf_json);
  88. $.ajax({
  89. url: "Install.ashx", type: "post", async: true, dataType: "text", data: { json: json }, success: function (txt)
  90. {
  91. if (1 == txt)
  92. {
  93. alert("安装成功!");
  94. }
  95. else
  96. {
  97. alert(txt);
  98. }
  99. window.setTimeout('new RoadUI.Window().close();', 1);
  100. }, error: function (obj) { alert(obj.responseText); window.setTimeout('new RoadUI.Window().close();', 1); }
  101. });
  102. }
  103. function uninstall(type)
  104. {
  105. var json = frame.wf_json;
  106. $.ajax({
  107. url: "UnInstall.ashx", type: "post", async: true, dataType: "text", data: { id: json.id, type: type }, success: function (txt)
  108. {
  109. if (1 == txt)
  110. {
  111. alert((type == 0 ? "卸载" : "删除") + "成功!");
  112. }
  113. else
  114. {
  115. alert(txt);
  116. }
  117. window.setTimeout('new RoadUI.Window().close();', 1);
  118. }, error: function (obj) { alert(obj.responseText); window.setTimeout('new RoadUI.Window().close();', 1); }
  119. });
  120. }
  121. </script>
  122. </body>
  123. </html>