private void InitData()
 {
     string mDeviceID = Request.QueryString["id"];
     DeviceOR _objDev = new DeviceDA().SelectDeviceORByID(mDeviceID);
     PerfNetAlarmOR _obj = new PerfNetDA().SelectErrorNews(mDeviceID);
     switch (_objDev.Performance)
     {
         case "正常":
             perf = "1";
             break;
         case "故障":
             perf = "0";
             break;
         case "报警":
             perf = "2";
             break;
         case "未启动":
             perf = "3";
             break;
     }
     lblName.Text = _objDev.DeviceName;
     lblLastPollingTime.Text = _objDev.LastPollingTime.ToString();
     lblPerformance.Text = _objDev.Performance;
     if (_obj != null)
     {
         lblContent.Text = _obj.Content;
         lblHappenTime.Text = _obj.HappenTime.ToString();
     }
     else
     {
         return;
     }
 }
 private void BindGraid()
 {
     int PageCount = 0;
     DataTable dt = new PerfNetDA().SelectErrorList(pg.PageIndex, pg.PageSize, out PageCount);
     gvAlarmList.DataSource = dt;
     gvAlarmList.DataBind();
     this.pg.RecordCount = PageCount;
 }
Esempio n. 3
0
        private void InitData()
        {
            string mDeviceID= Request.QueryString["id"];
            PerfNetDetailOR _Obj = new PerfNetDA().SelectDeviceDetail(mDeviceID);
            DeviceOR _objDev = new DeviceDA().SelectDeviceORByID(mDeviceID);
            DeviceOREx _objDevEx = new DeviceDA().SelectDeviceORExByID(mDeviceID);
            switch (_objDevEx.State)
            {
                case "正常":
                    State = "1";
                    break;
                case "故障":
                    State = "0";
                    break;
            }
            lblClass.Text = _objDevEx.ClassName;
            lblType.Text = _objDevEx.TypeName;

            lblDeviceName.Text = _objDev.DeviceName;

            lblIP.Text = _objDev.IP;
            lblFirm.Text = _Obj.Firm;
            lblFlowCalculator.Text = _Obj.FlowCalculator;
            lblDependence.Text = _Obj.Dependence;
            lblPollingProtocol.Text = _Obj.PollingProtocol;
            lblMonitor.Text = _Obj.Monitor;
            lblSystemDescription.Text = _objDev.Describe;
            lblResponseTime.Text = _Obj.ResponseTime;
            lblPacketLossRate.Text = _Obj.LoseRate;

            #region 绑定 今天的使用率
            DataPoint dp = new DataPoint();
            dp.LegendText = string.Format("{0}({1}%)", "今天的使用率", _Obj.NetUtilityRate);
            double[] d = { Convert.ToDouble(_Obj.NetUtilityRate) };
            dp.Color = Color.Green;
            dp.YValues = d;
            chtPerf.Series["Series1"].Points.Add(dp);

            dp = new DataPoint();
            dp.LegendText = string.Format("{0}({1}%)", "今天的未使用率", 100 - _Obj.NetUtilityRate);
            double[] dno = { Convert.ToDouble(100 - _Obj.NetUtilityRate) };
            dp.Color = Color.Red;
            dp.YValues = dno;
            chtPerf.Series["Series1"].Points.Add(dp);
            #endregion

            //接口列表
            gvPortList.DataSource = _Obj.SubProts;
            gvPortList.DataBind();
        }
