|
using Common;
|
using Dao;
|
using Model;
|
using System;
|
using System.Collections.Generic;
|
using System.Text;
|
using System.Web;
|
using System.Web.Profile;
|
using System.Web.SessionState;
|
|
public partial class GwStatisV3Page : PageBase<SysUser>, IRequiresSessionState
|
{
|
private List<GwOp> OpList;
|
private List<GwClient> ClientList;
|
private List<GwAp> ApList;
|
|
private int _userId = -1;
|
private int _userType = -1;
|
private string _account = "";
|
string permissionsSQL = null;
|
|
public StatisOption SelectedOptions { get; set; }
|
|
public DateTime StartTime { get; set; }
|
|
public DateTime EndTime { get; set; }
|
|
public string StatisType { get; set; }
|
|
public string SelectedClientID { get; set; }
|
|
public string SelectedSpID { get; set; }
|
|
public string SelectedAPID { get; set; }
|
|
public string SelectedOPID { get; set; }
|
|
protected void Page_Load(object sender, EventArgs e)
|
{
|
this.CheckRight("502", FailedOperation.ErrorMsgOnly);
|
|
_userId = this.AppContext.SessionObject.UserID;
|
_userType = this.AppContext.SessionObject.UserType;
|
_account = this.AppContext.SessionObject.Account;
|
permissionsSQL = new GwClientDao().GetClientPermissions(_userId, _userType, null);
|
|
using (GwOpDao gwOpDao = new GwOpDao())
|
this.OpList = gwOpDao.LoadInfoList();
|
using (GwClientDao gwClientDao = new GwClientDao())
|
{
|
this.ClientList = gwClientDao.LoadInfoList("", "", "", "", permissionsSQL);
|
}
|
using (GwApDao gwApDao = new GwApDao())
|
this.ApList = gwApDao.LoadInfoList();
|
if (this.IsPostBack)
|
return;
|
this.SelectedOptions = StatisOption.None;
|
this.StartTime = DateTime.Now.AddDays(-7.0).Date;
|
this.EndTime = DateTime.Now.AddDays(1.0).Date;
|
this.SelectedClientID = string.Empty;
|
this.SelectedSpID = string.Empty;
|
}
|
|
private string GetApName(int apID)
|
{
|
if (this.ApList == null)
|
return string.Empty;
|
GwAp gwAp = this.ApList.Find((Predicate<GwAp>)(ap => ap.ApID == apID));
|
if (gwAp != null)
|
return string.Format("{0}-{1}", (object)gwAp.ApID, (object)gwAp.ApName);
|
return string.Empty;
|
}
|
|
private string GetOpName(int opID)
|
{
|
if (this.OpList == null)
|
return string.Empty;
|
GwOp gwOp = this.OpList.Find((Predicate<GwOp>)(op => op.OpID == opID));
|
if (gwOp != null)
|
return string.Format("{0}-{1}", (object)gwOp.OpID, (object)gwOp.OpName);
|
return string.Empty;
|
}
|
|
private string GetClientName(string clientID)
|
{
|
if (this.ClientList == null)
|
return string.Empty;
|
GwClient gwClient = this.ClientList.Find((Predicate<GwClient>)(client => client.ClientID == clientID));
|
if (gwClient != null)
|
return string.Format("{0}", (object)gwClient.ClientName);
|
return string.Format("{0}", (object)clientID);
|
}
|
|
protected string GenerateAPIDOptions()
|
{
|
StringBuilder stringBuilder = new StringBuilder();
|
if (this.ApList.Count == 0)
|
{
|
stringBuilder.Append("<option value=\"\">暂无接入点信息</option>");
|
}
|
else
|
{
|
stringBuilder.Append("<option value=\"\">所有接入点信息</option>");
|
foreach (GwAp gwAp in this.ApList)
|
stringBuilder.AppendFormat("<option value=\"{0}\" {2}>{0}-{1}</option>", (object)gwAp.ApID, (object)gwAp.ApName, gwAp.ApID.ToString() == this.SelectedAPID ? (object)"selected" : (object)"");
|
}
|
return stringBuilder.ToString();
|
}
|
|
protected string GenerateOPIDOptions()
|
{
|
StringBuilder stringBuilder = new StringBuilder();
|
if (this.OpList.Count == 0)
|
{
|
stringBuilder.Append("<option value=\"\">暂无通道信息</option>");
|
}
|
else
|
{
|
stringBuilder.Append("<option value=\"\">所有通道信息</option>");
|
foreach (GwOp gwOp in this.OpList)
|
{
|
if (this.AppContext.ContainsTargetID("502", gwOp.OpID.ToString()))
|
stringBuilder.AppendFormat("<option value=\"{0}\" {2}>{0}-{1}</option>", (object)gwOp.OpID, (object)gwOp.OpName, gwOp.OpID.ToString() == this.SelectedOPID ? (object)"selected" : (object)"");
|
}
|
}
|
return stringBuilder.ToString();
|
}
|
|
protected string GenerateClientIDOptions()
|
{
|
StringBuilder stringBuilder = new StringBuilder();
|
if (this.ClientList.Count == 0)
|
{
|
stringBuilder.Append("<option value=\"\">暂无客户信息</option>");
|
}
|
else
|
{
|
stringBuilder.Append("<option value=\"\">所有客户</option>");
|
foreach (GwClient gwClient in this.ClientList)
|
{
|
if (this.AppContext.HasRight("502"))
|
stringBuilder.AppendFormat("<option value=\"{0}\" {2}>{0}-{1}</option>", (object)gwClient.ClientID, (object)gwClient.ClientName, gwClient.ClientID == this.SelectedClientID ? (object)"selected" : (object)"");
|
}
|
}
|
return stringBuilder.ToString();
|
}
|
|
protected string GenerateSpIDOptions()
|
{
|
StringBuilder stringBuilder = new StringBuilder();
|
using (GwSpDao gwSpDao = new GwSpDao())
|
{
|
List<GwSp> list = gwSpDao.LoadInfoList("", "", "", permissionsSQL);
|
if (list.Count == 0)
|
{
|
stringBuilder.Append("<option value=\"\">暂无客户信息</option>");
|
}
|
else
|
{
|
stringBuilder.Append("<option value=\"\">所有帐号</option>");
|
foreach (GwSp gwSp in list)
|
{
|
if (this.AppContext.HasRight("502"))
|
stringBuilder.AppendFormat("<option value=\"{0}\" {3}>{1}-{2}</option>", (object)gwSp.SpID, (object)gwSp.ClientID, (object)gwSp.SpID, gwSp.SpID == this.SelectedSpID ? (object)"selected" : (object)"");
|
}
|
}
|
return stringBuilder.ToString();
|
}
|
}
|
}
|