InstanceGridView.cs
上传用户:li2971742
上传日期:2021-11-18
资源大小:39096k
文件大小:21k
源码类别:

OA系统

开发平台:

C#

  1. using System;
  2. using System.Web.UI;
  3. using System.Web.UI.WebControls;
  4. using System.ComponentModel;
  5. namespace OThinker.H3.Portal
  6. {
  7. /// <summary>
  8. /// Summary description for InstanceGridView.
  9. /// </summary>
  10. [DefaultProperty("Text"), 
  11. ToolboxData("<{0}:InstanceGridView runat=server></{0}:InstanceGridView>")]
  12. public class InstanceGridView : DataGrid
  13. {
  14. #region 列
  15.         protected BoundColumn InstanceIDColumn = new BoundColumn();
  16. protected int InstanceIDColumnIndex
  17. {
  18. get
  19. {
  20. return this.Columns.IndexOf(this.InstanceIDColumn);
  21. }
  22. }
  23.         protected BoundColumn PriorityColumn = new BoundColumn();
  24.         protected int PriorityColumnIndex
  25.         {
  26.             get
  27.             {
  28.                 return this.Columns.IndexOf(this.PriorityColumn);
  29.             }
  30.         }
  31.         protected BoundColumn InstanceNameColumn = new BoundColumn();
  32. protected int InstanceNameColumnIndex
  33. {
  34. get
  35. {
  36. return this.Columns.IndexOf(this.InstanceNameColumn);
  37. }
  38. }
  39.         protected BoundColumn TitleColumn = new BoundColumn();
  40.         protected int TitleColumnIndex
  41.         {
  42.             get
  43.             {
  44.                 return this.Columns.IndexOf(this.TitleColumn);
  45.             }
  46.         }
  47. protected BoundColumn OrgUnitColumn = new BoundColumn();
  48. protected int OrgUnitColumnIndex
  49. {
  50. get
  51. {
  52. return this.Columns.IndexOf(this.OrgUnitColumn);
  53. }
  54. }
  55. protected BoundColumn WorkflowPackageColumn = new BoundColumn();
  56. protected int WorkflowPackageColumnIndex
  57. {
  58. get
  59. {
  60. return this.Columns.IndexOf(this.WorkflowPackageColumn);
  61. }
  62. }
  63. protected BoundColumn WorkflowNameColumn = new BoundColumn();
  64. protected int WorkflowNameColumnIndex
  65. {
  66. get
  67. {
  68. return this.Columns.IndexOf(this.WorkflowNameColumn);
  69. }
  70. }
  71. protected BoundColumn WorkflowVersionColumn = new BoundColumn();
  72. protected int WorkflowVersionColumnIndex
  73. {
  74. get
  75. {
  76. return this.Columns.IndexOf(this.WorkflowVersionColumn);
  77. }
  78. }
  79. protected BoundColumn WorkflowFullNameColumn = new BoundColumn();
  80. protected int WorkflowFullNameColumnIndex
  81. {
  82. get
  83. {
  84. return this.Columns.IndexOf(this.WorkflowFullNameColumn);
  85. }
  86. }
  87. protected BoundColumn OriginatorColumn = new BoundColumn();
  88. protected int OriginatorColumnIndex
  89. {
  90. get
  91. {
  92. return this.Columns.IndexOf(this.OriginatorColumn);
  93. }
  94. }
  95. protected BoundColumn StateColumn = new BoundColumn();
  96. protected int StateColumnIndex
  97. {
  98. get
  99. {
  100. return this.Columns.IndexOf(this.StateColumn);
  101. }
  102. }
  103. protected BoundColumn FormattedStateColumn = new BoundColumn();
  104. protected int FormattedStateColumnIndex
  105. {
  106. get
  107. {
  108. return this.Columns.IndexOf(this.FormattedStateColumn);
  109. }
  110. }
  111. protected BoundColumn ExceptionalColumn = new BoundColumn();
  112. protected int ExceptionalColumnIndex
  113. {
  114. get
  115. {
  116. return this.Columns.IndexOf(this.ExceptionalColumn);
  117. }
  118. }
  119. protected BoundColumn SuspendedColumn = new BoundColumn();
  120. protected int SuspendedColumnIndex
  121. {
  122. get
  123. {
  124. return this.Columns.IndexOf(this.SuspendedColumn);
  125. }
  126. }
  127. protected BoundColumn CreatedTimeColumn = new BoundColumn();
  128. protected int CreatedTimeColumnIndex
  129. {
  130. get
  131. {
  132. return this.Columns.IndexOf(this.CreatedTimeColumn);
  133. }
  134. }
  135. protected BoundColumn FormattedCreatedTimeColumn = new BoundColumn();
  136. protected int FormattedCreatedTimeColumnIndex
  137. {
  138. get
  139. {
  140. return this.Columns.IndexOf(this.FormattedCreatedTimeColumn);
  141. }
  142. }
  143. protected BoundColumn StartTimeColumn = new BoundColumn();
  144. protected int StartTimeColumnIndex
  145. {
  146. get
  147. {
  148. return this.Columns.IndexOf(this.StartTimeColumn);
  149. }
  150. }
  151. protected BoundColumn FormattedStartTimeColumn = new BoundColumn();
  152. protected int FormattedStartTimeColumnIndex
  153. {
  154. get
  155. {
  156. return this.Columns.IndexOf(this.FormattedStartTimeColumn);
  157. }
  158. }
  159. protected BoundColumn FinishTimeColumn = new BoundColumn();
  160. protected int FinishTimeColumnIndex
  161. {
  162. get
  163. {
  164. return this.Columns.IndexOf(this.FinishTimeColumn);
  165. }
  166. }
  167. protected BoundColumn FormattedFinishTimeColumn = new BoundColumn();
  168. protected int FormattedFinishTimeColumnIndex
  169. {
  170. get
  171. {
  172. return this.Columns.IndexOf(this.FormattedFinishTimeColumn);
  173. }
  174. }
  175. protected BoundColumn StayTimeColumn = new BoundColumn();
  176. protected int StayTimeColumnIndex
  177. {
  178. get
  179. {
  180. return this.Columns.IndexOf(this.StayTimeColumn);
  181. }
  182. }
  183. protected BoundColumn FormattedPriorityColumn = new BoundColumn();
  184. protected int FormattedPriorityColumnIndex
  185. {
  186. get
  187. {
  188. return this.Columns.IndexOf(this.FormattedPriorityColumn);
  189. }
  190. }
  191.         protected BoundColumn ViewColumn = new BoundColumn();
  192.         protected int ViewColumnIndex
  193.         {
  194.             get
  195.             {
  196.                 return this.Columns.IndexOf(this.ViewColumn);
  197.             }
  198.         }
  199.         public BoundColumn PlanFinishTimeColumn = new BoundColumn();
  200.         protected int PlanFinishTimeColumnIndex
  201.         {
  202.             get
  203.             {
  204.                 return this.Columns.IndexOf(this.PlanFinishTimeColumn);
  205.             }
  206.         }
  207.         public BoundColumn EstimatedFinishTimeColumn = new BoundColumn();
  208.         protected int EstimatedFinishTimeColumnIndex
  209.         {
  210.             get
  211.             {
  212.                 return this.Columns.IndexOf(this.EstimatedFinishTimeColumn);
  213.             }
  214.         }
  215.         protected BoundColumn ApprovalColumn = new BoundColumn();
  216.         protected int ApprovalColumnIndex
  217.         {
  218.             get
  219.             {
  220.                 return this.Columns.IndexOf(this.ApprovalColumn);
  221.             }
  222.         }
  223.         public BoundColumn RecurrencesColumn = new BoundColumn();
  224.         protected int RecurrencesColumnIndex
  225.         {
  226.             get
  227.             {
  228.                 return this.Columns.IndexOf(this.RecurrencesColumn);
  229.             }
  230.         }
  231. private void InitializeColumn(BoundColumn Column, string HeaderText, string DataField)
  232. {
  233. Column.HeaderText = HeaderText;
  234. Column.DataField = DataField;
  235. Column.ItemStyle.CssClass = this.ItemStyle.CssClass;
  236. this.Columns.Add(Column);
  237. }
  238. #endregion
  239. #region 获得单元的组合值
  240. // 获得流程模板的全名
  241. protected string GetWorkflowFullName(DataGridItemEventArgs e)
  242. {
  243. string workflowPackage = e.Item.Cells[this.WorkflowPackageColumnIndex].Text;
  244. string workflowName = e.Item.Cells[this.WorkflowNameColumnIndex].Text;
  245. string strWorkflowVersion = e.Item.Cells[this.WorkflowVersionColumnIndex].Text;
  246.             int workflowVersion = H3.WorkflowTemplate.WorkflowTemplate.NullWorkflowVersion;
  247. if(strWorkflowVersion != null && strWorkflowVersion != "")
  248. {
  249. workflowVersion = int.Parse(strWorkflowVersion);
  250. }
  251.             string workflowFullName = OThinker.H3.WorkflowTemplate.WorkflowTemplate.GetWorkflowFullName(
  252. workflowPackage, 
  253. workflowName, 
  254. workflowVersion);
  255. return workflowFullName;
  256. }
  257. protected OThinker.H3.Instance.InstanceState GetState(DataGridItemEventArgs e)
  258. {
  259. int intState = int.Parse(e.Item.Cells[this.StateColumnIndex].Text);
  260. return (OThinker.H3.Instance.InstanceState)intState;
  261. }
  262. protected OThinker.H3.Instance.PriorityType GetPriority(DataGridItemEventArgs e)
  263. {
  264. int intPriority = int.Parse(e.Item.Cells[this.PriorityColumnIndex].Text);
  265. return (OThinker.H3.Instance.PriorityType)intPriority;
  266. }
  267. protected bool GetExceptional(DataGridItemEventArgs e)
  268. {
  269. return e.Item.Cells[this.ExceptionalColumnIndex].Text == "1";
  270. }
  271. protected bool GetSuspended(DataGridItemEventArgs e)
  272. {
  273. return e.Item.Cells[this.SuspendedColumnIndex].Text == "1";
  274. }
  275. protected System.DateTime GetCreatedTime(DataGridItemEventArgs e)
  276. {
  277. return System.DateTime.Parse(e.Item.Cells[this.CreatedTimeColumnIndex].Text);
  278. }
  279. protected System.DateTime GetFinishTime(DataGridItemEventArgs e)
  280. {
  281. return System.DateTime.Parse(e.Item.Cells[this.FinishTimeColumnIndex].Text);
  282. }
  283. protected System.TimeSpan GetStayTime(DataGridItemEventArgs e)
  284. {
  285. // 滞留时间
  286. System.TimeSpan stayTime;
  287. if(this.GetState(e) == OThinker.H3.Instance.InstanceState.Complete)
  288. {
  289. stayTime = this.GetFinishTime(e).Subtract(this.GetCreatedTime(e));
  290. }
  291. else
  292. {
  293. stayTime = System.DateTime.Now.Subtract(this.GetCreatedTime(e));
  294. }
  295. return stayTime;
  296. }
  297.         public const string Target = "InstanceMain";
  298.         protected string GetUrl(DataGridItemEventArgs e)
  299.         {
  300.             return PortalPage.PageName_InstanceDetail + "?" + PortalPage.Param_InstanceId + "=" + e.Item.Cells[this.InstanceIDColumnIndex].Text;
  301.         }
  302.         protected string GetTitle(DataGridItemEventArgs e)
  303.         {
  304.             if (e.Item.Cells[this.InstanceNameColumnIndex].Text == null || e.Item.Cells[this.InstanceNameColumnIndex].Text.Trim() == "&nbsp;")
  305.             {
  306.                 return e.Item.Cells[this.WorkflowFullNameColumnIndex].Text;
  307.             }
  308.             else
  309.             {
  310.                 return e.Item.Cells[this.InstanceNameColumnIndex].Text;
  311.             }
  312.         }
  313. #endregion
  314. public InstanceGridView()
  315. {
  316. this.AutoGenerateColumns = false;
  317. this.ItemDataBound += new DataGridItemEventHandler(Grid_ItemDataBound);
  318.             this.PageIndexChanged += new DataGridPageChangedEventHandler(InstanceGrid_PageIndexChanged);
  319.             this.AllowPaging = true;
  320.             this.PagerStyle.Mode = PagerMode.NumericPages;
  321.             this.PageSize = 25;
  322. this.InitializeColumn(this.InstanceIDColumn, "流程ID", OThinker.H3.Instance.InstanceContext.PropertyName_InstanceId);
  323.             this.InitializeColumn(this.PriorityColumn,          "Priority", OThinker.H3.Instance.InstanceContext.PropertyName_Priority);
  324.             this.InitializeColumn(this.FormattedPriorityColumn, "优先级", null);
  325.             this.InitializeColumn(this.InstanceNameColumn,      "流程名称", OThinker.H3.Instance.InstanceContext.PropertyName_InstanceName);
  326.             this.InitializeColumn(this.TitleColumn,             "流程", null);
  327. this.InitializeColumn(this.OrgUnitColumn, "所属组织单元", OThinker.H3.Instance.InstanceContext.PropertyName_OrgUnit);
  328. this.InitializeColumn(this.WorkflowPackageColumn, "模板类型", OThinker.H3.Instance.InstanceContext.PropertyName_WorkflowPackage);
  329. this.InitializeColumn(this.WorkflowNameColumn, "模板名称", OThinker.H3.Instance.InstanceContext.PropertyName_WorkflowName);
  330. this.InitializeColumn(this.WorkflowVersionColumn, "模板版本", OThinker.H3.Instance.InstanceContext.PropertyName_WorkflowVersion);
  331. this.InitializeColumn(this.WorkflowFullNameColumn, "模板全名", null);
  332. this.InitializeColumn(this.OriginatorColumn, "发起人", OThinker.H3.Instance.InstanceContext.PropertyName_Originator);
  333. this.InitializeColumn(this.StateColumn, "State", OThinker.H3.Instance.InstanceContext.PropertyName_State);
  334. this.InitializeColumn(this.FormattedStateColumn, "状态", null);
  335. this.InitializeColumn(this.ExceptionalColumn, "异常", OThinker.H3.Instance.InstanceContext.PropertyName_Exceptional);
  336. this.InitializeColumn(this.SuspendedColumn, "挂起", OThinker.H3.Instance.InstanceContext.PropertyName_Suspended);
  337. this.InitializeColumn(this.CreatedTimeColumn, "CreatedTime", OThinker.H3.Instance.InstanceContext.PropertyName_CreatedTime);
  338. this.InitializeColumn(this.FormattedCreatedTimeColumn,"发起时间", null);
  339. this.InitializeColumn(this.StartTimeColumn, "StartTime", OThinker.H3.Instance.InstanceContext.PropertyName_StartTime);
  340. this.InitializeColumn(this.FormattedStartTimeColumn,"发起时间", null);
  341. this.InitializeColumn(this.FinishTimeColumn, "FinishTime", OThinker.H3.Instance.InstanceContext.PropertyName_FinishTime);
  342. this.InitializeColumn(this.FormattedFinishTimeColumn,"完成时间", null);
  343. this.InitializeColumn(this.StayTimeColumn, "滞留时间", null);
  344.             this.InitializeColumn(this.PlanFinishTimeColumn,    "计划完成时间", OThinker.H3.Instance.InstanceContext.PropertyName_PlanFinishTime);
  345.             this.InitializeColumn(this.EstimatedFinishTimeColumn,    "预计完成时间", OThinker.H3.Instance.InstanceContext.PropertyName_EstimatedFinishTime);
  346.             this.InitializeColumn(this.ViewColumn,              "查看",         null);
  347.             this.InitializeColumn(this.ApprovalColumn, "审批结果", OThinker.H3.Instance.InstanceContext.PropertyName_Approval);
  348.             this.InitializeColumn(this.RecurrencesColumn, "重复次数", OThinker.H3.Instance.InstanceContext.PropertyName_Recurrences);
  349.             this.Columns[this.InstanceNameColumnIndex].Visible = false;
  350. this.Columns[this.InstanceIDColumnIndex].Visible = false;
  351.             this.Columns[this.OrgUnitColumnIndex].Visible = false;
  352. this.Columns[this.WorkflowPackageColumnIndex].Visible = false;
  353. this.Columns[this.WorkflowNameColumnIndex].Visible = false;
  354. this.Columns[this.WorkflowVersionColumnIndex].Visible = false;
  355.             this.Columns[this.WorkflowFullNameColumnIndex].Visible = false;
  356. this.Columns[this.StateColumnIndex].Visible = false;
  357. this.Columns[this.CreatedTimeColumnIndex].Visible = false;
  358.             this.Columns[this.FormattedCreatedTimeColumnIndex].Visible = false;
  359. this.Columns[this.StartTimeColumnIndex].Visible = false;
  360. this.Columns[this.FinishTimeColumnIndex].Visible = false;
  361.             this.Columns[this.PlanFinishTimeColumnIndex].Visible = false;
  362.             this.Columns[this.EstimatedFinishTimeColumnIndex].Visible = false;
  363.             this.Columns[this.FormattedFinishTimeColumnIndex].Visible = false;
  364. this.Columns[this.PriorityColumnIndex].Visible = false;
  365.             this.Columns[this.RecurrencesColumnIndex].Visible = false;
  366.             this.HeaderStyle.Font.Bold = true;
  367. }
  368.         private Label lblMessage = new Label();
  369.         private System.Data.DataTable InstanceTable;
  370. #region 绑定
  371.         public void BindDataGrid(System.Data.DataTable Table)
  372. {
  373.             if (!this.DesignMode)
  374.             {
  375.                 if (Table == null || this.CurrentPageIndex * this.PageSize >= Table.Rows.Count)
  376.                 {
  377.                     this.CurrentPageIndex = 0;
  378.                 }
  379.                 this.InstanceTable = Table;
  380.                 this.DataSource = Table;
  381.                 this.DataBind();
  382.             }
  383. }
  384. protected virtual void Grid_ItemDataBound(object sender, DataGridItemEventArgs e)
  385. {
  386.             if (this.DesignMode)
  387.             {
  388.             }
  389.             else if(
  390. e.Item.ItemType != System.Web.UI.WebControls.ListItemType.Header && 
  391. e.Item.ItemType != System.Web.UI.WebControls.ListItemType.Footer)
  392. {
  393. try
  394. {
  395. // 设置流程模板全名
  396. e.Item.Cells[this.WorkflowFullNameColumnIndex].Text = this.GetWorkflowFullName(e);
  397. // 发起人全名
  398.                     string originator = e.Item.Cells[this.OriginatorColumnIndex].Text;
  399.                     HyperLink originatorLink = new HyperLink();
  400.                     originatorLink.Text = OThinker.H3.Server.Engine.Organization.GetName(originator);
  401.                     originatorLink.NavigateUrl = PortalPage.PageName_EditUser + "?" + PortalPage.Param_ID + "=" + originator + "&" + PortalPage.Param_Mode + "=" + Portal.EditUserType.View;
  402.                     e.Item.Cells[this.OriginatorColumnIndex].Controls.Add(originatorLink);
  403. // 状态
  404. OThinker.H3.Instance.InstanceState state = this.GetState(e);
  405. e.Item.Cells[this.FormattedStateColumnIndex].Text = OThinker.H3.Instance.InstanceStateConvertor.ToString(state);
  406.                     // 链接
  407.                     HyperLink linkTitle = new HyperLink();
  408.                     linkTitle.Text = this.GetTitle(e);
  409.                     linkTitle.Font.Underline = true;
  410.                     linkTitle.NavigateUrl = this.GetUrl(e);                    
  411.                     e.Item.Cells[this.TitleColumnIndex].Controls.Add(linkTitle);
  412. // 是否异常
  413. CheckBox exceptional = new CheckBox();
  414. exceptional.Enabled = false;
  415. exceptional.Checked = this.GetExceptional(e);;
  416. e.Item.Cells[this.ExceptionalColumnIndex].Controls.Add(exceptional);
  417. // 是否挂起
  418. CheckBox suspended = new CheckBox();
  419. suspended.Enabled = false;
  420. suspended.Checked = this.GetSuspended(e);
  421. e.Item.Cells[this.SuspendedColumnIndex].Controls.Add(suspended);
  422. // 创建时间
  423. System.DateTime createdTime = System.DateTime.Parse(e.Item.Cells[this.CreatedTimeColumnIndex].Text);
  424. e.Item.Cells[this.FormattedCreatedTimeColumnIndex].Text = OThinker.Data.Convertor.Format(createdTime);
  425. // 开始时间
  426. System.DateTime startTime = System.DateTime.Parse(e.Item.Cells[this.StartTimeColumnIndex].Text);
  427.                     e.Item.Cells[this.FormattedStartTimeColumnIndex].Text = startTime.ToShortDateString();
  428. // 完成时间
  429. System.DateTime finishTime = System.DateTime.Parse(e.Item.Cells[this.FinishTimeColumnIndex].Text);
  430.                     e.Item.Cells[this.FormattedFinishTimeColumnIndex].Text = OThinker.Data.Convertor.Format(finishTime);
  431. // 滞留时间
  432. System.TimeSpan stayTime = this.GetStayTime(e);
  433. e.Item.Cells[this.StayTimeColumnIndex].Text = OThinker.Data.Convertor.Format(stayTime);
  434.                     
  435. // 设置颜色
  436.                     System.DateTime planFinishTime = System.DateTime.Parse(e.Item.Cells[this.PlanFinishTimeColumnIndex].Text);
  437.                     if (state != OThinker.H3.Instance.InstanceState.Complete && System.DateTime.Now > planFinishTime)
  438.                     {
  439.                         e.Item.Cells[this.StayTimeColumnIndex].ForeColor = System.Drawing.Color.Red;
  440.                     }
  441. // 优先级
  442. int intPriority = int.Parse(e.Item.Cells[this.PriorityColumnIndex].Text);
  443. OThinker.H3.Instance.PriorityType priority = (OThinker.H3.Instance.PriorityType)intPriority;
  444.                     Image imagePriority = new Image();
  445.                     imagePriority.ImageUrl = "images/Priority_" + priority + ".GIF";
  446.                     imagePriority.ToolTip = OThinker.H3.Instance.PriorityTypeConvertor.ToString(priority);
  447.                     e.Item.Cells[this.FormattedPriorityColumnIndex].Controls.Add(imagePriority);
  448.                     // 查看
  449.                     string chartUrl = PortalPage.PageName_InstanceStateChart + "?" + PortalPage.Param_InstanceId + "=" + e.Item.Cells[this.InstanceIDColumnIndex].Text;
  450.                     string chartTitle = "流程图";
  451.                     HyperLink linkChart = new HyperLink();
  452.                     linkChart.Target = "_blank";
  453.                     linkChart.Text = chartTitle;
  454.                     linkChart.NavigateUrl = chartUrl;
  455.                     e.Item.Cells[this.ViewColumnIndex].Controls.Add(linkChart);
  456.                     // 分割符
  457.                     Label lblSplit = new Label();
  458.                     lblSplit.Text = " | ";
  459.                     e.Item.Cells[this.ViewColumnIndex].Controls.Add(lblSplit);
  460.                     // 流转日志
  461.                     string logUrl = PortalPage.PageName_InstanceToken + "?" + PortalPage.Param_InstanceId + "=" + e.Item.Cells[this.InstanceIDColumnIndex].Text;
  462.                     string logTitle = "日志";
  463.                     HyperLink linkLog = new HyperLink();
  464.                     linkLog.Target = "_blank";
  465.                     linkLog.Text = logTitle;
  466.                     linkLog.NavigateUrl = logUrl;
  467.                     e.Item.Cells[this.ViewColumnIndex].Controls.Add(linkLog);
  468.                     // Approval
  469.                     string approvalText = null;
  470.                     int approval = int.Parse(e.Item.Cells[this.ApprovalColumnIndex].Text);
  471.                     if (state == OThinker.H3.Instance.InstanceState.Complete)
  472.                     {
  473.                         switch (approval)
  474.                         {
  475.                             case (int)OThinker.Data.BoolMatchValue.True:
  476.                                 approvalText = "同意";
  477.                                 break;
  478.                             case (int)OThinker.Data.BoolMatchValue.False:
  479.                                 approvalText = "拒绝";
  480.                                 break;
  481.                             default:
  482.                                 break;
  483.                         }
  484.                     }
  485.                     e.Item.Cells[this.ApprovalColumnIndex].Text = approvalText;
  486. }
  487. catch
  488. {
  489. }
  490. }
  491. }
  492. #endregion
  493. protected override void Render(HtmlTextWriter writer)
  494. {
  495.             if (this.DesignMode)
  496.             {
  497.                 base.Render(writer);
  498.             }
  499. else if(this.InstanceTable == null || this.InstanceTable.Rows.Count == 0)
  500. {
  501. writer.Write("没有找到记录");
  502. }
  503. else
  504. {
  505. base.Render (writer);
  506. }
  507.         }
  508.         private void InstanceGrid_PageIndexChanged(object source, DataGridPageChangedEventArgs e)
  509.         {
  510.             this.CurrentPageIndex = e.NewPageIndex;
  511.             this.DataBind();
  512.         }
  513. }
  514. }