Esempio n. 4
0
        private void InitData()
        {
            string mDeviceID = Request.QueryString["id"];
            int iDeviceID = Convert.ToInt32(Request.QueryString["id"]);
            //DeviceOR _objDev = new DeviceDA().SelectDeviceORByID(mDeviceID);
            PerNetPortDetailOR _Obj = new PerfNetDA().SelectNetPortDetail(mDeviceID);
            DeviceItemOREx _objDevEx = new DeviceDA().SelectDeviceItemORExByID(mDeviceID);
            ParentDevID = _objDevEx.ParentDevID;

            lblPort.Text = _objDevEx.Port;
            lblIpAddresses.Text = _objDevEx.IP;
            lblDescription.Text = _objDevEx.Describe;
            lblName.Text = _objDevEx.DeviceName;

            lblType.Text = _objDevEx.TypeName;

            Performance = _objDevEx.Performance;
            switch (_objDevEx.HealthStatus)
            {
                case "正常":
                    health = "1";
                    break;
                case "故障":
                    health = "0";
                    break;
                case "报警":
                    health = "2";
                    break;
            }

            lblPhysicalAddress.Text = _objDevEx.StationName;//这个有错

            lblCircuitID.Text = _Obj.CircuitID;
            lblSuperiorName.Text = _Obj.SuperiorName;
            lblIndex.Text = _Obj.Index;

            lblManagementState.Text = _Obj.ManagementState;
            lblOperatingStatus.Text = _Obj.OperatingStatus;

            lblReceiveBroadband.Text = _Obj.ReceiveBroadband;
            lblSendBroadband.Text = _Obj.SendBroadband;
            lblCurrentlyReceivingTraffic.Text = _Obj.CurrentlyReceivingTraffic;
            lblCurrentSendTraffic.Text = _Obj.CurrentSendTraffic;
            lblReceiveUtilization.Text = _Obj.UtilizationReceive;
            lblSendUtilization.Text = _Obj.UtilizationSend;
            lblReceivePacketsNumber.Text = _Obj.ReceiveNoS;
            lblSendPacketsNumber.Text = _Obj.SendNos;
            lblReceiveAverageSize.Text = _Obj.AverageSizeReceive;
            lblSendAverageSize.Text = _Obj.AverageSizeSend;

            #region 绑定 可用性
            if (_objDevEx != null)
            {
                DataPoint dp = new DataPoint();
                dp.LegendText = string.Format("{0}({1}%)", "可用", _objDevEx.AvailableRate);
                double[] d = { Convert.ToDouble(_objDevEx.AvailableRate) };
                dp.Color = Color.Green;
                dp.YValues = d;
                chtPerf.Series["Series1"].Points.Add(dp);

                dp = new DataPoint();
                dp.LegendText = string.Format("{0}({1}%)", "不可用", 100 - _objDevEx.AvailableRate);
                double[] dno = { Convert.ToDouble(100 - _objDevEx.AvailableRate) };
                dp.Color = Color.Red;
                dp.YValues = dno;
                chtPerf.Series["Series1"].Points.Add(dp);
            }
            #endregion

            //绑定,曲线
            HistoryValueDA mDA=new HistoryValueDA();
            #region 今天接收、发送
            DateTime StartTime= Convert.ToDateTime( string.Format("{0} 00:00:00",DateTime.Now.ToString("yyyy-MM-dd")));
            DateTime EndTime= Convert.ToDateTime(string.Format("{0} 23:59:59",DateTime.Now.ToString("yyyy-MM-dd")));

            // 流量-今天
            DataTable dt = mDA.GetDeviceChanncelValue(this.deviceID, ParentDevID, 33001, StartTime, EndTime);//接收
            if (dt != null)
            {
                chLine.Series["Series1"].Points.DataBindXY(dt.Rows, "Time", dt.Rows, "MonitorValue");//接收
            }

            dt = mDA.GetDeviceChanncelValue(this.deviceID, ParentDevID, 33002, StartTime, EndTime);//发送
            if (dt != null)
            {
                chLine.Series["Series2"].Points.DataBindXY(dt.Rows, "Time", dt.Rows, "MonitorValue");
            }

            // 错误数和丢包数-今天
            DataTable dte = mDA.GetDeviceChanncelValue(this.deviceID, ParentDevID, 37001, StartTime, EndTime);//流入错误数
            if (dte != null)
            {
                chtErrorSum.Series["Series1"].Points.DataBindXY(dte.Rows, "Time", dte.Rows, "MonitorValue");
            }

            dte = mDA.GetDeviceChanncelValue(this.deviceID, ParentDevID, 37002, StartTime, EndTime);//流出错误数
            if (dte != null)
            {
                chtErrorSum.Series["Series2"].Points.DataBindXY(dte.Rows, "Time", dte.Rows, "MonitorValue");
            }
            dte = mDA.GetDeviceChanncelValue(this.deviceID, ParentDevID, 37003, StartTime, EndTime);//流入丢包数
            if (dte != null)
            {
                chtErrorSum.Series["Series3"].Points.DataBindXY(dte.Rows, "Time", dte.Rows, "MonitorValue");
            }

            dte = mDA.GetDeviceChanncelValue(this.deviceID, ParentDevID, 37004, StartTime, EndTime);//流出丢包数
            if (dte != null)
            {
                chtErrorSum.Series["Series4"].Points.DataBindXY(dte.Rows, "Time", dte.Rows, "MonitorValue");
            }

            // 发送字数总量-今天
            DataTable dts = mDA.GetDeviceChanncelValue(this.deviceID, ParentDevID, 38001, StartTime, EndTime);//InBytes
            if (dts != null)
            {
                chtSendSum.Series["Series1"].Points.DataBindXY(dts.Rows, "Time", dts.Rows, "MonitorValue");
            }

            dts = mDA.GetDeviceChanncelValue(this.deviceID, ParentDevID, 38002, StartTime, EndTime);//OutBytes
            if (dts != null)
            {
                chtSendSum.Series["Series2"].Points.DataBindXY(dts.Rows, "Time", dts.Rows, "MonitorValue");
            }

            #endregion
        }