|
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 _GwMoRoute : PageBase<SysUser>, IRequiresSessionState
|
{
|
private List<GwOp> OpList;
|
|
private int _userId = -1;
|
private int _userType = -1;
|
private string _account = "";
|
|
public GwSp GwSp { get; protected set; }
|
|
public string SpID
|
{
|
get
|
{
|
return this.AppContext.GetString("spid");
|
}
|
}
|
|
public string SelectedOPID { get; set; }
|
|
public string SelectedSpID { get; set; }
|
|
protected void Page_Load(object sender, EventArgs e)
|
{
|
this.CheckRight("306", FailedOperation.ErrorMsgOnly);
|
|
_userId = this.AppContext.SessionObject.UserID;
|
_userType = this.AppContext.SessionObject.UserType;
|
_account = this.AppContext.SessionObject.Account;
|
|
using (GwSpDao gwSpDao = new GwSpDao())
|
{
|
if (!string.IsNullOrEmpty(this.SpID))
|
{
|
this.GwSp = gwSpDao.Get(this.SpID);
|
}
|
else
|
{
|
this.GwSp = new GwSp();
|
this.GwSp.Price = 40;
|
this.GwSp.FeeLongLength = 67;
|
this.GwSp.FeeShortLength = 70;
|
this.GwSp.MaxConnCount = 1;
|
this.GwSp.Threshold = 30;
|
this.GwSp.MCPM = 10;
|
this.GwSp.Status = 1;
|
this.GwSp.BlackMode = 1;
|
this.GwSp.DiverterID = 0;
|
this.GwSp.Password = "123456";
|
this.GwSp.AccessCode = gwSpDao.GetNextAccessCode();
|
this.GwSp.ClientIp = "0.0.0.0";
|
this.GwSp.ForceSignFlag = 0;
|
this.GwSp.ForceSign = "";
|
}
|
}
|
using (GwOpDao gwOpDao = new GwOpDao())
|
this.OpList = gwOpDao.LoadInfoList();
|
}
|
|
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("306", 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 GenerateSpIDOptions()
|
{
|
StringBuilder stringBuilder = new StringBuilder();
|
using (GwSpDao gwSpDao = new GwSpDao())
|
{
|
string permissionsSQL = new GwClientDao().GetClientPermissions(_userId, _userType, null);
|
|
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("306"))
|
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();
|
}
|
}
|
}
|