wzp
2022-11-11 2f74eb23c0d2d4a246bc612c5c34bdfa8dea5603
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
<%@ WebHandler Language="C#" Class="GwOpHandler" %>
using Dao;
using Model;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
 
public class GwOpHandler : PageHandler<SysUser>
{
  private GwOpDao _Dao = new GwOpDao();
  private GwSpDao _GwSpDao = new GwSpDao();
  private GwOpGroupDao _GwOpGroupDao = new GwOpGroupDao();
 
  public override JsonPageResult ProcessRequestInternal(PageContext<SysUser> context)
  {
    string @string = context.GetString("action");
    switch (@string)
    {
      case "delete":
        return this.Delete(context);
      case "update":
        return this.Update(context);
      case "add":
        return this.Add(context);
      case "status":
        return this.Status(context);
      case "saveAlarmSetting":
        return this.SaveAlarmSetting(context);
      case "getAlarmSetting":
        return this.GetAlarmSetting(context);
      case "test":
        return this.Test(context);
      case "getList":
        return this.GetList(context);
      case "getOp":
        return this.GetOp(context);
      case "getOpRate":
        return this.GetOpRate(context);
      case "loadToGwOpPageList"://加载通道信息//通道开启
        return this.LoadToGwOpPageList(context);
        case "loadToGwOpPageListStop":
        return this.LoadToGwOpPageListStop(context);
            
            
      default:
        throw new Exception("Invalid Action=" + @string);
    }
  }
 
