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 GatewayNodeOnOff : MyBasePage
{
GatewayNodeOnOffBLL _GatewayNodeOnOffBLL=new GatewayNodeOnOffBLL();
public override void VerifyRenderingInServerForm(Control control)
{ }
protected void Page_Load(object sender, EventArgs e)
{
if (Request["Action"] != null)
{
string returnMsg = string.Empty;
StringBuilder returngvwMsg = new StringBuilder();
switch (Request["Action"])
{
case "Query":
returnMsg = QueryInfo(
Request["selectDate"].ToString(),
Request["userName"].ToString());
Response.Write(returnMsg);
break;
case "HisQuery":
returnMsg = HisQueryInfo(
Request["GatewayName"].ToString(),
Request["DOLSNodeOrEquip"].ToString(),
Request["DOLSDay"].ToString());
Response.Write(returnMsg);
break;
}
Response.ContentType = "text/xml";
Response.Expires = 0;
Response.Flush();
Response.End();
}
if (!IsPostBack)
{
txtBegDate.Text = DateTime.Now.ToString("yyyy-MM-dd");
DataTable dtGateway = _GatewayNodeOnOffBLL.GetGatewayNodeOnOff();
ddlMaintenance.DataTextField = "User_Name";
ddlMaintenance.DataValueField = "User_No";
ddlMaintenance.DataSource = dtGateway;
ddlMaintenance.DataBind();
//将下拉列表框第一列设置为“请选择”
ddlMaintenance.Items.Insert(0, new ListItem("请选择", ""));
}
}
//查询运维信息
protected string QueryInfo(string selectDate, string userNo)
{
GatewayNodeOnOffBLL GetCateway = new GatewayNodeOnOffBLL();
DataTable ds = GetCateway.BllGetGatewayNodeOnOff(selectDate, userNo);
if (ds.Rows.Count > 0)
{
this.GatewayInfoGDV.DataSource = null;
this.GatewayInfoGDV.DataSource = ds;
this.GatewayInfoGDV.DataBind();
return PagingMethod.RenderGridView(this.GatewayInfoGDV);
}
else
return "Empty";
}
//查询历史运维信息
protected string HisQueryInfo(string GatewayName, string DOLSNodeOrEquip, string DOLSDay)
{
DataTable dtNodeInfor = _GatewayNodeOnOffBLL.HisBllGetGatewayNodeOnOff(GatewayName, DOLSNodeOrEquip, DOLSDay);
string strResult = CommonHelper.ToJson(dtNodeInfor);
return strResult;
}
}
}