| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783 |
- using System.Windows;
- using GalaSoft.MvvmLight;
- using GalaSoft.MvvmLight.Command;
- using GalaSoft.MvvmLight.Ioc;
- using Muchinfo.MTPClient.Bank.Views;
- using Muchinfo.MTPClient.CustomException;
- using Muchinfo.MTPClient.Data;
- using Muchinfo.MTPClient.Data.Enums;
- using Muchinfo.MTPClient.Data.Extensions;
- using Muchinfo.MTPClient.Data.Model.Account;
- using Muchinfo.MTPClient.Data.Model.Bank;
- using Muchinfo.MTPClient.Infrastructure.Helpers;
- using Muchinfo.MTPClient.Infrastructure.MessageBox;
- using Muchinfo.MTPClient.Infrastructure.Utilities;
- using Muchinfo.MTPClient.IService;
- using Muchinfo.MTPClient.Resources;
- using Muchinfo.PC.Common.Extensions;
- using Muchinfo.PC.Common.Helpers;
- using Muchinfo.WPF.Controls.Windows;
- using System;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.Linq;
- using System.Threading.Tasks;
- namespace Muchinfo.MTPClient.Bank.ViewModels
- {
- public class BankTerminationViewModel : IdentifyCodeTimerViewModel
- {
- #region 变量成员
- private IBankService _bankService;
- private BankTerminationView _view;
-
- private EncryptKey _encryptKey;
- private AreaAccount _areaAccount; //会员账号信息
- private bool _isBusy;
- /// <summary>
- /// 是否忙,显示等待控件
- /// </summary>
- public bool IsBusy
- {
- get { return _isBusy; }
- set { Set(() => IsBusy, ref _isBusy, value); }
- }
- private string _busyContent;
- public string BusyContent
- {
- get { return _busyContent; }
- set { Set(() => BusyContent, ref _busyContent, value); }
- }
- ///<summary>
- ///证件类型
- ///</summary>
- public Dictionary<eCardType, string> ClientCardTypes
- {
- get
- {
- //var types = new Dictionary<ClientCardType, string> { { ClientCardType.Id, ClientCardType.Id.Discription() }, { ClientCardType.Driver, ClientCardType.Driver.Discription() } };
- //return types;
- return EnumExtensions.ToDictionary<eCardType>();
- }
- }
- //private List<SigningBank> _cusBankList = new List<SigningBank>();
- ///// <summary>
- ///// 签约的托管银行
- ///// </summary>
- //public List<SigningBank> CusBankList
- //{
- // get { return _cusBankList; }
- // set { Set(() => CusBankList, ref _cusBankList, value); }
- //}
- //private SigningBank _currentCusBank;
- ///// <summary>
- ///// 当前选中的托管银行
- ///// </summary>
- //public SigningBank CurrentCusBank
- //{
- // get { return _currentCusBank; }
- // set
- // {
- // Set(() => CurrentCusBank, ref _currentCusBank, value);
- // if (value != null)
- // {
- // CurrentSigningBank = SignBankList.FirstOrDefault(m => m.CusBankID == value.CusBankID);
- // }
- // }
- //}
- private ObservableCollection<SigningBank> _signBankList;
- /// <summary>
- /// 客户签约银行列表
- /// </summary>
- public ObservableCollection<SigningBank> SignBankList
- {
- get { return _signBankList; }
- set { Set(() => SignBankList, ref _signBankList, value); }
- }
- private SigningBank _currentSigningBank;
- /// <summary>
- /// 当前选中签约银行
- /// </summary>
- public SigningBank CurrentSigningBank
- {
- get
- {
- return _currentSigningBank;
- }
- set
- {
- Set(() => CurrentSigningBank, ref _currentSigningBank, value);
- //银行Id获取银行支行列表
- //Dictionary<string, string> BankBranchDictionary = _bankService.GetBankBranchList(value.Id);
- //支行Id获取支行名称
- //BranchName = BankBranchDictionary[value.BranchId];
- CredentialTypeName = ClientCardTypes[value.CredentialType];
- SetCollapsed();
- // SetSignBankInfo();
- }
- }
- private string _credentialTypeName;
- /// <summary>
- /// 开户人证件类型名称
- /// </summary>
- public string CredentialTypeName
- {
- get
- {
- return _credentialTypeName;
- }
- set
- {
- Set(() => CredentialTypeName, ref _credentialTypeName, value);
- }
- }
- private string _branchName;
- /// <summary>
- /// 开户银行支行名称
- /// </summary>
- public string BranchName
- {
- get
- {
- return _branchName;
- }
- set
- {
- Set(() => BranchName, ref _branchName, value);
- }
- }
- /// <summary>
- /// 建行三方提示
- /// </summary>
- private bool _branchMessage = false;
- /// <summary>
- /// 建行三方提示
- /// </summary>
- public bool BranchMessage
- {
- get
- {
- return _branchMessage;
- }
- set
- {
- Set(() => BranchMessage, ref _branchMessage, value);
- }
- }
- /// <summary>
- /// 网银签约解约提示
- /// </summary>
- private bool _netMessage = false;
- /// <summary>
- /// 网银签约解约提示
- /// </summary>
- public bool NetMessage
- {
- get
- {
- return _netMessage;
- }
- set
- {
- Set(() => NetMessage, ref _netMessage, value);
- }
- }
- private string _netWorkSignTips;
- /// <summary>
- /// 网银端提示
- /// </summary>
- public string NetWorkSignTips
- {
- get { return _netWorkSignTips; }
- set
- {
- Set(() => NetWorkSignTips, ref _netWorkSignTips, value);
- }
- }
-
- /// <summary>
- /// 是否可点确定
- /// </summary>
- private bool _isOKEnable = true;
- /// <summary>
- /// 是否可点确定
- /// </summary>
- public bool IsOKEnable
- {
- get
- {
- return _isOKEnable;
- }
- set
- {
- Set(() => IsOKEnable, ref _isOKEnable, value);
- }
- }
- /// <summary>
- ///银行列表
- /// </summary>
- List<Banks> AccoumtBankSignList;
- #endregion
- #region 构造函数
- public BankTerminationViewModel(BankTerminationView bankTerminationView)
- {
- _view = bankTerminationView;
- IsBusy = true;
- temp_ankDealStatus = null;
- BusyContent = Muchinfo.MTPClient.Resources.Client_Resource.Bank_GetBankInfo_Waiting;
- _bankService = SimpleIoc.Default.GetInstance<IBankService>();
- // _bankService.QueryBankInfo(QueryBankInfoCallback, ErrorCallback);
- //todo: QueryBankCustomerSign 未返回CusBankName 先查询QueryCusBankInfo返回匹配该字段
- // SignBankList =
- //_bankService.QueryBankCustomerSign(QueryBankCustomerSignCallback, ErrorCallback);
- var accountid = UserManager.CurrentTradeAccount.AccountId;
- //if (UserManager.CurrentTradeAccount.FundsAccounts != null && UserManager.CurrentTradeAccount.FundsAccounts.Any())
- //{
- // accountid = UserManager.CurrentTradeAccount.FundsAccounts[0].AccountId;
- //}
- _bankService.QueryBankCustomerSignInfo(accountid, SearchBankCustomerSignCallback, ErrorCallback);
- }
-
- /// <summary>
- /// 查询签约信息回应
- /// </summary>
- /// <param name="list"></param>
- private void SearchBankCustomerSignCallback(List<SigningBank> list)
- {
- IsBusy = false;
- if (ApplicationParameter.NewBankPlatform == 1) ////新银行平台
- {
- SignBankList = new ObservableCollection<SigningBank>(list);
- }
- else
- {
- SignBankList = new ObservableCollection<SigningBank>(list.Where((item) => item.ShowCancelSign == 0 && item.SignStatusType == SignStatus.SignStatus_Signed));
- }
- System.Windows.Application.Current.Dispatcher.BeginInvoke(new Action(() =>
- {
- if (SignBankList == null || SignBankList.Count <= 0)
- {
- MessageBoxHelper.ShowInfo(Muchinfo.MTPClient.Resources.Client_Resource.Bank_NoSignWithBank, Muchinfo.MTPClient.Resources.Client_Resource.Bank_BankTerminationTips);
- // bankTerminationView.Close();
- _view.Close();
- return;
- }
- CurrentSigningBank = SignBankList.FirstOrDefault();
- }));
- }
- private void QueryBankCustomerSignCallback(ObservableCollection<SigningBank> list)
- {
- IsBusy = false;
- SignBankList = new ObservableCollection<SigningBank>(list.Where((item) => item.ShowCancelSign == 0 && item.SignStatusType==SignStatus.SignStatus_Signed));
- System.Windows.Application.Current.Dispatcher.BeginInvoke(new Action(() =>
- {
- if (SignBankList == null || SignBankList.Count <= 0)
- {
- MessageBoxHelper.ShowInfo(Muchinfo.MTPClient.Resources.Client_Resource.Bank_NoSignWithBank, Muchinfo.MTPClient.Resources.Client_Resource.Bank_BankTerminationTips);
- // bankTerminationView.Close();
- _view.Close();
- return;
- }
- if (null != AccoumtBankSignList && AccoumtBankSignList.Any())
- {
- foreach (var item in SignBankList)
- {
- foreach (var k in AccoumtBankSignList)
- {
- if (item.BankId == k.BankId)
- {
- item.Name = k.BankName;
- // item.AccountName = UserManager.CurrentTradeAccount.CustomerName;
- }
- if (item.BranchId == k.BankId)
- {
- item.BranchBankName = k.BankName;
- }
- }
- }
- }
- CurrentSigningBank = SignBankList.FirstOrDefault();
- }));
- }
- #endregion
- public RelayCommand<BankTerminationView> OkCommand
- {
- get
- {
- temp_ankDealStatus = null;
- return new RelayCommand<BankTerminationView>((win_BankTerminationView) =>
- {
- if (CurrentSigningBank == null)
- {
- return;
- }
- var BandIDList = ApplicationParameter.CusBankNetSign.Split(',');
- if (this.CurrentSigningBank.CusBankID == 2)
- {
- MessageBoxHelper.ShowInfo(
- Muchinfo.MTPClient.Resources.Client_Resource.Bank_Termination_Message,
- Muchinfo.MTPClient.Resources.Client_Resource.APP_Tips);
- return;
- }
- else if (BandIDList.Contains(CurrentSigningBank.CusBankID + string.Empty))
- {
- MessageBoxHelper.ShowInfo(
- ApplicationParameter.CusBankNetSignTipsInfo,
- Muchinfo.MTPClient.Resources.Client_Resource.APP_Tips);
- }
- win_BankTerminationView.bnt_OK.IsEnabled = false;
- IsBusy = true;
- BusyContent = Muchinfo.MTPClient.Resources.Client_Resource.Bank_SubmitingTerminData_Wait;
- CurrentSigningBank.CurrentTime = ApplicationParameter.ServerTimeNow;
- CurrentSigningBank.ExtOperatorID = UserManager.CurrentTradeAccount.AccountId;
- //CurrentSigningBank.AccountCode = UserManager.CurrentTradeAccount.AccountCode;
- //CurrentSigningBank.CustomerName = UserManager.CurrentTradeAccount.CustomerName;
- CurrentSigningBank.AccountType = UserManager.CurrentTradeAccount.AccountType;
- //if (UserManager.CurrentTradeAccount.AccountType == eLoginUserType.LOGINUSERTYPE_TRADER &&
- // _areaAccount != null)
- //{
- //CurrentSigningBank.AccountCode = CurrentSigningBank.AccountCode;
- //CurrentSigningBank.CustomerName = CurrentSigningBank.CustomerName;
- // }
- _bankService.BankCaneclSign(CurrentSigningBank, BankCaneclSignCallback, ErrorCallback);
- });
- }
- }
- /// <summary>
- /// 取消
- /// </summary>
- public RelayCommand<BankTerminationView> CancelCommand
- {
- get
- {
- temp_ankDealStatus = null;
- return new RelayCommand<BankTerminationView>((win_BankTerminationView) =>
- {
- win_BankTerminationView.Close();
- });
- }
- }
-
- /// <summary>
- /// 获取手机验证码
- /// </summary>
- public RelayCommand IdentifyCodeCommand
- {
- get
- {
- return new RelayCommand(() =>
- {
- if (CurrentSigningBank == null)
- {
- return;
- }
- var IndentityReq = new IdentifyCodeReq()
- {
- AccountCode = CurrentSigningBank.AccountCode,
- CusBankID = CurrentSigningBank.CusBankID + string.Empty,
-
- CustomerSignId = CurrentSigningBank.CustomerSignId,
- CustomerName = CurrentSigningBank.CustomerName,
- BankCode = CurrentSigningBank.BankId,
- AccountType = CurrentSigningBank.AccountType,
- BankAccountNo = CurrentSigningBank.BankAccount,
- CardNum = CurrentSigningBank.CredentialNumber,
- CardType = CurrentSigningBank.CredentialType,
- MobilePhone = CurrentSigningBank.MobilePhone,
- Currency = (UserManager.CurrentTradeAccount.FundsAccounts == null || !UserManager.CurrentTradeAccount.FundsAccounts.Any())
- ? "RMB" : UserManager.CurrentTradeAccount.FundsAccounts[0].Currency,
- };
-
- _bankService.BankGetIdentifyCode(IndentityReq, QueryIdentifyCodeSuccess, null);
- });
- }
- }
- public void QueryIdentifyCodeSuccess(bool success)
- {
- }
- private string _identifyCode;
- public string IdentifyCode
- {
- get { return _identifyCode; }
- set { Set(() => IdentifyCode, ref _identifyCode, value); }
- }
-
- private void SetCollapsed()
- {
- this.CurrentSigningBank.PaymentNumberVisibility = false;
- this.CurrentSigningBank.ProtocolNumberVisibility = false;
- //this.CurrentSigningBank.CertIDVisibility = false;
- //this.CurrentSigningBank.BankVisibility = false;
- //this.CurrentSigningBank.BranchVisibility = false;
- //this.CurrentSigningBank.BankBankAccountNoVisibility = false;
- //this.CurrentSigningBank.AccountNameVisibility = false;
- this.CurrentSigningBank.AgentNameVisibility = false;
- this.CurrentSigningBank.AgentCIDNumberVisibility = false;
- this.CurrentSigningBank.BankPasswordVisibility = false;
- this.CurrentSigningBank.DrawIdentifyCodeVisibility = false;
- if (!string.IsNullOrEmpty(CurrentSigningBank.CancleSignShowField))
- {
- bool isMemberTrade = UserManager.CurrentTradeAccount.AccountType !=
- eUserType.USERTYPE_INVESTOR;
- //根据当前所选签约银行,配置输入字段
- string[] CancleSignShowField = this.CurrentSigningBank.CancleSignShowField.Split(',');
- foreach (string item in CancleSignShowField)
- {
- switch (int.Parse(item))
- {
- case (int)ShowFieldStatus.ShowField_PaymentNo:
- this.CurrentSigningBank.PaymentNumberVisibility = true;
- break;
- case (int)ShowFieldStatus.ShowField_ProtocolNo:
- this.CurrentSigningBank.ProtocolNumberVisibility = true;
- break;
- case (int)ShowFieldStatus.ShowField_AgentCertID:
- this.CurrentSigningBank.AgentCIDNumberVisibility = isMemberTrade;
- break;
- case (int)ShowFieldStatus.ShowField_AgentName:
- this.CurrentSigningBank.AgentNameVisibility = isMemberTrade;
- break;
- case (int)ShowFieldStatus.ShowField_BankAccountPWD:
- this.CurrentSigningBank.BankPasswordVisibility = true;
- //todo获取银行密钥
- if (_encryptKey == null)
- {
- Task.Factory.TryStartNew(() =>
- {
- IsBusy = true;
- var reqkey = new EncryptKeyRequest()
- {
- Currency = (UserManager.CurrentTradeAccount.FundsAccounts == null || !UserManager.CurrentTradeAccount.FundsAccounts.Any())
- ? "RMB" : UserManager.CurrentTradeAccount.FundsAccounts[0].Currency,
- CusBankId = CurrentSigningBank.CusBankID+string.Empty
- };
- // _encryptKey =
- _bankService.QueryEncryptKey(reqkey, QueryEncryptKeyCallback_ShowField_BankAccountPWD, ErrorCallback);
- }, () => IsBusy = false);
- }
- break;
- case (int)ShowFieldStatus.ShowField_Draw_IdentifyCode:
- this.CurrentSigningBank.DrawIdentifyCodeVisibility = true;
- //todo获取银行密钥
- if (_encryptKey == null)
- {
- Task.Factory.TryStartNew(() =>
- {
- IsBusy = true;
- var reqkeyIC = new EncryptKeyRequest()
- {
- Currency = (UserManager.CurrentTradeAccount.FundsAccounts == null || !UserManager.CurrentTradeAccount.FundsAccounts.Any())
- ? "RMB" : UserManager.CurrentTradeAccount.FundsAccounts[0].Currency,
- CusBankId = CurrentSigningBank.CusBankID+string.Empty
- };
- //_encryptKey =
- _bankService.QueryEncryptKey(reqkeyIC, QueryEncryptKeyCallback_ShowField_Draw_IdentifyCode, ErrorCallback);
- }, () => IsBusy = false);
- }
- break;
- }
- }
- }
- var BandIDList = ApplicationParameter.CusBankNetSign.Split(',');
- if (CurrentSigningBank.CusBankID == 2 )
- {
- this.BranchMessage = true;
- IsOKEnable = false;
- }
- else if (BandIDList.Contains(CurrentSigningBank.CusBankID + string.Empty))
- {
- this.NetMessage = true;
- this.NetWorkSignTips = ApplicationParameter.CusBankNetSignTipsInfo;
- IsOKEnable = false;
- }
- else
- {
- // this.BranchMessage = true;
- IsOKEnable = true;
- }
- }
- private void SetSignBankInfo()
- {
- IsBusy = true;
- BusyContent = Muchinfo.MTPClient.Resources.Client_Resource.Bank_GetBankInfomation_waiting;
- System.Threading.Tasks.Task.Factory.TryStartNew(
- () => System.Windows.Application.Current.Dispatcher.BeginInvoke(new Action(() =>
- {
- // SigningBank configInfo =
- // _bankService.QueryBankParamConfig(CurrentSigningBank.CusBankID, QueryBankparamConfigCallback, ErrorCallback);
- })), () => IsBusy = false);
- }
-
- private void QueryEncryptKeyCallback_ShowField_Draw_IdentifyCode(EncryptKey encryptKey)
- {
- if (String.IsNullOrEmpty(_encryptKey.SecretKey))
- {
- MessageBoxHelper.ShowQuestion(Muchinfo.MTPClient.Resources.Client_Resource.Bank_NoGetIncryption, Muchinfo.MTPClient.Resources.Client_Resource.Bank_Error);
- }
- }
- private void QueryEncryptKeyCallback_ShowField_BankAccountPWD(EncryptKey encryptKey)
- {
- if (String.IsNullOrEmpty(_encryptKey.SecretKey))
- {
- MessageBoxHelper.ShowQuestion(Muchinfo.MTPClient.Resources.Client_Resource.Bank_NoGetIncryption, Muchinfo.MTPClient.Resources.Client_Resource.Bank_Error);
- }
- }
- /// <summary>
- /// 临时结果
- /// </summary>
- private BankSignResult temp_ankDealStatus;
- public void BankCaneclSignCallback(BankSignResult bankDealStatus)
- {
- IsBusy = false;
- //一般情况银行电话密码和银行取款密码只需要一个
- bool isSendBankKey = (CurrentSigningBank.BankPasswordVisibility || CurrentSigningBank.DrawIdentifyCodeVisibility);
- temp_ankDealStatus = bankDealStatus;
- if (isSendBankKey && bankDealStatus.ReturnCode == 0)
- {
- var encryptHelper = new TasEncryptHelper();
- if (_encryptKey == null)
- {
- var reqkey = new EncryptKeyRequest()
- {
- Currency =
- (UserManager.CurrentTradeAccount.FundsAccounts == null ||
- !UserManager.CurrentTradeAccount.FundsAccounts.Any())
- ? "RMB"
- : UserManager.CurrentTradeAccount.FundsAccounts[0].Currency,
- CusBankId = CurrentSigningBank.CusBankID+string.Empty
- };
- // _encryptKey =
- _bankService.QueryEncryptKey(reqkey, QueryEncryptKeyCallback, ErrorCallback);
- }
- else
- {
- string encryptPwd = "";
- if (CurrentSigningBank.BankPasswordVisibility)
- {
- encryptPwd = encryptHelper.EncryptPassd(_encryptKey.SecretKey,
- CurrentSigningBank.BankPassword);
- }
- else if (CurrentSigningBank.DrawIdentifyCodeVisibility)
- {
- encryptPwd = encryptHelper.EncryptPassd(_encryptKey.SecretKey,
- CurrentSigningBank.DrawIdentifyCode);
- }
- var req = new SignBankPDW()
- {
- AccountCode = UserManager.CurrentTradeAccount.AccountCode,
- ExchTicket = bankDealStatus.ExchTicket,
- ExtOperatorID = bankDealStatus.ExtOperatorID,
- CusBankId = CurrentSigningBank.CusBankID + string.Empty,
- BankAccountPWD = encryptPwd,
- Currency =
- (UserManager.CurrentTradeAccount.FundsAccounts == null ||
- !UserManager.CurrentTradeAccount.FundsAccounts.Any())
- ? "RMB"
- : UserManager.CurrentTradeAccount.FundsAccounts[0].Currency
- };
- //errorCode =_bankService.SignBankPwd(req, UserManager.CurrentTradeAccount.LoginCode);
- _bankService.SignBankPwd(req, SignBankPwdCallback, ErrorCallback);
- }
- }
- SignBankPwdCallback(bankDealStatus.ReturnCode);
- }
- private void SignBankPwdCallback(int result)
- {
- var bankDealStatus = temp_ankDealStatus;
- bool isSendBankKey = (CurrentSigningBank.BankPasswordVisibility || CurrentSigningBank.DrawIdentifyCodeVisibility);
- System.Windows.Application.Current.Dispatcher.BeginInvoke(new Action(() =>
- {
- if (result == 0)
- {
- if (isSendBankKey)
- {
- MessageBoxHelper.ShowSuccess(
- Muchinfo.MTPClient.Resources.Client_Resource.Bank_TerminationSuccess,
- Muchinfo.MTPClient.Resources.Client_Resource.Bank_BankTerminationTips);
- if (bankDealStatus.Status == BankDealStatus.BankDealStatus__BankWebComfirm)
- {
- IPHelper.OpenWebAddress(bankDealStatus.WebAddress);
- var messageBox = new MsgAlter(bankDealStatus.WebAddress, Client_Resource.Tips_BankUnSignWebComfrim)
- {
- Owner = Application.Current.MainWindow,
- WindowStartupLocation = WindowStartupLocation.CenterOwner
- };
- messageBox.ShowDialog();
- }
- }
- else
- {
- // LogManager.WriteBankApplyLog(1, CurrentSigningBank, UserManager.CurrentTradeAccount);
- switch (bankDealStatus.Status)
- {
- case BankDealStatus.BankDealStatus__Succeed:
- MessageBoxHelper.ShowSuccess(
- Muchinfo.MTPClient.Resources.Client_Resource
- .Bank_TerminationSuccess,
- Muchinfo.MTPClient.Resources.Client_Resource
- .Bank_BankTerminationTips);
- break;
- case BankDealStatus.BankDealStatus__Pend:
- MessageBoxHelper.ShowSuccess(
- Muchinfo.MTPClient.Resources.Client_Resource
- .Bank_BankTerminationInfoSubmit_Wait,
- Muchinfo.MTPClient.Resources.Client_Resource
- .Bank_BankTerminationTips);
- break;
- case BankDealStatus.BankDealStatus__BankWebComfirm:
- try
- {
- IPHelper.OpenWebAddress(bankDealStatus.WebAddress);
- }
- catch (Exception)
- {
- throw new MuchinfoException(ExceptionManager.OpenIEError);
- }
- finally
- {
- var messageBox = new MsgAlter(bankDealStatus.WebAddress, Client_Resource.Tips_BankUnSignWebComfrim)
- {
- Owner = Application.Current.MainWindow,
- WindowStartupLocation = WindowStartupLocation.CenterOwner
- };
- messageBox.ShowDialog();
- }
- break;
- }
- }
- // win_BankTerminationView.DialogResult = true;
- _view.DialogResult = true;
- }
- else
- {
- ErrorManager.ShowReturnError(bankDealStatus.ReturnCode, Muchinfo.MTPClient.Resources.Client_Resource.Bank_ErrotTips);
- }
- //win_BankTerminationView.bnt_OK.IsEnabled = true;
- _view.bnt_OK.IsEnabled = true;
- }));
- }
- private void QueryEncryptKeyCallback(EncryptKey encryptKey)
- {
- var encryptHelper = new TasEncryptHelper();
- var bankDealStatus = temp_ankDealStatus;
- string encryptPwd = "";
- if (CurrentSigningBank.BankPasswordVisibility)
- {
- encryptPwd = encryptHelper.EncryptPassd(_encryptKey.SecretKey,
- CurrentSigningBank.BankPassword);
- }
- else if (CurrentSigningBank.DrawIdentifyCodeVisibility)
- {
- encryptPwd = encryptHelper.EncryptPassd(_encryptKey.SecretKey,
- CurrentSigningBank.DrawIdentifyCode);
- }
- var req = new SignBankPDW()
- {
- AccountCode = UserManager.CurrentTradeAccount.AccountCode,
- ExchTicket = bankDealStatus.ExchTicket,
- ExtOperatorID = bankDealStatus.ExtOperatorID,
- CusBankId = CurrentSigningBank.CusBankID + string.Empty,
- BankAccountPWD = encryptPwd,
- Currency =
- (UserManager.CurrentTradeAccount.FundsAccounts == null ||
- !UserManager.CurrentTradeAccount.FundsAccounts.Any())
- ? "RMB"
- : UserManager.CurrentTradeAccount.FundsAccounts[0].Currency
- };
- //errorCode =_bankService.SignBankPwd(req, UserManager.CurrentTradeAccount.LoginCode);
- _bankService.SignBankPwd(req, SignBankPwdCallback, ErrorCallback);
- SignBankPwdCallback(bankDealStatus.ReturnCode);
- }
- public void ErrorCallback(ErrorEntity error)
- {
- IsBusy = false;
- System.Windows.Application.Current.Dispatcher.BeginInvoke(new Action(() =>
- {
- ErrorManager.ShowReturnError(error, Muchinfo.MTPClient.Resources.Client_Resource.Bank_Error, true);
- }));
- }
- }
- }
|