  //加载启用通道信息
  private JsonPageResult LoadToGwOpPageList(PageContext<SysUser> context)
  {
    string string1 = context.GetString("opID");
    string opName = context.GetString("opName");
    int opstatus = context.GetInt("opstatus");
    context.GetInt("operror");
    int recordCount = 0;
    int pageSize = context.GetInt("pageSize", 50);
    int pageIndex = context.GetInt("pageIndex", 1);
    using (GwOpDao gwOpDao = new GwOpDao())
    {
      string opID = "0";
      if (this.IsInt(string1))
        opID = string1;
      List<GwOp> list = gwOpDao.LoadInfoList(opID, opName, opstatus, pageSize, pageIndex, out recordCount);
      string str1 = "";
      if (list != null && list.Count > 0)
      {
          
        int num = 0;
        foreach (GwOp gwOp in list)
        {
          ++num;
          str1 = str1 + (object) "<tr><td>" +  (object) gwOp.OpID;
          str1 = str1 + "</td><td>" + gwOp.OpName + "</td>";
          str1 = string.Concat(new object[4]
          {
             str1,
              "<td>",
             gwOp.Threshold,
             "</td>"
          });
          str1 += string.Format("<td rate-id=\"{0}\">{1}</td>", (object) gwOp.OpID, (object) gwOp.CurrentRate);
          str1 = str1 + "<td>" + GwOp.ToClassNameText(gwOp.ClassName) + "</td>";
          str1 = str1 + "<td>" + gwOp.AccessCode + "</td>";
          str1 = str1 + "<td>" + gwOp.ServerIp + "</td>";
          str1 = string.Concat(new object[4]
          {
             str1,
             "<td>",
             gwOp.ServerPort,
             "</td>"
          });
          str1 = string.Concat(new object[4]
          {
             str1,
             "<td>",
             gwOp.LocalPort,
              "</td>"
          });
          str1 = string.Concat(new object[4]
          {
              str1,
             "<td>",
            gwOp.MaxConn,//并发量
              "</td>"
          });
          str1 = string.Concat(new object[4]
          {
            str1,
            "<td>",
             gwOp.ClearFixMode,//抹签名
              "</td>"
          });
          //str1 = string.Concat(new object[4]
          //{
          //   str1,
          //    "<td>",
          //    (object) ((double) gwOp.Price / 1000.0),           // gwOp.Price/1000.00,//通道成本价格
          //   "</td>"
          //}); 
 
          str1 += string.Format("<td>{0}元/条</td>", (object)(Convert.ToDecimal(gwOp.Price) / new Decimal(1000)));
            
          str1 = str1 + (object) "<td remark-id=\"" +  (object) gwOp.OpID + "\">" + this.FormatOpError(gwOp.OpStatus, gwOp.OpError, gwOp.Remark) + "</td>";
          str1 += "<td  class=\"text-right\">";
          str1 = gwOp.OpStatus != 0 ? str1 + string.Format("<a href=\"javascript:;\" data-id=\"{0}\" data-status=\"0\" class=\"action-update-status btn btn-primary btn-xs\"><i class=\"fa fa-toggle-off\"></i>&nbsp;停用</a> ", (object) gwOp.OpID) : str1 + string.Format("<a href=\"javascript:;\" data-id=\"{0}\" data-status=\"1\" class=\"action-update-status btn  btn-default btn-xs\"><i class=\"fa fa-toggle-on\"/></i>&nbsp;启用</a> ", (object) gwOp.OpID);
          str1 += string.Format("<a href=\"javascript:;\" data-id=\"{0}\" class=\"action-modal-alarm btn  btn-warning btn-xs\"><i class=\"fa fa-bell\"></i>&nbsp;告警</a> ", (object) gwOp.OpID);
          str1 += string.Format("<a href=\"javascript:;\" data-id=\"{0}\" class=\"action-modal-edit btn  btn-success btn-xs\"><i class=\"fa fa-edit\"></i>&nbsp;编辑</a> ", (object) gwOp.OpID);
          str1 += string.Format("<a href=\"javascript:;\" data-id=\"{0}\" class=\"action-delete btn  btn-default btn-xs\"><i class=\"fa fa-trash\"></i>&nbsp;删除</a> ", (object) gwOp.OpID);
          str1 += string.Format("<a href=\"javascript:;\" data-id=\"{0}\" class=\"action-modal-test btn  btn-danger btn-xs\"><i class=\"fa fa-gavel\"></i>&nbsp;测试</a> ", (object) gwOp.OpID);
          str1 += "</td>";
          str1 += "</tr>";
          if (!string.IsNullOrEmpty(gwOp.AlarmSetting))
          {
            JToken jtoken = JsonConvert.DeserializeObject<JToken>(gwOp.AlarmSetting);
            if (jtoken.Value<int>((object) "opOutThreshold") > 0 || jtoken.Value<int>((object) "opReportRatioThreshold") > 0 || jtoken.Value<int>((object) "opSuccessRatioThreshold") > 0)
            {
              string str2 = string.Format(" <div class=\"text-muted \">告警条件:通道流出速度门限低于 <span class='label label-success'>{0}条/5分钟</span>;5分钟内报告率低于 <span class='label label-success'>{1}%</span>;5分钟内成功率门限低于 <span class='label label-success'>{2}%</span>;</div>", (object) jtoken.Value<int>((object) "opOutThreshold"), (object) jtoken.Value<int>((object) "opReportRatioThreshold"), (object) jtoken.Value<int>((object) "opSuccessRatioThreshold"));
              str1 = str1 + "<tr><td colspan=\"12\">" + str2 + "</td><td></td></tr>";
            }
          }
        }
      }
      else
        str1 += "<tr><td colspan=\"13\" style=\"padding-left:5px; text-align: center;\">暂无信息</td></tr>";
      return new JsonPageResult(true,  new
      {
        Table = str1.ToString(),
        TotalCount = recordCount
      });
    }
  }
 
 
  //加载停用通道信息
  private JsonPageResult LoadToGwOpPageListStop(PageContext<SysUser> context)
  {
      string string1 = context.GetString("opID");
      string opName = context.GetString("opName");
      int opstatus = context.GetInt("opstatus");
      context.GetInt("operror");
      int recordCount = 0;
      int pageSize = context.GetInt("pageSize", 50);
      int pageIndex = context.GetInt("pageIndex", 1);
      using (GwOpDao gwOpDao = new GwOpDao())
      {
          string opID = "0";
          if (this.IsInt(string1))
              opID = string1;
          List<GwOp> list = gwOpDao.LoadInfoListStop(opID, opName, opstatus, pageSize, pageIndex, out recordCount);
          string str1 = "";
          if (list != null && list.Count > 0)
          {
 
              int num = 0;
              foreach (GwOp gwOp in list)
              {
                  ++num;
                  str1 = str1 + (object)"<tr><td>" + (object)gwOp.OpID;
                  str1 = str1 + "</td><td>" + gwOp.OpName + "</td>";
                  str1 = string.Concat(new object[4]
          {
             str1,
              "<td>",
             gwOp.Threshold,
             "</td>"
          });
                  str1 += string.Format("<td rate-id=\"{0}\">{1}</td>", (object)gwOp.OpID, (object)gwOp.CurrentRate);
                  str1 = str1 + "<td>" + GwOp.ToClassNameText(gwOp.ClassName) + "</td>";
                  str1 = str1 + "<td>" + gwOp.AccessCode + "</td>";
                  str1 = str1 + "<td>" + gwOp.ServerIp + "</td>";
                  str1 = string.Concat(new object[4]
          {
             str1,
             "<td>",
             gwOp.ServerPort,
             "</td>"
          });
                  str1 = string.Concat(new object[4]
          {
             str1,
             "<td>",
             gwOp.LocalPort,
              "</td>"
          });
                  str1 = string.Concat(new object[4]
          {
              str1,
             "<td>",
            gwOp.MaxConn,//并发量
              "</td>"
          });
                  str1 = string.Concat(new object[4]
          {
            str1,
            "<td>",
             gwOp.ClearFixMode,//抹签名
              "</td>"
          });
                  //str1 = string.Concat(new object[4]
                  //{
                  //   str1,
                  //    "<td>",
                  //    (object) ((double) gwOp.Price / 1000.0),           // gwOp.Price/1000.00,//通道成本价格
                  //   "</td>"
                  //}); 
 
                  str1 += string.Format("<td>{0}元/条</td>", (object)(Convert.ToDecimal(gwOp.Price) / new Decimal(1000)));
 
                  str1 = str1 + (object)"<td remark-id=\"" + (object)gwOp.OpID + "\">" + this.FormatOpError(gwOp.OpStatus, gwOp.OpError, gwOp.Remark) + "</td>";
                  str1 += "<td  class=\"text-right\">";
                  str1 = gwOp.OpStatus != 0 ? str1 + string.Format("<a href=\"javascript:;\" data-id=\"{0}\" data-status=\"0\" class=\"action-update-status btn btn-primary btn-xs\"><i class=\"fa fa-toggle-off\"></i>&nbsp;停用</a> ", (object)gwOp.OpID) : str1 + string.Format("<a href=\"javascript:;\" data-id=\"{0}\" data-status=\"1\" class=\"action-update-status btn  btn-default btn-xs\"><i class=\"fa fa-toggle-on\"/></i>&nbsp;启用</a> ", (object)gwOp.OpID);
                  str1 += string.Format("<a href=\"javascript:;\" data-id=\"{0}\" class=\"action-modal-alarm btn  btn-warning btn-xs\"><i class=\"fa fa-bell\"></i>&nbsp;告警</a> ", (object)gwOp.OpID);
                  str1 += string.Format("<a href=\"javascript:;\" data-id=\"{0}\" class=\"action-modal-edit btn  btn-success btn-xs\"><i class=\"fa fa-edit\"></i>&nbsp;编辑</a> ", (object)gwOp.OpID);
                  str1 += string.Format("<a href=\"javascript:;\" data-id=\"{0}\" class=\"action-delete btn  btn-default btn-xs\"><i class=\"fa fa-trash\"></i>&nbsp;删除</a> ", (object)gwOp.OpID);
                  str1 += string.Format("<a href=\"javascript:;\" data-id=\"{0}\" class=\"action-modal-test btn  btn-danger btn-xs\"><i class=\"fa fa-gavel\"></i>&nbsp;测试</a> ", (object)gwOp.OpID);
                  str1 += "</td>";
                  str1 += "</tr>";
                  if (!string.IsNullOrEmpty(gwOp.AlarmSetting))
                  {
                      JToken jtoken = JsonConvert.DeserializeObject<JToken>(gwOp.AlarmSetting);
                      if (jtoken.Value<int>((object)"opOutThreshold") > 0 || jtoken.Value<int>((object)"opReportRatioThreshold") > 0 || jtoken.Value<int>((object)"opSuccessRatioThreshold") > 0)
                      {
                          string str2 = string.Format(" <div class=\"text-muted \">告警条件:通道流出速度门限低于 <span class='label label-success'>{0}条/5分钟</span>;5分钟内报告率低于 <span class='label label-success'>{1}%</span>;5分钟内成功率门限低于 <span class='label label-success'>{2}%</span>;</div>", (object)jtoken.Value<int>((object)"opOutThreshold"), (object)jtoken.Value<int>((object)"opReportRatioThreshold"), (object)jtoken.Value<int>((object)"opSuccessRatioThreshold"));
                          str1 = str1 + "<tr><td colspan=\"12\">" + str2 + "</td><td></td></tr>";
                      }
                  }
              }
          }
          else
              str1 += "<tr><td colspan=\"13\" style=\"padding-left:5px; text-align: center;\">暂无信息</td></tr>";
          return new JsonPageResult(true, new
          {
              Table = str1.ToString(),
              TotalCount = recordCount
          });
      }
  }
    
