wzp
2023-03-02 adee7a71ba7ab1b63cab63381dfe1846437853d6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
 
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<SysUser>, IRequiresSessionState
{
    protected List<GwClient> 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("<tr><td> 表空间</td><td>总大小</td><td>已使用</td><td>已使用百分比</td></tr>");
            foreach (DataRow row in (InternalDataCollectionBase)tableSpaceStatis.Rows)
            {
                DataRowReader dataRowReader = new DataRowReader(row);
                string str1 = dataRowReader.GetString("tablespace_name");
                if (str1 == "SMGWDAT" || str1 == "SMGWLOG")
                    str1 = "<span class=\"label label-primary\">" + str1 + "</span>";
                Decimal @decimal = dataRowReader.GetDecimal("used_pct");
                string str2 = string.Format("<span class=\"label {0}\">{1}%</span>", @decimal >= new Decimal(90) ? (object)"label-warning" : (object)"label-primary", (object)@decimal);
                stringBuilder.AppendFormat("<tr><td>{0}</td><td>{1}MB</td><td>{2}MB</td><td>{3}</td></tr>", (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;
    }
}