137 lines
5.1 KiB
C#
137 lines
5.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
using SuperMap.RealEstate.CoreFrameWork;
|
|
using SuperMap.RealEstate.ServiceModel;
|
|
using SuperMap.RealEstate.Utility;
|
|
using SuperMap.RealEstate.Web.UI;
|
|
using SuperMap.RealEstate.Web.UI.WebControls;
|
|
using SuperMap.RealEstate.Web.Utility;
|
|
using Business = SuperMap.RealEstate.ExchangeData.Business;
|
|
using StorageBusiness = SuperMap.RealEstate.HighWay.Storage.Business;
|
|
|
|
namespace SuperMap.RealEstate.HighWay.Modules.CheckUpDate
|
|
{
|
|
public partial class Default : BasePage
|
|
{
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (IsPostBack) return;
|
|
//初始化并加载列表
|
|
|
|
//服务区下拉框
|
|
SERVERPART_ID.Clear();
|
|
SERVERPART_ID.Items.Add(new ListItemEx("所有服务区", "1=1"));
|
|
foreach (StorageBusiness.SERVERPART _SERVERPART in (new StorageBusiness.SERVERPART(this.Transaction)).
|
|
GetPassportServerPart(this.PassportInfo.CityAuthority, "1000"))
|
|
{
|
|
ListItemEx _ListItem = new ListItemEx();
|
|
_ListItem.Text = _SERVERPART.SERVERPART_NAME;
|
|
_ListItem.Value = _SERVERPART.SERVERPART_CODE.ToEncrypt();
|
|
//_ListItem.Selected = true;
|
|
SERVERPART_ID.Items.Add(_ListItem);
|
|
}
|
|
SERVERPART_ID.SelectedValue = "1=1";
|
|
|
|
//设置回车焦点按钮
|
|
SetControlClientAction(ButtonSearch);
|
|
GridViewEx1.SelectingWithInit<Business.CONFIGURATION>(ObjectDataSource1, GridPageEx1);
|
|
|
|
ListButton.OnClientClick = GridViewEx1.GetOpenPopDialogClientScript("WinSystemLogList.aspx", 1100, 600);
|
|
}
|
|
|
|
#region 列表行事件
|
|
//查询
|
|
protected void ButtonSearch_CallBackClick(object sender, ClientSetEventArgs e)
|
|
{
|
|
GridViewEx1.Selecting<Business.CONFIGURATION>(ObjectDataSource1, GridPageEx1);
|
|
//设置UI变化
|
|
e.SetValue(GridViewEx1);
|
|
e.SetValue(GridPageEx1);
|
|
}
|
|
|
|
protected void GridPageEx1_CallBackPageChanged(object sender, Web.UI.WebControls.ClientSetEventArgs e)
|
|
{
|
|
GridViewEx1.Pagging<Business.CONFIGURATION>(ObjectDataSource1, GridPageEx1);
|
|
//设置UI变化
|
|
e.SetValue(GridViewEx1);
|
|
}
|
|
|
|
protected void GridViewEx1_SelectMethodParameters(object sender, SelectMethodParametersArgs e)
|
|
{
|
|
|
|
//搜索选项的搜索条件过滤
|
|
//if (!string.IsNullOrEmpty(TextBox_Search.Text))
|
|
// e.AddOrParams(GridViewSearch1, TextBox_Search.Text);
|
|
//且搜索条件
|
|
//e.AddAndParams(字段名, 值);
|
|
//或搜索条件
|
|
//e.AddOrParams(字段名, 值);
|
|
|
|
string WhereSQL = string.Empty;
|
|
|
|
//服务区
|
|
if (SERVERPART_ID.SelectedIndex > 1)
|
|
{
|
|
WhereSQL += " AND SERVERPARTCODE = '" + SERVERPART_ID.SelectedValue.ToDecrypt() + "'";
|
|
}
|
|
|
|
if (!string.IsNullOrEmpty(COMPACT_STARTDATE.Text))
|
|
{
|
|
WhereSQL += " AND LOG_TIMEGENERATED >= TO_DATE('" + COMPACT_STARTDATE.Text + "','YYYY/MM/DD')";
|
|
}
|
|
|
|
if (!string.IsNullOrEmpty(COMPACT_ENDDATE.Text))
|
|
{
|
|
WhereSQL += " AND LOG_TIMEGENERATED <= TO_DATE('" + COMPACT_ENDDATE.Text + "','YYYY/MM/DD') + 1";
|
|
}
|
|
|
|
if (!string.IsNullOrEmpty(WhereSQL))
|
|
{
|
|
e.SetOtherUserCustomWhereSqlString = WhereSQL.Substring(4);
|
|
}
|
|
|
|
//排序
|
|
e.AddOrderByParams(GridViewOrderBy1);
|
|
}
|
|
|
|
protected void GridViewEx1_RowDataBound(object sender, GridViewRowEventArgs e)
|
|
{
|
|
if (e.Row.RowType == DataControlRowType.DataRow)
|
|
{
|
|
try
|
|
{
|
|
if (DateTime.Parse(e.Row.Cells[3].Text).AddMinutes(5) < DateTime.Now)
|
|
{
|
|
e.Row.Cells[4].Text = "未连接";
|
|
e.Row.Cells[4].ForeColor = Color.Red;
|
|
}
|
|
else
|
|
{
|
|
e.Row.Cells[4].Text = "正常";
|
|
}
|
|
}
|
|
catch
|
|
{
|
|
e.Row.Cells[4].Text = "未连接";
|
|
e.Row.Cells[4].ForeColor = Color.Red;
|
|
}
|
|
|
|
string _SERVERPARTCODE = GridViewEx1.DataKeys[e.Row.RowIndex].Values["SERVERPARTCODE"].ToString(); //服务区
|
|
LinkButton _ButtonXQ = e.Row.Cells[1].FindControl("ButtonXQ") as LinkButton;//查看积分、消费记录
|
|
if (!string.IsNullOrEmpty(_SERVERPARTCODE))
|
|
{
|
|
_ButtonXQ.OnClientClick = GridViewEx1.GetOpenPopDialogClientScript(
|
|
"WinSystemLogList.aspx?SERVERPARTCODE=" + _SERVERPARTCODE.ToEncrypt(), 1100, 600);
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
}
|
|
}
|