  private string FormatOpError(int opStatus, int opError, string remark)
  {
    StringBuilder stringBuilder = new StringBuilder();
    if (opStatus == 0)
    {
      stringBuilder.Append("<span class=\"label label-default\">已停用</span>");
    }
    else
    {
      stringBuilder.Append("<a data-html=\"true\"  data-content=\"<pre style='width:200px;height:160px;'>" + HttpUtility.HtmlEncode(remark) + "</pre>\" type=\"button\" class=\"btn-xs\" data-trigger=\"click\" data-toggle=\"popover\" data-placement=\"left\">");
      if (opError == 0)
        stringBuilder.Append("<span class=\"label label-primary\">正常</span>");
      else if (opError == 5)
        stringBuilder.Append("<span class=\"label label-danger\">异常</span>");
      else
        stringBuilder.Append("NA");
      stringBuilder.Append("</a>");
    }
    return stringBuilder.ToString();
  }
 
  public bool IsInt(string input)
  {
    for (int index = 0; index < input.Length; ++index)
    {
      if (!char.IsNumber(input, index))
        return false;
    }
    return true;
  }
 
  private JsonPageResult GetOp(PageContext<SysUser> context)
  {
    return new JsonPageResult(true, this._Dao.GetOP(context.GetInt("opid")));
  }
 
