wzp
2021-09-28 2b71e5009ea587c4a749588c68db826a44d17ba2
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
<%@ WebHandler Language="C#" Class="GwMobileAreaHandler" %>
 
 
using Dao;
using Model;
using System;
using System.Collections.Generic;
using System.Text;
 
public class GwMobileAreaHandler : PageHandler<SysUser>
{
  private GwMobileAreaDao mobileAreaDao = new GwMobileAreaDao();
 
  public override JsonPageResult ProcessRequestInternal(PageContext<SysUser> context)
  {
    string @string = context.GetString("action");
    switch (@string)
    {
      case "loadMobileAreaPageList":
        return this.LoadMobileAreaPageList(context);
      default:
        throw new Exception("Invalid Action=" + @string);
    }
  }
 
  public JsonPageResult AddMobileArea(PageContext<SysUser> context)
  {
    context.GetString("mobileSegment");
    context.GetString("city");
    context.GetString("province");
    context.GetString("cardType");
    return new JsonPageResult(true, (object) "创建号段成功!");
  }
 
  public JsonPageResult LoadMobileAreaPageList(PageContext<SysUser> context)
  {
    string string1 = context.GetString("segment");
    string string2 = context.GetString("province");
    string string3 = context.GetString("cardtype");
    int recordcount = 0;
    int int1 = context.GetInt("pageSize", 20);
    int int2 = context.GetInt("pageIndex", 1);
    StringBuilder stringBuilder = new StringBuilder();
    List<Model.GwMobileArea> list = this.mobileAreaDao.MobilAreaPageList(string1, "", string2, string3, out recordcount, int1, int2);
    if (recordcount != 0)
    {
      foreach (Model.GwMobileArea gwMobileArea in list)
      {
        stringBuilder.Append("<tr>");
        stringBuilder.AppendFormat("<td>{0}</td>", (object) gwMobileArea.ID);
        stringBuilder.AppendFormat("<td>{0}</td>", (object) gwMobileArea.MobileSegment);
        stringBuilder.AppendFormat("<td>{0}-{1}</td>", (object) gwMobileArea.Province, (object) gwMobileArea.City);
        stringBuilder.AppendFormat("<td>暂无可操作</td>");
        stringBuilder.Append("</tr>");
      }
    }
    else
      stringBuilder.AppendFormat("<td colspan='8' style='text-align: center;'>暂无数据</td>");
    return new JsonPageResult(true, (object) new
    {
      Table = stringBuilder.ToString(),
      TotalCount = recordcount
    });
  }
}