wzp
2021-11-30 f0a773e75016d08684a5c1fdd70d81f68141845d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
 
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 _GwSp : PageBase<SysUser>, IRequiresSessionState
{
    protected List<GwOp> OpList;
    protected List<GwOpGroup> GroupList;
    protected List<GwAp> ApList;
 
    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 (GwOpDao gwOpDao = new GwOpDao())
            this.OpList = gwOpDao.LoadInfoList();
        using (GwOpGroupDao gwOpGroupDao = new GwOpGroupDao())
            this.GroupList = gwOpGroupDao.GetGroupList();
        using (GwDiverterDao gwDiverterDao = new GwDiverterDao())
            this.DiverterList = (IEnumerable<GwDiverter>)gwDiverterDao.LoadList();
    }
 
    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();
    }
 
    public string GetOpOptions(int opId)
    {
        StringBuilder stringBuilder = new StringBuilder();
        if (this.OpList.Count == 0)
            return "<option value=''>无通道信息</option>";
        stringBuilder.AppendFormat("<option value=\"{0}\" >{1}</option>", 0, "设置为空");
        foreach (GwOp gwOp in this.OpList)
        {
            if (opId == gwOp.OpID)
                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{0}-{1}</option>", gwOp.OpID, gwOp.OpName);
            else
                stringBuilder.AppendFormat("<option value=\"{0}\">{0}-{1}</option>",gwOp.OpID, gwOp.OpName);
        }
        return stringBuilder.ToString();
    }
}