  private JsonPageResult GetList(PageContext<SysUser> context)
  {
    return new JsonPageResult(true, this._Dao.LoadInfoList());
  }
 
  private JsonPageResult GetOpRate(PageContext<SysUser> context)
  {
    return new JsonPageResult(true, this._Dao.GetOpRateList());
  }
 
  private JsonPageResult Test(PageContext<SysUser> context)
  {
    string string1 = context.GetString("mobile");
    string string2 = context.GetString("content");
    string string3 = context.GetString("extNo");
    int @int = context.GetInt("opID");
    string string4 = context.GetString("extParams");
    string apID = "230001";
    if (!Regex.IsMatch(string1, "1\\d{10}"))
      throw new ArgumentException("手机号码格式不正确,请重新输入!");
    if (string.IsNullOrEmpty(string2))
      throw new ArgumentException("短信内容不能为空,请重新输入!");
    using (GwAuditCacheDao gwAuditCacheDao = new GwAuditCacheDao())
    {
      if (!gwAuditCacheDao.MakeTest(apID, @int, string3, string4, string1, string2))
        throw new Exception(string.Format("通道:{0},手机号码:{1},提交信息入库失败!", (object) @int, (object) string1));
    }
    return new JsonPageResult(true, (object) string.Format("通道:{0},手机号码:{1},提交信息成功,请到下行日志中查询发送详情!", (object) @int, (object) string1));
  }
 
