HeapData.aspx.cs
资源名称:H3_OA.rar [点击查看]
上传用户:li2971742
上传日期:2021-11-18
资源大小:39096k
文件大小:3k
源码类别:
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 QueryHeapData.
- /// </summary>
- public partial class HeapData : PortalPage
- {
- protected void Page_Load(object sender, System.EventArgs e)
- {
- string instanceId = this.Request.QueryString[Param_InstanceId];
- TableRow titleRow = new TableRow();
- this.DataTable.Rows.Add(titleRow);
- this.AddCell(titleRow, "Name");
- this.AddCell(titleRow, "Value");
- if (instanceId != null && instanceId != "" && instanceId != Instance.InstanceContext.NullObjectID)
- {
- System.Collections.Specialized.ListDictionary dict = OThinker.H3.Server.Engine.HeapDataManager.GetAllItems(instanceId);
- foreach(string name in dict.Keys)
- {
- this.AddRow(name, dict[name]);
- }
- }
- }
- private void AddRow(string Name, object Value)
- {
- TableRow row = new TableRow();
- row.Attributes.Add("valign", "top");
- this.DataTable.Rows.Add(row);
- this.AddCell(row, Name);
- if(Value == null)
- {
- this.AddCell(row, "null");
- }
- else if(Value.GetType().BaseType == typeof(System.Array))
- {
- Table valueTable = new Table();
- TableCell valueCell = new TableCell();
- valueCell.Controls.Add(valueTable);
- row.Cells.Add(valueCell);
- for(int count=0; count<((System.Array)Value).Length; count++)
- {
- TableRow valueRow = new TableRow();
- valueTable.Rows.Add(valueRow);
- this.AddCell(valueRow, count.ToString());
- this.AddCell(valueRow, ((System.Array)Value).GetValue(count).ToString());
- }
- }
- else
- {
- this.AddCell(row, Value.ToString());
- }
- }
- private void AddCell(TableRow Row, string Content)
- {
- TableCell cell = new TableCell();
- Row.Cells.Add(cell);
- Label label = new Label();
- cell.Controls.Add(label);
- label.Text = Content;
- }
- #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()
- {
- }
- #endregion
- }
- }