前端转vue
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MobilePhoneCheckViewer.xaml.cs 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. using System;
  2. using System.Windows;
  3. using System.Windows.Media;
  4. using System.Windows.Media.Imaging;
  5. using System.IO;
  6. using System.Text.RegularExpressions;
  7. using Platform.Controls.ControlsHelper;
  8. using Platform.Library;
  9. using TellerSystem.Communication;
  10. using TellerSystem.Library.Ext.Function;
  11. using Platform.Common.RunningParameters;
  12. using TellerSystem.ServiceProxy.Ext.ServiceEntitys;
  13. using TellerSystem.Devices.Interface;
  14. using TellerSystem.Library.Ext.Variables;
  15. using TellerSystem.Controls.Ext.PrintsHelper;
  16. using TellerSystem.Library.Ext.TradeExtension;
  17. using TellerSystem.PrintTemplate.Extension;
  18. using System.Windows.Controls;
  19. using System.Printing;
  20. using Platform.Print;
  21. using TellerSystem.ServiceProxy.Ext.ServiceHelper;
  22. using System.Collections.Generic;
  23. using System.Drawing;
  24. using System.ComponentModel;
  25. using TellerSystem.ServiceProxy.Ext;
  26. using TellerSystem.Controls.Ext.ControlsHelper;
  27. using System.Diagnostics;
  28. using System.Text;
  29. using TellerSystem.ServiceProxy.Ext.WebAPI.Auth.Entity;
  30. using System.Net;
  31. using System.Net.Cache;
  32. using Newtonsoft.Json;
  33. using Newtonsoft.Json.Linq;
  34. using TellerSystem.Contract.Function;
  35. /******************************平台Dll*****************************/
  36. namespace TellerSystem.Controls.Ext.Controls
  37. {
  38. /// <summary>
  39. /// PhoneElement.xaml 的交互逻辑
  40. /// </summary>
  41. public partial class MobilePhoneCheckViewer
  42. {
  43. #region Ctor
  44. public MobilePhoneCheckViewer(string idno, string name, string phone)
  45. {
  46. _idCard = idno;
  47. _name = name;
  48. _phone = phone;
  49. InitializeComponent();
  50. Result = false;
  51. }
  52. private string _idCard;
  53. private string _name;
  54. private string _phone;
  55. private void TradePage_Loaded(object sender, RoutedEventArgs e)
  56. {
  57. /* 初始化界面逻辑,页面加载后执行*/
  58. zikrxm.Text = _name;
  59. zikrsjh.Text = _phone;
  60. zikrsfzh.Text = _idCard;
  61. isBr.SetItems(new Dictionary<string, string> { { "是", "1" }, { "否", "0" } });
  62. xxinfo.Height = 90;
  63. Window.GetWindow(this).Closing += (s1, e1) =>
  64. {
  65. e1.Cancel = !Result && this.TradeAPIs.ShowQuestionMessageBox("当前手机号码三要素查验未完成,确认继续业务?") != MessageBoxResult.Yes;
  66. };
  67. }
  68. #endregion
  69. private void btnBack_Click(object sender, RoutedEventArgs e)
  70. {
  71. this.Close();
  72. }
  73. private void btnCheck_Click(object sender, RoutedEventArgs e)
  74. {
  75. AICapacity.Resp resp = null;
  76. AICapacity.ExtData ext = new AICapacity.ExtData(this.CreateSerialNumber(), new Dictionary<string, string>
  77. {
  78. {"idno",_idCard},
  79. {"name",_name},
  80. {"phone",_phone},
  81. {"self","是"},
  82. });
  83. if (isBr.GetSelectedKey() == "否")
  84. {
  85. _name = hzxm.Text;
  86. _idCard = hzsfzh.Text;
  87. ext.ExtInfo["self"] = "否";
  88. ext.ExtInfo["other"] = bz.Text;
  89. ext.ExtInfo["oname"] = _name;
  90. ext.ExtInfo["oidno"] = _idCard;
  91. }
  92. this.OwnerContainer.ModalInvoke(new Action(() =>
  93. {
  94. resp = AICapacity.GetInstence().AIRequest2Universal("PhoneVerification"
  95. , new Dictionary<string, object>
  96. {
  97. {"IdCard",_idCard},
  98. {"Name",_name},
  99. {"Phone",_phone},
  100. }, ext);
  101. }), "正在手机号三要素核验中...");
  102. if (resp == null)
  103. {
  104. this.TradeAPIs.ShowErrorMessageBox("调用失败,请检查网络并重试!");
  105. return;
  106. }
  107. if (resp.HasError)
  108. {
  109. hdjg.Text = resp.ErrorMsg;
  110. yys.Text = string.Empty;
  111. }
  112. else
  113. {
  114. var dict = resp.Value("data.result.responseJson", new Dictionary<string, string> { });
  115. Result = dict["Result"] == "0";
  116. hdjg.Text = dict["Description"];
  117. yys.Text = dict["Isp"];
  118. }
  119. }
  120. public bool Result { get; private set; }
  121. private void isBr_LostFocus(object sender, RoutedEventArgs e)
  122. {
  123. if (isBr.GetSelectedValue() == "0")
  124. {
  125. bz.Visibility = tbbz.Visibility = tbhzxm.Visibility = hzxm.Visibility = tbhzsfzh.Visibility = hzsfzh.Visibility = Visibility.Visible;
  126. xxinfo.Height = 150;
  127. }
  128. else
  129. {
  130. bz.Visibility = tbbz.Visibility = tbhzxm.Visibility = hzxm.Visibility = tbhzsfzh.Visibility = hzsfzh.Visibility = Visibility.Collapsed;
  131. xxinfo.Height = 90;
  132. }
  133. }
  134. }
  135. }