  private JsonPageResult GetAlarmSetting(PageContext<SysUser> context)
  {
    string str = this._Dao.GetAlarmSetting(context.GetInt("opID"));
    if (string.IsNullOrEmpty(str))
      str = "{isAlarmEnabled:0,opOutThreshold:0,opReportRatioThreshold:0,opSuccessRatioThreshold:0}";
    return new JsonPageResult(true, JsonConvert.DeserializeObject(str));
  }
 
  private JsonPageResult SaveAlarmSetting(PageContext<SysUser> context)
  {
    int @int = context.GetInt("opid");
    var fAnonymousType1 = new
    {
      opOutThreshold = context.GetInt("opOutThreshold"),
      opReportRatioThreshold = context.GetInt("opReportRatioThreshold"),
      opSuccessRatioThreshold = context.GetInt("opSuccessRatioThreshold")
    };
    this._Dao.UpdateAlarmSetting(@int, JsonConvert.SerializeObject((object) fAnonymousType1));
    return new JsonPageResult(true, "告警设置保存成功!");
  }
 
  private JsonPageResult Delete(PageContext<SysUser> context)
  {
    
 
    //int @int = context.GetInt("id");
    //if (this._Dao.gwsptableid(@int))
    //    throw new Exception("通道信息正在被客户账号使用中,不能删除!");
    //this._Dao.Delete(context.GetInt("id"));
    //return new JsonPageResult(true, "删除通道信息成功!");
 
 
      
    int @int = context.GetInt("id");
 
    if (this._GwSpDao.GwOpCount(@int) > 0)
        throw new ArgumentException("通道信息正在被客户账号使用中,无法删除!");
    if (this._GwOpGroupDao.OpItemCount(@int) > 0)
        throw new ArgumentException("当前通道正在通道组中使用,无法删除!");
    this._Dao.Delete(@int);
    return new JsonPageResult(true, "删除通道信息成功!");
      
      
  }
 
  private JsonPageResult Status(PageContext<SysUser> context)
  {
    this._Dao.UpdateOpStatus(context.GetInt("id"), context.GetInt("status"));
    return new JsonPageResult(true,  "删除节点成功!");
  }
 
  private JsonPageResult Add(PageContext<SysUser> context)
  {
    int int1 = context.GetInt("opID");
    string string1 = context.GetString("opName");
    int int2 = context.GetInt("threshold");
    string string2 = context.GetString("accessCode");
    string string3 = context.GetString("serverIp");
    int int3 = context.GetInt("serverPort");
    string string4 = context.GetString("spID");
    string string5 = context.GetString("password");
    int int4 = context.GetInt("localPort");
    int int5 = context.GetInt("feeShortLength", 70);
    int int6 = context.GetInt("feeLongLength", 67);
    int int7 = context.GetInt("splitLength", 70);
    string string6 = context.GetString("className");
    string string7 = context.GetString("extParams");
    string string8 = context.GetString("userName");
    int int8 = context.GetInt("priority");
    string string9 = context.GetString("whiteSegments");
    string string10 = context.GetString("blackSegments");
    int int9 = context.GetInt("udhiMode");
    int int10 = context.GetInt("msgFormat");
    int int11 = context.GetInt("maxConn", 1);
    int int12 = context.GetInt("clearFixMode", 0);
    int int13 = context.GetInt("splitMode", 0);
    int num = Math.Max((int) (context.GetDecimal("price", new Decimal(4, 0, 0, false, (byte) 2)) * new Decimal(1000)), 1);
    int int14 = context.GetInt("blackpool", 0);
    if (int1 == 0 || int1 < 600000 || int1 > 999999)
      throw new ArgumentException("通道编号不能为空,且必须在600000-999999之间");
    if (this._Dao.IsIDExists(int1))
      throw new ArgumentException("通道OPID已经存在,请重新输入!");
    if (string.IsNullOrEmpty(string1))
      throw new ArgumentException("通道名称不能为空!");
    if (this._Dao.IsNameEixsts(string1, int1))
      throw new ArgumentException("通道名称已经存在,请重新输入!");
    if (string.IsNullOrEmpty(string3))
      throw new ArgumentException("服务器IP地址不能为空!");
    if (string.IsNullOrEmpty(string4))
      throw new ArgumentException("SpID不能为空!");
    if (string.IsNullOrEmpty(string5))
      throw new ArgumentException("密码不能为空!");
    if (string.IsNullOrEmpty(string6))
      throw new ArgumentException("请选择通道类型!");
    this._Dao.Add(new GwOp()
    {
      OpID = int1,
      OpName = string1,
      Threshold = int2,
      AccessCode = string2,
      ServerIp = string3,
      ServerPort = int3,
      SpID = string4,
      Password = string5,
      LocalPort = int4,
      FeeShortLength = int5,
      FeeLongLength = int6,
      SplitLength = int7,
      ClassName = string6,
      ExtParams = string7,
      UserName = string8,
      Priority = int8,
      WhiteSegments = string9,
      BlackSegments = string10,
      UdhiMode = int9,
      MsgFormat = int10,
      MaxConn = int11,
      ClearFixMode = int12,
      SplitMode = int13,
      Price = num,
      BlackPoolID = int14
    });
    return new JsonPageResult(true, "添加通道成功!");
  }
 
