DisplayFlow.aspx.cs
上传用户:xgw_05
上传日期:2009-12-11
资源大小:20208k
文件大小:5k
源码类别:

OA系统

开发平台:

C#

  1. using System;
  2. using System.Collections;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Web;
  7. using System.Web.SessionState;
  8. using System.Web.UI;
  9. using System.Web.UI.WebControls;
  10. using System.Web.UI.HtmlControls;
  11. using System.Data.SqlClient;
  12. using UDS.Components;
  13. namespace UDS.SubModule.UnitiveDocument.DocumentFlow
  14. {
  15. /// <summary>
  16. /// DisplayFlow 的摘要说明。
  17. /// </summary>
  18. /// 
  19. public class DisplayFlow : System.Web.UI.Page
  20. {
  21. public long FlowID;
  22. private void Page_Load(object sender, System.EventArgs e)
  23. {
  24. // 在此处放置用户代码以初始化页面
  25. FlowID = Int32.Parse(Request.QueryString["FlowID"]!=null?Request.QueryString["FlowID"].ToString():"0");
  26. Bind();
  27. }
  28. void Bind()
  29. {
  30. UDS.Components.DocumentFlow df = new UDS.Components.DocumentFlow();
  31. DataTable dt;
  32. Table tt = new Table();
  33. TableRow tr = new TableRow();
  34. TableCell tc = new TableCell();
  35. tt.Style.Add("font-size","10pt");
  36. tt.Width = Unit.Percentage(100);
  37. tt.HorizontalAlign  = HorizontalAlign.Center;
  38. AddRow(tt,df.GetFlowTitle(FlowID),Color.FromArgb(250,250,250));
  39. df.GetStep(FlowID,0,out dt);
  40. for(int i=0;i<dt.Rows.Count;i++)
  41. {
  42. AddStep(tt,dt.Rows[i],i+1);
  43. AddRow(tt,"<span lang='EN-US' style='font-size: 10.5pt; font-family: Wingdings'>ò</span>",Color.FromArgb(250,250,250));
  44. }
  45. df = null;
  46. AddRow(tt,"<a href='#' onclick='history.back();'>流程结束</a>",Color.FromArgb(250,250,250));
  47. Page.Controls.Add(tt);
  48. }
  49. void AddRow(Table tab,string Label,string Caption)
  50. {
  51. TableRow tr = new TableRow();
  52. TableCell td1 = new TableCell();
  53. TableCell td2 = new TableCell();
  54. td1.Text = Label;
  55. td1.HorizontalAlign = HorizontalAlign.Right;
  56. td1.BackColor = Color.FromArgb(240,240,240);
  57. td1.Style.Add("width","100px");
  58. td2.Text = Caption;
  59. td2.HorizontalAlign = HorizontalAlign.Left ;
  60. td2.Style.Add("width","300px");
  61. tr.Cells.Add(td1);
  62. tr.Cells.Add(td2);
  63. tab.Rows.Add(tr);
  64. }
  65. void AddRow(Table tab,string Label,string Caption,Color BackColor)
  66. {
  67. TableRow tr = new TableRow();
  68. TableCell td1 = new TableCell();
  69. TableCell td2 = new TableCell();
  70. td1.Text = Label;
  71. td1.HorizontalAlign = HorizontalAlign.Right;
  72. td1.BackColor = BackColor;
  73. td2.Text = Caption;
  74. td2.HorizontalAlign = HorizontalAlign.Left ;
  75. td2.BackColor = BackColor;
  76. td1.Style.Add("width","100px");
  77. td2.Style.Add("width","300px");
  78. tr.Cells.Add(td1);
  79. tr.Cells.Add(td2);
  80. tab.Rows.Add(tr);
  81. }
  82. void AddRow(Table tab,string Label,Color BackColor)
  83. {
  84. TableRow tr = new TableRow();
  85. TableCell td = new TableCell();
  86. td.Text = Label;
  87. td.HorizontalAlign = HorizontalAlign.Center;
  88. td.BackColor = BackColor;
  89. tr.Cells.Add(td);
  90. tab.Rows.Add(tr);
  91. }
  92. void AddStep(Table tab,DataRow dd,int Step)
  93. {
  94. Table tt = new Table();
  95. TableRow tr = new TableRow();
  96. TableCell tc = new TableCell();
  97. long top = 300+500 * Step;
  98. tt.HorizontalAlign = HorizontalAlign.Center;
  99. tt.Style.Add("left","100px");
  100. tt.Style.Add("top",top.ToString() + "px");
  101. //tt.Style.Add("BORDER-COLLAPSE","collapse");
  102. tt.Style.Add("width","400px");
  103. tt.Style.Add("font-size","10pt");
  104. tt.BorderColor = Color.FromArgb(0,0,0);
  105. tt.BorderWidth = 1;
  106. AddRow(tt,"第" + Step.ToString() + "步",dd["step_name"].ToString(),Color.FromArgb(255,245,245));
  107. switch(dd["Flow_rule"].ToString())
  108. {
  109. case "0":
  110. AddRow(tt,"流程规则","按人员");
  111. break;
  112. case "1":
  113. AddRow(tt,"流程规则","按职位");
  114. break;
  115. case "2":
  116. AddRow(tt,"流程规则","按项目");
  117. break;
  118. }
  119. AddRow(tt,"强制结束",dd["RightToFinish"].ToString()=="True"?"能":"否");
  120. if(Int32.Parse(dd["passnum"].ToString())>0)
  121. AddRow(tt,"是否会签",dd["passnum"].ToString() + "人会签");
  122. else if(Int32.Parse(dd["passnum"].ToString())==0)
  123. AddRow(tt,"是否会签","不需要会签");
  124. else if(Int32.Parse(dd["passnum"].ToString())<0)
  125. AddRow(tt,"是否会签","全体通过!");
  126. tc.Controls.Add(tt);
  127. //添加条件跳转
  128. if(Int32.Parse(dd["jump_count"].ToString())>0)
  129. {
  130. UDS.Components.DocumentFlow df = new UDS.Components.DocumentFlow();
  131. DataTable dt;
  132. df.GetJump(FlowID,Step,0,out dt);
  133. for(int i=0;i<dt.Rows.Count;i++)
  134. {
  135. AddRow(tt,"条件" + dt.Rows[i]["Priority"].ToString() ,dt.Rows[i]["Field_Description"].ToString() + dt.Rows[i]["compare"].ToString() + dt.Rows[i]["comparevalue"].ToString() + "<span lang='EN-US' style='font-family: Wingdings'>&eth;</span>" + dt.Rows[i]["step_name"].ToString());
  136. }
  137. df = null;
  138. }
  139. tr.Cells.Add(tc);
  140. tab.Rows.Add(tr);
  141. }
  142. #region Web Form Designer generated code
  143. override protected void OnInit(EventArgs e)
  144. {
  145. //
  146. // CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。
  147. //
  148. InitializeComponent();
  149. base.OnInit(e);
  150. }
  151. /// <summary>
  152. /// 设计器支持所需的方法 - 不要使用代码编辑器修改
  153. /// 此方法的内容。
  154. /// </summary>
  155. private void InitializeComponent()
  156. {    
  157. this.Load += new System.EventHandler(this.Page_Load);
  158. }
  159. #endregion
  160. }
  161. }