WEB
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HisGatewayNodeOnOff.aspx.cs" Inherits="THMS.page.SuperOption.HisGatewayNodeOnOff"
EnableEventValidation="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>运维离线统计--历史离线率</title>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link href="../../CommonNew/css/main.css" rel="stylesheet" type="text/css"></link>
<link href="../../CommonNew/css/animate.min.css" rel="stylesheet" type="text/css"></link>
<script src="../../Common/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<script src="../../CommonNew/js/jquery-ui.min.js" type="text/javascript"></script>
<script src="../../Common/jquery-easyui-1.3.1/jquery-1.8.0.min.js" type="text/javascript"></script>
<link href="../../Common/jquery-easyui-1.5/themes/default/easyui.css" rel="stylesheet" type="text/css" />
<link href="../../Common/jquery-easyui-1.5/themes/icon.css" rel="stylesheet" type="text/css" />
<script src="../../Common/jquery-easyui-1.5/jquery.easyui.min.js" type="text/javascript"></script>
<script src="../../Common/js/topTip.js" type="text/javascript"></script>
<script src="../../Common/jquery-easyui-1.3.1/highcharts.js" type="text/javascript"></script>
<script src="../../Common/jquery-easyui-1.3.1/exporting.js" type="text/javascript"></script>
<link href="../../Common/Style/topTip.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.ItemStyleNoDisplay
{
display: none;
}
</style>
<script type="text/javascript">
$(function () {
topTip.create();
query();
});
function query() {
debugger;
$.ajax(
{
type: 'POST',
url: 'HisGatewayNodeOnOff.aspx',
dataType: 'text',
data: { Action: 'sHisQuery'},
cache: false,
success: OperateCallBack,
error: function (XMLHttpRequest, textStatus, errorThrown) {
topTip.setData({
tipText: "网络错误,请重试!",
tipType: "warn"
}).autoShowTopTip();
}
});
}
function OperateCallBack(strs) {
if (strs != "Empty") {
topTip.hideTopTip();
$("#ShowOperateInfo").html(strs);
}
else {
topTip.setData({
tipText: "没有匹配的数据!",
tipType: "error"
}).autoShowTopTip();
$("#ShowOperateInfo").html("没有匹配的数据");
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<div class="nbg_title2">
<span>历史离线率</span></div>
<div class="shop_content">
<div class="zkcurve_list">
<div id="ShowRoleInfo">
<div id="divShowRoleInfo" style="width: 200px; margin-left: 10px; display: none;">
<img src="../../Common/Image/loading.gif" /><span style="margin-left: 10px;">正在加载数据......</span>
</div>
</div>
<div id="ShowOperateInfo" style="margin-top: 3px;">
<div id="divShowOperateInfo" style="width: 200px; margin-left: 10px; display: none;">
<img src="../../Common/Image/loading.gif" /><span style="margin-left: 10px;">正在加载数据......</span>
</div>
</div>
</div>
</div>
<%--style="display:none"--%>
<div>
<asp:GridView runat="server" ID="HisGatewayInfoGDV" AllowPaging="False" GridLines="None"
CurrentSortField="" CurrentSortOrder="" PageSize="100" SeqNo="0" Width="100%"
SeqText="序号" ShowSeqNo="true" AutoGenerateColumns="False">
<HeaderStyle Wrap="False" BorderColor="#D7E0EA" Height="40px" ForeColor="#36AEEA">
</HeaderStyle>
<AlternatingRowStyle CssClass="Grid_AlternatingItem"></AlternatingRowStyle>
<RowStyle Font-Size="14px" />
<Columns>
<asp:TemplateField HeaderText="序号" InsertVisible="False" HeaderStyle-Wrap="false">
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
<ItemTemplate>
<%-- gridview增加自动序号列 即使分页也会继续累积而不会重新排序 --%>
<asp:Label CssClass="InCenter" ID="lblNum" runat="server" Text='<%# this. HisGatewayInfoGDV.PageIndex*this.HisGatewayInfoGDV.PageSize + this.HisGatewayInfoGDV.Rows.Count +1%>'>
</asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="自身ID" InsertVisible="False" HeaderStyle-Wrap="false">
<HeaderStyle CssClass="ItemStyleNoDisplay" />
<ItemStyle HorizontalAlign="Center" CssClass="ItemStyleNoDisplay" />
<ItemTemplate>
<asp:Label ID="lbDayID" runat="server" Text='<%# Bind("DayOnLineStatistics_ID")%>'>
</asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="运维人员" InsertVisible="False" HeaderStyle-Wrap="false">
<ItemStyle HorizontalAlign="Center" Wrap="false"/>
<ItemTemplate>
<asp:Label ID="lbUserName" runat="server" Text='<%# Bind("User_Name")%>'>
</asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="统计单位" InsertVisible="False" HeaderStyle-Wrap="false">
<ItemStyle HorizontalAlign="Center" Wrap="false" />
<ItemTemplate>
<asp:Label ID="lbDOLSNodeOrEquip" runat="server" Text='<%# Bind("DOLS_NodeOrEquip")%>'>
</asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="日期" InsertVisible="False" HeaderStyle-Wrap="false">
<ItemStyle HorizontalAlign="Center" Wrap="false" />
<ItemTemplate>
<asp:Label ID="lbDOLSDay" runat="server" Text='<%# Bind("DOLS_Day")%>'>
</asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="总计" InsertVisible="False" HeaderStyle-Wrap="false">
<ItemStyle HorizontalAlign="Center" Wrap="false" />
<ItemTemplate>
<asp:Label ID="lbDOLSTotalCount" runat="server" Text='<%# Bind("DOLS_TotalCount")%>'>
</asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="在线" InsertVisible="False" HeaderStyle-Wrap="false">
<ItemStyle HorizontalAlign="Center" Wrap="false" />
<ItemTemplate>
<asp:Label ID="lbDOLSOnLineCount" runat="server" Text='<%# Bind("DOLS_OnLineCount")%>'>
</asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="离线" InsertVisible="False" HeaderStyle-Wrap="false">
<ItemStyle HorizontalAlign="Center" Wrap="false" />
<ItemTemplate>
<asp:Label ID="lbDOLSOffLineCount" runat="server" Text='<%# Bind("DOLS_OffLineCount")%>'>
</asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="离线率" InsertVisible="False" HeaderStyle-Wrap="false">
<ItemStyle HorizontalAlign="Center" Wrap="false" />
<ItemTemplate>
<asp:Label ID="lbOfflineRate" runat="server" Text='<%# Bind("OfflineRate")%>'>
</asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="昨日离线增加" InsertVisible="False" HeaderStyle-Wrap="false">
<ItemStyle HorizontalAlign="Center" Wrap="false" />
<ItemTemplate>
<asp:Label ID="lbOffLineCountADD" runat="server" Text='<%# Bind("OffLineCountADD")%>'>
</asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</form>
</body>
</html>
CS
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Text;
using BLL;
using System.IO;
using BasicItem;
using BLL.SuperOptions;
namespace THMS.page.SuperOption
{
public partial class HisGatewayNodeOnOff : MyBasePage
{
GatewayNodeOnOffBLL _GatewayNodeOnOffBLL = new GatewayNodeOnOffBLL();
public override void VerifyRenderingInServerForm(Control control)
{ }
string GatewayName="";
string DOLSNodeOrEquip="";
string DOLSDay="";
//string str;
protected void Page_Load(object sender, EventArgs e)
{
//GatewayName
if (Request.QueryString["GatewayName"] != null)
{
GatewayName = Request.QueryString["GatewayName"].ToString();
Session["HisGatewayNodeOnOff.GatewayName"] = GatewayName;
}
else
{
if (Session["HisGatewayNodeOnOff.GatewayName"] != null)
GatewayName = Session["HisGatewayNodeOnOff.GatewayName"].ToString();
}
//DOLSNodeOrEquip
if (Request.QueryString["DOLSNodeOrEquip"] != null)
{
DOLSNodeOrEquip = Request.QueryString["DOLSNodeOrEquip"].ToString();
Session["HisGatewayNodeOnOff.DOLSNodeOrEquip"] = DOLSNodeOrEquip;
}
else
{
if (Session["HisGatewayNodeOnOff.DOLSNodeOrEquip"] != null)
DOLSNodeOrEquip = Session["HisGatewayNodeOnOff.DOLSNodeOrEquip"].ToString();
}
//DOLSDay
if (Request.QueryString["DOLSDay"] != null)
{
DOLSDay = Request.QueryString["DOLSDay"].ToString();
Session["HisGatewayNodeOnOff.DOLSDay"] = DOLSDay;
}
else
{
if (Session["HisGatewayNodeOnOff.DOLSDay"] != null)
DOLSDay = Session["HisGatewayNodeOnOff.DOLSDay"].ToString();
}
if (Request["Action"] != null)
{
string returnMsg = string.Empty;
StringBuilder returngvwMsg = new StringBuilder();
//string GatewayName = Request.QueryString["GatewayName"];
//string DOLSNodeOrEquip = Request.QueryString["DOLSNodeOrEquip"];
//string DOLSDay = Request.QueryString["DOLSDay"];
switch (Request["Action"])
{
case "sHisQuery":
returnMsg = HisQueryInfo(
GatewayName, DOLSNodeOrEquip, DOLSDay);
Response.Write(returnMsg);
break;
}
Response.ContentType = "text/xml";
Response.Expires = 0;
Response.Flush();
Response.End();
}
}
//查询历史运维信息
protected string HisQueryInfo(string GatewayName, string DOLSNodeOrEquip, string DOLSDay)
{
GatewayNodeOnOffBLL GetCateway = new GatewayNodeOnOffBLL();
DataTable ds = GetCateway.sHisBllGetGatewayNodeOnOff(GatewayName, DOLSNodeOrEquip, DOLSDay);
if (ds.Rows.Count > 0)
{
this.HisGatewayInfoGDV.DataSource = null;
this.HisGatewayInfoGDV.DataSource = ds;
this.HisGatewayInfoGDV.DataBind();
return PagingMethod.RenderGridView(this.HisGatewayInfoGDV);
}
else
return "Empty";
}
}
}
网友评论