yzh
2022-03-14 1fbfe94790a03ab58ac8dee37f5095ff611ec3d8
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
<%@ WebHandler Language="C#" Class="GwDm" %>
 
using System;
using System.Web;
using Model;
using Dao;
using System.Collections.Generic;
 
public class GwDm : PageHandler<SysUser>
{
 
    public override JsonPageResult ProcessRequestInternal(PageContext<Model.SysUser> context)
    {
        string action = context.GetString("action");
 
        switch (action)
        {
            case "loadGwDmPageList":
                return LoadGwDmPageList(context);
 
            default:
                throw new Exception("Invalid Action=" + action);
        }
    }
    
    GwDmDao dao = new GwDmDao();
    private JsonPageResult LoadGwDmPageList(PageContext<SysUser> context)
    {
        string SelectedApID = context.GetString("SelectedApID");
        string SelectedOpID = context.GetString("SelectedOpID");
        string SelectedSpID = context.GetString("SelectedSpID");
        string SelectedDestnationID = context.GetString("SelectedDestnationID");
        string SelectedDate = context.GetString("SelectedDate");
        
        int recordCount = 0;
        int pageSize = context.GetInt("pageSize", 20);
        int pageIndex = context.GetInt("pageIndex", 1);
 
        List<Model.GwDm> list = dao.LoadInfoList(SelectedApID, SelectedOpID, SelectedSpID, SelectedDestnationID, SelectedDate, out recordCount, pageSize, pageIndex);
 
        string str = "";
        if (list != null && list.Count > 0)
        {
            int i = 0;
            
            foreach (Model.GwDm item in list)
            {
                i++;
                str += "<tr class=\"row-" + i % 2 + "\" >";
                str += "<td>" + item.OPMID + "</td>";
                str += "<td>" + item.ClientID + "</td>";
                str += "<td>" + item.SPID + "</td>";
                str += "<td>" + item.ApID + "</td>";
                str += "<td>" + item.OpID + "</td>";
                str += "<td>" + item.Mobile + "</td>";
                str += "<td>" + item.AccessCode + "</td>";
                str += "<td>" + item.ExtNo + "</td>";
                str += "<td>" + item.RDFlag + "</td>";
                str += "<td>" + item.MsgFormat + "</td>";
                str += "<td>" + item.MsgLength + "</td>";
                str += "<td>" + item.DeliverTime + "</td>";
                str += "</tr>";
                str += "<tr>";
                str += "<td colspan=\"12\" height=\"25\" align=\"right\" style=\"text-align:right;\">" + item.MsgContent + "</td>";
                str += "</tr>";
            }
        }
        else
        {
            str += "<tr><td colspan=\"12\" style=\"padding-left:5px;\">暂无信息</td></tr>";
        }
 
        return new JsonPageResult(true, new { Table = str.ToString(), TotalCount = recordCount });
    }
 
}