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

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. namespace OThinker.H3.Portal
  12. {
  13. /// <summary>
  14. /// 用于查看异常的详细信息
  15. /// </summary>
  16. public partial class ExceptionDetail : PortalPage
  17.     {
  18.         #region 参数
  19.         private string ExceptionID
  20. {
  21. get
  22. {
  23. return this.Request.QueryString[Param_ExceptionID];
  24. }
  25.         }
  26.         #endregion
  27.         protected void Page_Load(object sender, System.EventArgs e)
  28. {
  29. if(!this.IsPostBack)
  30. {
  31.                 // 验证是否具有管理员权限
  32.                 if (!this.UserValidator.ValidateAdministrator())
  33.                 {
  34.                     this.NotifyMessage(LackOfAuth);
  35.                 }
  36. }
  37. // SEMI ERROR,这段没有优化
  38. OThinker.H3.Exceptions.ExceptionLog log = OThinker.H3.Server.Engine.ExceptionManager.GetException(this.ExceptionID);
  39. if(log != null)
  40. {
  41. this.lblAction.Text = log.Action.ToString();
  42. this.lblBlocked.Text = log.Block.ToString();
  43. this.lblInstanceID.Text = log.InstanceId.ToString();
  44. this.lblExceptionID.Text = log.ExceptionID.ToString();
  45. this.lblExceptionMessage.Text = log.Message.Replace("rn", "<BR>");
  46. if(log.State == OThinker.H3.Exceptions.ExceptionState.Fixed)
  47. {
  48. this.lblFixed.Text = "已修复";;
  49. this.lblFixedTime.Text = log.FixedTime.ToString();
  50. this.btnFix.Enabled = false;
  51. this.lnkFix.Enabled = false;
  52. }
  53. else
  54. {
  55. this.lblFixed.Text = "未修复";;
  56. this.lblFixedTime.Text = null;
  57. this.btnFix.Enabled = true;
  58. this.lnkFix.Enabled = true;
  59. }
  60. this.lblWorkflowPackage.Text = log.WorkflowPackage;
  61. this.lblWorkflowName.Text = log.WorkflowName;
  62. this.lblWorkflowVersion.Text = log.WorkflowVersion.ToString();
  63. this.lblSourceName.Text = log.SourceName;
  64. this.lblSourceType.Text = log.SourceType.ToString();
  65. this.lblThrownTime.Text = log.ThrownTime.ToString();
  66. }
  67. }
  68. #region Web Form Designer generated code
  69. override protected void OnInit(EventArgs e)
  70. {
  71. //
  72. // CODEGEN: This call is required by the ASP.NET Web Form Designer.
  73. //
  74. InitializeComponent();
  75. base.OnInit(e);
  76. }
  77. /// <summary>
  78. /// Required method for Designer support - do not modify
  79. /// the contents of this method with the code editor.
  80. /// </summary>
  81. private void InitializeComponent()
  82. {    
  83. this.btnFix.Click += new System.Web.UI.ImageClickEventHandler(this.btnFix_Click);
  84. }
  85. #endregion
  86. protected void btnFix_Click(object sender, System.EventArgs e)
  87. {
  88. this.Fix();
  89. }
  90. protected void btnFix_Click(object sender, System.Web.UI.ImageClickEventArgs e)
  91. {
  92. this.Fix();
  93. }
  94. private void Fix()
  95. {
  96. this.lnkFix.Enabled = false;
  97. this.btnFix.Enabled = false;
  98.             if (this.lblExceptionID.Text != null)
  99. {
  100.                 OThinker.H3.Server.Engine.ExceptionManager.FixException(this.lblExceptionID.Text);
  101. }
  102. }
  103. }
  104. }