QueryException.aspx.cs
资源名称:H3_OA.rar [点击查看]
上传用户:li2971742
上传日期:2021-11-18
资源大小:39096k
文件大小:5k
源码类别:
OA系统
开发平台:
C#
- using System;
- using System.Collections;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Web;
- using System.Web.SessionState;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.HtmlControls;
- namespace OThinker.H3.Portal
- {
- /// <summary>
- /// Summary description for QueryException.
- /// </summary>
- public partial class QueryException : PortalPage
- {
- protected System.Web.UI.WebControls.Panel DetailContainer;
- #region 参数
- private System.DateTime From
- {
- get
- {
- string strFrom = this.Request.QueryString[Param_From];
- if (strFrom != null && strFrom != "")
- {
- return System.DateTime.Parse(strFrom);
- }
- else
- {
- return System.DateTime.Now.Subtract(new System.TimeSpan(3, 0, 0, 0, 0));
- }
- }
- }
- private System.DateTime To
- {
- get
- {
- string strTo = this.Request.QueryString[Param_To];
- if (strTo != null && strTo != "")
- {
- return System.DateTime.Parse(strTo);
- }
- else
- {
- return System.DateTime.Now;
- }
- }
- }
- #endregion
- protected void Page_Load(object sender, System.EventArgs e)
- {
- if(!this.IsPostBack)
- {
- // 验证是否具有管理员权限
- if (!this.UserValidator.ValidateAdministrator())
- {
- this.NotifyMessage(LackOfAuth);
- }
- System.Data.DataTable table = OThinker.H3.Server.Engine.ExceptionManager.QueryTable(
- H3.Instance.InstanceContext.UnspecifiedID, this.From, this.To, H3.Exceptions.ExceptionState.Unspecified);
- this.ExceptionGrid.DataSource = table;
- this.ExceptionGrid.DataBind();
- }
- }
- #region Web Form Designer generated code
- override protected void OnInit(EventArgs e)
- {
- //
- // CODEGEN: This call is required by the ASP.NET Web Form Designer.
- //
- InitializeComponent();
- base.OnInit(e);
- }
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.ExceptionGrid.ItemDataBound += new System.Web.UI.WebControls.DataGridItemEventHandler(this.ExceptionGrid_ItemDataBound);
- }
- #endregion
- private void ExceptionGrid_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
- {
- if(
- e.Item.ItemType != ListItemType.Header &&
- e.Item.ItemType != ListItemType.Footer)
- {
- #region 流程实例摘要
- #region 标题行
- HyperLink linkTitle = new HyperLink();
- // 获得全名
- linkTitle.Text = e.Item.Cells[0].Text + "[" + e.Item.Cells[1].Text + "\" + e.Item.Cells[2].Text + "\" + e.Item.Cells[3].Text + "." + e.Item.Cells[4].Text + "]";
- linkTitle.Target = "ExceptionMain";
- linkTitle.NavigateUrl = PageName_ExceptionDetail + "?" + Param_ExceptionID + "=" + e.Item.Cells[0].Text;
- TableRow rowTitle = this.RowControl(new Control[]{linkTitle});
- #endregion
- #region 详细
- TableRow rowMisc;
- #region 阻塞和修复
- // 阻塞
- Label labelBlocked = new Label();
- labelBlocked.Text = e.Item.Cells[5].Text == "1" ? "阻塞" : "未阻塞";
- // 修复
- Label labelFixed = new Label();
- OThinker.H3.Exceptions.ExceptionState state = (OThinker.H3.Exceptions.ExceptionState)int.Parse(e.Item.Cells[6].Text);
- labelFixed.Text = state == OThinker.H3.Exceptions.ExceptionState.Fixed ? "已修复" : "未修复";
- rowMisc = this.RowControl(new Control[]{labelBlocked, labelFixed});
- #endregion
- Table tableDetail = this.TableRows(new TableRow[]{rowMisc});
- TableRow rowDetail = this.RowControl(new Control[]{tableDetail});
- #endregion
- Table tableAbstract = this.TableRows(new TableRow[]{rowTitle, rowDetail});
- e.Item.Cells[7].Controls.Add(tableAbstract);
- #endregion
- }
- }
- private TableCell CellControl(Control[] Controls)
- {
- TableCell cell = new TableCell();
- cell.Attributes.Add("background", "images/BG_Item.gif");
- foreach(Control control in Controls)
- {
- cell.Controls.Add(control);
- }
- return cell;
- }
- private TableCell CellControl(Control Control)
- {
- TableCell cell = new TableCell();
- cell.Attributes.Add("background", "images/BG_Item.gif");
- cell.Controls.Add(Control);
- return cell;
- }
- private TableRow RowControl(Control[] Controls)
- {
- TableRow row = new TableRow();
- foreach(Control control in Controls)
- {
- TableCell cell = this.CellControl(control);
- row.Cells.Add(cell);
- }
- return row;
- }
- private Table TableRows(TableRow[] Rows)
- {
- Table table = new Table();
- table.Attributes.Add("background", "images/BG_Item.gif");
- table.CssClass = "ms-vb2";
- table.Attributes.Add("width", "100%");
- foreach(TableRow row in Rows)
- {
- table.Rows.Add(row);
- }
- return table;
- }
- }
- }