|
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 _GwProduct : PageBase<SysUser>, IRequiresSessionState
|
{
|
protected List<GwOp> OpList;
|
protected List<GwProduct> getGwProductClassList; //产品分类
|
protected List<GwOpGroup> GroupList;
|
protected List<GwAp> ApList;
|
protected List<SysXh> SysXhList;
|
|
public IEnumerable<GwDiverter> DiverterList { get; set; }
|
|
protected void Page_Load(object sender, EventArgs e)
|
{
|
this.CheckRight("302", FailedOperation.HistoryGoBack);
|
using (GwApDao gwApDao = new GwApDao())
|
this.ApList = gwApDao.LoadInfoList();
|
using (GwProductDao gwProductDao = new GwProductDao())
|
this.getGwProductClassList = gwProductDao.getGwProductClassList();
|
using (GwOpGroupDao gwOpGroupDao = new GwOpGroupDao())
|
this.GroupList = gwOpGroupDao.GetGroupList();
|
using (GwDiverterDao gwDiverterDao = new GwDiverterDao())
|
this.DiverterList = (IEnumerable<GwDiverter>)gwDiverterDao.LoadList();
|
using (SysXhDao sysXhDao = new SysXhDao())
|
this.SysXhList = sysXhDao.GetSysXhList();
|
|
}
|
|
//产品分类下拉框数据
|
public string GetGwProductClassOptionsAll()
|
{
|
StringBuilder stringBuilder = new StringBuilder();
|
if (this.getGwProductClassList.Count == 0)
|
return "<option value=''>无产品分类信息</option>";
|
stringBuilder.AppendFormat("<option value=\"{0}\" >{1}</option>", 0, "--请选择产品分类--");
|
foreach (GwProduct gwProduct in this.getGwProductClassList)
|
{
|
stringBuilder.AppendFormat("<option value=\"{0}\" >{0}-{1}</option>", gwProduct.id, gwProduct.name);
|
}
|
return stringBuilder.ToString();
|
}
|
|
//通道组下拉框数据
|
public string GetGroupOptionsAll()
|
{
|
StringBuilder stringBuilder = new StringBuilder();
|
if (this.GroupList.Count == 0)
|
return "<option value=''>无通道组信息</option>";
|
stringBuilder.AppendFormat("<option value=\"{0}\" >{1}</option>", 0, "--请选择通道组--");
|
foreach (GwOpGroup gwOpGroup in this.GroupList)
|
{
|
stringBuilder.AppendFormat("<option value=\"{0}\" >{0}-{1}</option>", gwOpGroup.GroupID, gwOpGroup.GroupName);
|
}
|
return stringBuilder.ToString();
|
}
|
|
//序号规则下拉框数据
|
public string GetSysXhOptionsAll()
|
{
|
StringBuilder stringBuilder = new StringBuilder();
|
if (this.SysXhList.Count == 0)
|
return "<option value=''>无序号规则信息</option>";
|
stringBuilder.AppendFormat("<option value=\"{0}\" >{1}</option>", 0, "--请选择序号规则--");
|
foreach (SysXh sysXh in this.SysXhList)
|
{
|
stringBuilder.AppendFormat("<option value=\"{0}\" >{0}-{1}</option>", sysXh.xhId, sysXh.xhName);
|
}
|
return stringBuilder.ToString();
|
}
|
|
public string GetGroupOptions(int groupID)
|
{
|
StringBuilder stringBuilder = new StringBuilder();
|
if (this.GroupList.Count == 0)
|
return "<option value=''>无通道组信息</option>";
|
stringBuilder.AppendFormat("<option value=\"{0}\" >{1}</option>", 0, "设置为空");
|
foreach (GwOpGroup gwOpGroup in this.GroupList)
|
{
|
if (groupID == gwOpGroup.GroupID)
|
stringBuilder.AppendFormat("<option value=\"{0}\" selected>{0}-{1}</option>", gwOpGroup.GroupID, gwOpGroup.GroupName);
|
else
|
stringBuilder.AppendFormat("<option value=\"{0}\">{0}-{1}</option>", gwOpGroup.GroupID, gwOpGroup.GroupName);
|
}
|
return stringBuilder.ToString();
|
}
|
|
|
}
|