using System;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.IO;
using System.Text.RegularExpressions;
using Platform.Controls.ControlsHelper;
using Platform.Library;
using TellerSystem.Communication;
using TellerSystem.Library.Ext.Function;
using Platform.Common.RunningParameters;
using TellerSystem.ServiceProxy.Ext.ServiceEntitys;
using TellerSystem.Devices.Interface;
using TellerSystem.Library.Ext.Variables;
using TellerSystem.Controls.Ext.PrintsHelper;
using TellerSystem.Library.Ext.TradeExtension;
using TellerSystem.PrintTemplate.Extension;
using System.Windows.Controls;
using System.Printing;
using Platform.Print;
using TellerSystem.ServiceProxy.Ext.ServiceHelper;
using System.Collections.Generic;
using System.Drawing;
using System.ComponentModel;
using TellerSystem.ServiceProxy.Ext;
using TellerSystem.Controls.Ext.ControlsHelper;
using System.Diagnostics;
using System.Text;
using TellerSystem.ServiceProxy.Ext.WebAPI.Auth.Entity;
using System.Net;
using System.Net.Cache;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using TellerSystem.Contract.Function;
/******************************平台Dll*****************************/
namespace TellerSystem.Controls.Ext.Controls
{
///
/// PhoneElement.xaml 的交互逻辑
///
public partial class MobilePhoneCheckViewer
{
#region Ctor
public MobilePhoneCheckViewer(string idno, string name, string phone)
{
_idCard = idno;
_name = name;
_phone = phone;
InitializeComponent();
Result = false;
}
private string _idCard;
private string _name;
private string _phone;
private void TradePage_Loaded(object sender, RoutedEventArgs e)
{
/* 初始化界面逻辑,页面加载后执行*/
zikrxm.Text = _name;
zikrsjh.Text = _phone;
zikrsfzh.Text = _idCard;
isBr.SetItems(new Dictionary { { "是", "1" }, { "否", "0" } });
xxinfo.Height = 90;
Window.GetWindow(this).Closing += (s1, e1) =>
{
e1.Cancel = !Result && this.TradeAPIs.ShowQuestionMessageBox("当前手机号码三要素查验未完成,确认继续业务?") != MessageBoxResult.Yes;
};
}
#endregion
private void btnBack_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
private void btnCheck_Click(object sender, RoutedEventArgs e)
{
AICapacity.Resp resp = null;
AICapacity.ExtData ext = new AICapacity.ExtData(this.CreateSerialNumber(), new Dictionary
{
{"idno",_idCard},
{"name",_name},
{"phone",_phone},
{"self","是"},
});
if (isBr.GetSelectedKey() == "否")
{
_name = hzxm.Text;
_idCard = hzsfzh.Text;
ext.ExtInfo["self"] = "否";
ext.ExtInfo["other"] = bz.Text;
ext.ExtInfo["oname"] = _name;
ext.ExtInfo["oidno"] = _idCard;
}
this.OwnerContainer.ModalInvoke(new Action(() =>
{
resp = AICapacity.GetInstence().AIRequest2Universal("PhoneVerification"
, new Dictionary
{
{"IdCard",_idCard},
{"Name",_name},
{"Phone",_phone},
}, ext);
}), "正在手机号三要素核验中...");
if (resp == null)
{
this.TradeAPIs.ShowErrorMessageBox("调用失败,请检查网络并重试!");
return;
}
if (resp.HasError)
{
hdjg.Text = resp.ErrorMsg;
yys.Text = string.Empty;
}
else
{
var dict = resp.Value("data.result.responseJson", new Dictionary { });
Result = dict["Result"] == "0";
hdjg.Text = dict["Description"];
yys.Text = dict["Isp"];
}
}
public bool Result { get; private set; }
private void isBr_LostFocus(object sender, RoutedEventArgs e)
{
if (isBr.GetSelectedValue() == "0")
{
bz.Visibility = tbbz.Visibility = tbhzxm.Visibility = hzxm.Visibility = tbhzsfzh.Visibility = hzsfzh.Visibility = Visibility.Visible;
xxinfo.Height = 150;
}
else
{
bz.Visibility = tbbz.Visibility = tbhzxm.Visibility = hzxm.Visibility = tbhzsfzh.Visibility = hzsfzh.Visibility = Visibility.Collapsed;
xxinfo.Height = 90;
}
}
}
}