  private JsonPageResult Update(PageContext<SysUser> context)
  {
    int int1 = context.GetInt("opID");
    string string1 = context.GetString("opName");
    int int2 = context.GetInt("threshold", 10);
    string string2 = context.GetString("accessCode");
    string string3 = context.GetString("serverIp");
    int int3 = context.GetInt("serverPort");
    string string4 = context.GetString("spID");
    string string5 = context.GetString("password");
    int int4 = context.GetInt("localPort");
    int int5 = context.GetInt("feeShortLength", 70);
    int int6 = context.GetInt("feeLongLength", 67);
    int int7 = context.GetInt("splitLength", 70);
    string string6 = context.GetString("className");
    string string7 = context.GetString("extParams");
    string string8 = context.GetString("userName");
    int int8 = context.GetInt("priority");
    string string9 = context.GetString("whiteSegments");
    string string10 = context.GetString("blackSegments");
    int int9 = context.GetInt("udhiMode");
    int int10 = context.GetInt("msgFormat");
    int int11 = context.GetInt("maxConn", 1);
    int int12 = context.GetInt("clearFixMode", 0);
    int int13 = context.GetInt("splitMode", 0);
    int num = Math.Max((int) (context.GetDecimal("price", new Decimal(4, 0, 0, false, (byte) 2)) * new Decimal(1000)), 1);
    int int14 = context.GetInt("blackpool", 0);
    if (string.IsNullOrEmpty(string1))
      throw new ArgumentException("通道名称不能为空!");
    if (this._Dao.IsNameEixsts(string1, int1))
      throw new ArgumentException("通道名称已经存在,请重新输入!");
    if (string.IsNullOrEmpty(string3))
      throw new ArgumentException("服务器IP地址不能为空!");
    if (string.IsNullOrEmpty(string4))
      throw new ArgumentException("SpID不能为空!");
    if (string.IsNullOrEmpty(string5))
      throw new ArgumentException("密码不能为空!");
    if (string.IsNullOrEmpty(string6))
      throw new ArgumentException("请选择通道类型!");
    this._Dao.Update(new GwOp()
    {
      OpID = int1,
      OpName = string1,
      Threshold = int2,
      AccessCode = string2,
      ServerIp = string3,
      ServerPort = int3,
      SpID = string4,
      Password = string5,
      LocalPort = int4,
      FeeShortLength = int5,
      FeeLongLength = int6,
      SplitLength = int7,
      ClassName = string6,
      ExtParams = string7,
      UserName = string8,
      Priority = int8,
      WhiteSegments = string9,
      BlackSegments = string10,
      UdhiMode = int9,
      MsgFormat = int10,
      MaxConn = int11,
      ClearFixMode = int12,
      SplitMode = int13,
      Price = num,
      BlackPoolID = int14
    });
    return new JsonPageResult(true, "通道参数更新成功!");
  }
}