using Common; using Dao; using Model; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Web; using System.Web.Profile; using System.Web.SessionState; public partial class _GwAp : PageBase, IRequiresSessionState { protected void Page_Load(object sender, EventArgs e) { this.CheckRight("201", FailedOperation.ErrorMsgOnly); if (this.IsPostBack) return; this.ViewState["list"] = (object)this.getList(); } public string getList() { using (GwApDao gwApDao = new GwApDao()) { List list = gwApDao.LoadInfoList(); string str = ""; if (list != null && list.Count > 0) { foreach (GwAp i in list) { str += ""; str = str + "" + i.ApID + "" + i.ApName + "" + i.ApPort + ""; str = str + "" + i.AccessCode + ""; str = str + "
" + this.GetAlarmExpressionText(i) + "
"; str += ""; str += string.Format(" 编辑 ", (object)i.ApID); str += ""; str += ""; } } else str += "暂无信息"; return str; } } private string GetAlarmExpressionText(GwAp i) { string str = "未启用告警"; if (string.IsNullOrEmpty(i.AlarmData)) return str; JToken jtoken = JsonConvert.DeserializeObject(i.AlarmData); if (jtoken != null && (jtoken.Value((object)"apInThreshold") > 0 || jtoken.Value((object)"apPendingThreshold") > 0)) str = string.Empty; if (jtoken.Value((object)"apInThreshold") > 0) str = str + "当入口流量小于 " + jtoken.Value((object)"apInThreshold") + "条/5分钟 时告警;"; if (jtoken.Value((object)"apPendingThreshold") > 0) str = str + "当入口流量阻塞大于" + jtoken.Value((object)"apPendingThreshold") + "条 时告警"; return str; } }