using Common; using Dao; using Model; using System; using System.Collections.Generic; using System.Data; using System.Text; using System.Web; using System.Web.Profile; using System.Web.SessionState; public partial class Welcome : PageBase, IRequiresSessionState { protected List GwClientList; protected void Page_Load(object sender, EventArgs e) { using (GwClientDao gwClientDao = new GwClientDao()) this.GwClientList = gwClientDao.Clientlist(); } public string RenderTableSpaceTable() { using (GwUtilityDao gwUtilityDao = new GwUtilityDao()) { StringBuilder stringBuilder = new StringBuilder(); DataTable tableSpaceStatis = gwUtilityDao.GetTableSpaceStatis(); stringBuilder.AppendFormat(" 表空间总大小已使用已使用百分比"); foreach (DataRow row in (InternalDataCollectionBase)tableSpaceStatis.Rows) { DataRowReader dataRowReader = new DataRowReader(row); string str1 = dataRowReader.GetString("tablespace_name"); if (str1 == "SMGWDAT" || str1 == "SMGWLOG") str1 = "" + str1 + ""; Decimal @decimal = dataRowReader.GetDecimal("used_pct"); string str2 = string.Format("{1}%", @decimal >= new Decimal(90) ? (object)"label-warning" : (object)"label-primary", (object)@decimal); stringBuilder.AppendFormat("{0}{1}MB{2}MB{3}", (object)str1, (object)dataRowReader.GetInt("total_mb"), (object)dataRowReader.GetString("used_mb"), (object)str2); } return stringBuilder.ToString(); } } //客户ID转换名称 public string ClientIdToName(string clientId) { if (this.GwClientList.Count == 0) return clientId; foreach (GwClient bean in this.GwClientList) { if (clientId.Equals(bean.ClientID)) return bean.Company; else continue; } return clientId; } }