yzh
2021-09-30 1a81b518e0edd87a310a5b477773657e23d49cbd
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
 
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();
    }
 
 
}