/// <summary> /// 添加未交费记录 /// </summary> public override void OKExecute() { //IsSearch = true; //判断是否查询并且正确 if (!IsSearch) { VMHelp.ShowMessage("未进行缴款凭证编号的查询,不可提交", false); return; } FundPayment temp = new FundPayment(); temp.BusinessCode = FinancialRegulation.Tools.PublicData.QueryFundPay; temp.PaymentID = SearchInfo.PaymentNum; // temp.BusinessCode = CurrentObj.BusinessCode; temp.PaymentAmount = CurrentObj.PaymentAmount; temp.ReceiverAccount = CurrentObj.ReceiverAccount; temp.ReceiverName = CurrentObj.ReceiverName; temp.ReceiveBank = CurrentObj.ReceiverBankName; temp.PayAccount = CurrentObj.PayerAccount; temp.PayName = CurrentObj.PayerName; temp.PaymentBank = CurrentObj.PayBank; temp.ProjectCode = CurrentObj.ProjectID; // temp.DepositTime = DateTime.Parse(VMHelp.NowTime); temp.PaymentConfirmTime = DateTime.Parse(VMHelp.NowTime); temp.PayState = Tools.PublicData.PayB; temp.BankSiteID = VMHelp.PointCode; temp.BankTellerID = VMHelp.UserCode; temp.PayID = VMHelp.GUID; deClient.Add(temp); OBModels.Add(temp); windowOK(); }
/// <summary> /// 缴存信息查询命令 /// </summary> public void SearchExecute() { try { CheckHelper.NotNullCheck(SearchInfo.PaymentNum, "缴款凭证编号"); SearchInfo.BankCode = VMHelp.BankCode; SearchInfo.BusinessCode = FinancialRegulation.Tools.PublicData.QueryFundPay; response = SendMessage <Message.NewMessage.Response.Response04>(SearchInfo, VMHelp.PointCode, VMHelp.UserCode); if (response != null && response.ReturnCode == FinancialRegulation.Tools.PublicData.ResponseSuccess) { CurrentObj = null; CurrentObj = response; // SpvModel = SpvModel; IsSearch = true;//查询成功 VMHelp.ShowMessage(true); } else { //VMHelp.ShowMessage("查询失败!", false); VMHelp.ShowMessage(Tools.HelpClass.Current.MsgDIC[response.ReturnCode], false); } } catch (CheckException ex)//检查异常 { VMHelp.ShowMessage(ex.Message, false); } catch (Exception ex) { SendExcetpion(ex); } }
/// <summary> /// 发送错误信息 /// </summary> /// <param name="ex">错误信息</param> public void SendExcetpion(Exception ex) { try { Common.Logger lg = new Common.Logger(); lg.LogWrite(Common.Logger.LogLevel.Debug, "", ex.ToString()); string errorID = VMHelp.GetErrorSerialNo; VMHelp.ShowMessage(string.Format("抱歉,系统发生错误,请及时与系统管理员进行联系!\n错误信息:{0}\n", ex.Message), false); //note:2013年11月12日15:49:05 显示编号不好看改掉显示错误信息了. //VMHelp.ShowMessage(string.Format("抱歉,系统发生错误,请及时与系统管理员进行联系!\n错误信息:{0}\n", errorID), false); //Message.Message199 msg = new Message.Message199(); //msg.ErrorCode = errorID; //msg.BankCode = VMHelp.BankCode; //msg.PointCode = VMHelp.PointCode; //msg.BusinessCode = "199"; //msg.BusinessTime = VMHelp.NowTime; //msg.ErrorMsg = ex.Message + "\n" + ex.StackTrace; //BGworker.RunWorkerAsync(msg); //BGworker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bgw_RunWorkerCompleted); } catch { //TODO: 发送错误: 发送错误失败应该记录日志 // throw error; //如果在发送过程中出现错误则直接抛出 } }
/// <summary> /// 生成bat文件 /// </summary> private void ProduceFileExecute() { if (this.Models == null) { VMHelp.ShowMessage("对账信息为空", false); return; } if (!VMHelp.AskMessage("是否生成对账文件?")) { return; } List <string> txtInfo = new List <string>(); foreach (UnknowBill item in this.Models) { string info = item.UB_FirmName.PadRight(100, ' ') + "|" + item.UB_ManageAccount.PadRight(30, ' ') + "|" + item.UB_Money.ToString().PadRight(18, ' ') + "|" + item.UB_Time.Value.ToString("yyyy/MM/dd").PadRight(10, ' ') + "|" + item.UB_PayerName.PadRight(100, ' ') + "|" + item.UB_PayerAccount.PadRight(30, ' '); txtInfo.Add(info); } if (txtInfo.Count > 0) { FileName = VMHelp.BankCode + DateTime.Now.ToString("yyyyMMdd") + ".sdat"; FilePath = AppDomain.CurrentDomain.BaseDirectory; if (billclient.ProduceBillFile(txtInfo, null, FileName)) { VMHelp.ShowMessage("生成成功", true); } else { VMHelp.ShowMessage("生成失败", false); } } }
/// <summary> /// 冲正方法 /// </summary> private void ReverseExecute() { if (CurModel.ID != null) { if (CurModel.DepositTime != null && CurModel.DepositTime.Value.ToShortDateString() != DateTime.Now.ToShortDateString()) { VMHelp.ShowMessage("只能冲正今日交易", false); return; } if (CurModel.DepositState == Tools.PublicData.DepositA) { ReverseTrade rt = new ReverseTrade(this.CurModel, this.Models); if ((bool)rt.ShowDialog()) { SearchExecute(); } } else { switch (CurModel.DepositState) { case Tools.PublicData.DepositB: VMHelp.ShowMessage("该款项未缴存", false); break; case Tools.PublicData.ReverseA: VMHelp.ShowMessage("该款项已冲正", false); break; case "已退票": VMHelp.ShowMessage("该款项已退票", false); break; default: return; } } } }
/// <summary> /// 添加未交费记录 /// </summary> public override void OKExecute() { // 判断是否查询并且正确 if (!IsSearch) { VMHelp.ShowMessage("未进行缴款凭证编号的查询,不可提交", false); return; } DepositFund temp = new DepositFund(); temp.BusinessCode = FinancialRegulation.Tools.PublicData.QueryFundDeposit; temp.DepositNum = SearchInfo.DepositID; temp.DepositAccount = CurrentObj.DepositAccount; //temp.FirmName = CurrentObj.FirmName; temp.DepositType = CurrentObj.DepositType; temp.DepositAmount = CurrentObj.DepositAmount; temp.PurchaserName = CurrentObj.PurchaserName; temp.PurchaserID = CurrentObj.PurchaserID; temp.ProjectCode = CurrentObj.ProjectCode; // temp.DepositTime = DateTime.Parse(VMHelp.NowTime); temp.CheckTime = DateTime.Parse(VMHelp.NowTime); temp.DepositState = Tools.PublicData.DepositB; temp.BankSiteID = VMHelp.PointCode; temp.BankTellerID = VMHelp.UserCode;//柜员号 temp.FirmName = CurrentObj.FirmName; temp.ID = VMHelp.GUID; if (!deClient.Add(temp)) { VMHelp.ShowMessage("信息存储失败", false); } OBModels.Add(temp); windowOK(); }
/// <summary> /// 生成bat文件 /// </summary> private void ProduceFileExecute() { if (this.Models == null) { VMHelp.ShowMessage("对账信息为空", false); return; } //if (!VMHelp.AskMessage("是否生成并上传对账文件?")) //{ // return; //} try { DateSelectWindowVm vm = new DateSelectWindowVm(); DateSelectWindow dsw = new DateSelectWindow(vm); if (!dsw.ShowDialog().Value) { return; } List <string> txtInfo = new List <string>(); ObservableCollection <InterestBillCheck> tempbill = new ObservableCollection <InterestBillCheck>(); foreach (InterestBillCheck item in this.Models) { if (item.Time.Value >= vm.DtBegin && item.Time.Value <= vm.DtEnd) { BillstrPad bp = new BillstrPad(item); string info = bp.BillPadRight(); txtInfo.Add(info); tempbill.Add(item); } } this.Models = tempbill; if (txtInfo.Count > 0) { FileName = VMHelp.BankCode + DateTime.Now.ToString("yyyyMMdd") + ".wdat"; FilePath = VMHelp.SYSCONFIG.BillFolder; if (client.ProduceBillFile(txtInfo, FilePath, FileName)) { VMHelp.ShowMessage("生成成功", true); } else { VMHelp.ShowMessage("生成失败", false); FileName = null; return; } // UpLoadFileExecute(); } else { VMHelp.ShowMessage("对账项数目为空", false); } } catch (Exception e) { SendExcetpion(e); } }
/// <summary> /// 发起对账 /// </summary> private void SendBillExecute() { if (FileName == null) { VMHelp.ShowMessage("文件未生成成功", false); return; } if (!client.UploadState) { VMHelp.ShowMessage("文件未上传成功", false); return; } Response07 response = new Response07(); Request07 request = new Request07(); request.BankCode = VMHelp.BankCode; request.FileName = FileName; request.BusinessCode = Tools.PublicData.InterestRecord; //ObservableCollection<SeasonInterest> temp = GetBalance();//获得平台余额 decimal PlatformBalance = 0; foreach (InterestBillCheck item in this.Models) { PlatformBalance += item.TradeFundAmount.Value; } request.PlatInterestAmount = PlatformBalance;//平台利息 BillCheckWindowVm vm = new BillCheckWindowVm(); BillCheckWindow bkwindow = new BillCheckWindow(vm); bkwindow.Tag = "利息对账"; if (!(bool)bkwindow.ShowDialog()) { return; } request.RecordCount = this.Models.Count; request.RealInterestAmount = vm.AccountBalance.Value;//实际利息 try { response = SendMessage <Response07>(request, VMHelp.PointCode, VMHelp.UserCode); } catch (Exception e) { System.Windows.MessageBox.Show(e.Message); return; } if (response.ReturnCode == Tools.PublicData.ResponseSuccess) { VMHelp.ShowMessage("对账成功", true); } else { ; VMHelp.ShowMessage(Tools.HelpClass.Current.MsgDIC[response.ReturnCode], false); } }
/// <summary> /// 发起对账 /// </summary> private void SendBillExecute() { if (FileName == null) { VMHelp.ShowMessage("文件未生成成功", false); return; } if (!billclient.UploadState) { VMHelp.ShowMessage("文件未上传成功", false); return; } Response09 response = new Response09(); Request09 request = new Request09(); request.BankCode = VMHelp.BankCode; request.FileName = FileName; request.BusinessCode = Tools.PublicData.UnknowBill; BillCheckWindowVm vm = new BillCheckWindowVm(); BillCheckWindow bkwindow = new BillCheckWindow(vm); bkwindow.Tag = "不明账款对账"; if (!(bool)bkwindow.ShowDialog()) { return; } request.Instruction = vm.BillInstruction; request.RecordCount = this.checklist.Count; decimal money = 0; foreach (UnknowBill item in checklist) { money = money + item.UB_Money.Value; } request.AllAmount = money; try { response = SendMessage <Response09>(request, VMHelp.PointCode, VMHelp.UserCode); } catch (Exception e) { System.Windows.MessageBox.Show(e.Message); return; } if (response.ReturnCode == Tools.PublicData.ResponseSuccess) { VMHelp.ShowMessage("对账成功", true); } else { VMHelp.ShowMessage("对账失败原因:", false); } }
/// <summary> /// 执行添加 /// </summary> public override void OKExecute() { try { if (!IsEdit) { if (Check() && VMHelp.AskMessage("确认要添加该网点?")) { CurrentObj.BR_ID = Guid.NewGuid().ToString(); CurrentObj.BR_State = Tools.PublicData.Branches_So; bool result = client.Add(CurrentObj); if (result) { VMHelp.ShowMessage("添加成功", true); windowClose(); } else { VMHelp.ShowMessage("添加失败", false); } } } else { if (Check() && VMHelp.AskMessage("确认要更新该网点?")) { if (client.Update(CurrentObj)) { VMHelp.ShowMessage("更新成功", true); windowClose(); } else { VMHelp.ShowMessage("更新失败", false); } } } } catch (Exception ex) { if (ex.Message.Contains("违反了 UNIQUE KEY 约束 'OnlyCode'")) { VMHelp.ShowMessage("更新失败,不能添加重复的网点编号", false); } else { throw ex; } } }
/// <summary> /// 根据凭证编号查询要退票的信息 /// </summary> public void SearchExecute() { if (CurrentObj.PaymentID != null) { foreach (FundsRegulatoryClient.RefunTradeSrv.RefundTrade item in this.Models) { if (item.PaymentID == CurrentObj.PaymentID) { VMHelp.ShowMessage("该凭证编号已退票", false); return; } } ObservableCollection <FundsRegulatoryClient.RefunTradeSrv.RefundTrade> temp = Client.Select(CurrentObj); if (temp.Count > 0) { if (temp[0].Bankwebsite != VMHelp.PointCode && VMHelp.PointCode != Tools.HelpClass.Current.MainWebSite) { VMHelp.ShowMessage("不能退票非本网点交易", false); return; } if (temp[0].RefundTime.Value.ToShortDateString() == DateTime.Now.ToShortDateString()) { if (!VMHelp.AskMessage("当日交易建议冲正,是否进行退票?")) { return; } } switch (temp[0].BussinessCode) { case Tools.PublicData.QueryFundDeposit: VMHelp.ShowMessage("该款项未缴存", false); return; case Tools.PublicData.QueryFundPay: VMHelp.ShowMessage("该款项未支付", false); return; case Tools.PublicData.ReverseFund: VMHelp.ShowMessage("该款项已冲正", false); return; default: break; } temp[0].PaymentID = CurrentObj.PaymentID; temp[0].RefundInstr = CurrentObj.RefundInstr; temp[0].BankSerialNum = CurrentObj.BankSerialNum; RefundType = temp[0].BussinessCode; CurrentObj = temp[0]; IsSearch = true; } else { VMHelp.ShowMessage("该凭证编号不存在", false); IsSearch = false; } } }
public override void DeleteExecute() { if (CurModel.UB_ID != null) { if (VMHelp.AskMessage("是否进行删除")) { if (client.DeleteUnKownJG_Deposit(CurModel)) { this.Models.Remove(CurModel); VMHelp.ShowMessage(true); } } } }
//TODO:在此定义命令和属性 #endregion #region 命令定义 //TODO:在此定义命令 #endregion #region 命令方法 public override void OKExecute() { if (Check() && VMHelp.AskMessage("确定要更改系统配置?")) { if (client.Update(CurrentObj)) { VMHelp.GETSYSTEMCONFIG(); VMHelp.ShowMessage("修改成功", true); } else { VMHelp.ShowMessage("数据更新失败,原因:1、数据库无法更新 2、文件路径错误", false); } } }
/// <summary> /// 执行OK载体 2013年10月28日11:44:58 与命令相连接做捕获异常用 /// </summary> public virtual void OKExecuteHost() { try { OKExecute(); } catch (CheckException ex) { VMHelp.ShowMessage(ex.Message, false); } catch (Exception ex) { SendExcetpion(ex); } }
public override void OKExecute() { try { if (IsSearch == null) { VMHelp.ShowMessage("未查询", false); return; } if (!(bool)IsSearch || !Check()) { return; } Request08 refundRequest = new Request08(); refundRequest.BusinessCode = Tools.PublicData.Refund; refundRequest.BankCode = VMHelp.BankCode; refundRequest.PaymentID = CurrentObj.PaymentID; refundRequest.RefundAmount = CurrentObj.RefundAmount; refundRequest.RefundInstr = CurrentObj.RefundInstr; response = SendMessage <Response08>(refundRequest, VMHelp.PointCode, VMHelp.UserCode); if (response.ReturnCode != Tools.PublicData.ResponseSuccess) { VMHelp.ShowMessage(Tools.HelpClass.Current.MsgDIC[response.ReturnCode], false); return; } //if (response.ReturnCode == Tools.PublicData.DepositSuccess && !VMHelp.AskMessage("付款凭证已经完成支付,是否存数据库?")) //{ // return; //} if (!DayBalanceAndRefundAndState()) { VMHelp.ShowMessage("操作失败,原因:" + "\r\n 1、数据库中无今日余额 \r\n 2、今日余额更新失败 \r\n 3、存款或支付表状态更新失败", false); return; } this.Models.Add(CurrentObj); VMHelp.ShowMessage(true); windowClose(); } catch (Exception e) { SendExcetpion(e); } }
/// <summary> /// 生成bat文件 /// </summary> private void ProduceFileExecute() { checklist.Clear(); foreach (UnknowBill item in client.SelectUnKownJG_Deposit(null)) { if (item.UB_State == "N") { checklist.Add(item); } } if (checklist == null) { VMHelp.ShowMessage("对账信息为空", false); return; } //if (!VMHelp.AskMessage("是否生成并上传对账文件?")) //{ // return; //} List <string> txtInfo = new List <string>(); foreach (UnknowBill item in checklist) { BillstrPad bp = new BillstrPad(item); string info = bp.BillPadRight(); txtInfo.Add(info); } if (txtInfo.Count > 0) { FileName = VMHelp.BankCode + DateTime.Now.ToString("yyyyMMdd") + ".sdat"; FilePath = VMHelp.SYSCONFIG.BillFolder; if (billclient.ProduceBillFile(txtInfo, FilePath, FileName)) { VMHelp.ShowMessage("生成成功", true); } else { VMHelp.ShowMessage("生成失败", false); FileName = null; return; } //UpLoadFileExecute(); } }
private void UpLoadFileExecute() { FundsRegulatoryClient.SysConfigSrv.SysConfigInfo ftp = FinancialRegulation.Tools.HelpClass.Current.SYSCONFIG; if (ftp.FtpIP == null) { VMHelp.ShowMessage("ftp地址不能为空", false); return; } if (ftp.FtpPwd == null || ftp.FtpUser == null) { VMHelp.ShowMessage("ftp账号或密码不能为空", false); return; } if (FileName == null) { VMHelp.ShowMessage("账单未生成", false); return; } //OpenFileDialog op = new OpenFileDialog(); //op.Filter = "dat(*.sdat)|*.sdat"; //if (FilePath != null) //{ // op.InitialDirectory = FilePath; //} //if (op.ShowDialog() == DialogResult.OK) //{ // if (!op.FileName.Contains( FileName)) // { // if (VMHelp.AskMessage("上传文件与生产文件不一致,是否仍上传?")) // { // FileName = op.FileName; // } // else { return; } // } if (billclient.UpLoadFile(FileName, FilePath, ftp.FtpIP, ftp.FtpUser, ftp.FtpPwd)) { VMHelp.ShowMessage(true); } else { VMHelp.ShowMessage("对账文件上传失败,ftp地址、账号、密码错误", false); // FileName = null; } //} }
/// <summary> /// 添加关联 /// </summary> private void AddLinkExecute() { ObservableCollection <UnKnowLinkModel> temp = new ObservableCollection <UnKnowLinkModel>(); UnKnowLinkModel umtemp = null;//= new UnKnowLinkModel(); foreach (UnKnowLinkModel item in LinkModel) { if (item.IsCheck) { if (umtemp == null) { umtemp = new UnKnowLinkModel(); umtemp = item; } else if (umtemp.DF.DepositType != item.DF.DepositType) { VMHelp.ShowMessage("所关联资金性质不一致", false); return; } } } foreach (UnKnowLinkModel item in LinkModel) { if (item.IsCheck) { if (LinkModel2.Count > 0) { if (LinkModel2[0].DF.DepositType != umtemp.DF.DepositType) { VMHelp.ShowMessage("所关联资金性质不一致", false); return; } } LinkModeltemp.Remove(item); item.IsCheck = false; LinkModel2.Add(item); } else { temp.Add(item); } } LinkModel = temp; }
public override void DeleteExecute() { if (CurModel.ID != null) { if (VMHelp.AskMessage("是否进行删除")) { if (CurModel.DepositState != Tools.PublicData.DepositB) { VMHelp.ShowMessage("只能删除未缴存信息", false); return; } if (client.Delete(CurModel)) { this.Models.Remove(CurModel); VMHelp.ShowMessage(true); } } } }
private void UpLoadFileExecute() { try { FundsRegulatoryClient.SysConfigSrv.SysConfigInfo ftp = FinancialRegulation.Tools.HelpClass.Current.SYSCONFIG; if (ftp.FtpIP == null) { VMHelp.ShowMessage("ftp地址不能为空", false); return; } if (ftp.FtpPwd == null || ftp.FtpUser == null) { VMHelp.ShowMessage("ftp账号或密码不能为空", false); return; } if (FileName == null) { VMHelp.ShowMessage("账单未生成", false); return; } //OpenFileDialog op = new OpenFileDialog(); //op.Filter = "dat(*.dat)|*.dat"; //if (FilePath != null) //{ // op.InitialDirectory = FilePath; //} //if (op.ShowDialog() == DialogResult.OK) //{ if (client.UpLoadFile(FileName, FilePath, ftp.FtpIP, ftp.FtpUser, ftp.FtpPwd)) { VMHelp.ShowMessage(true); } else { VMHelp.ShowMessage("对账文件上传失败,ftp地址、账号、密码错误", false); // FileName = null; } //} } catch (Exception e) { SendExcetpion(e); } }
/// <summary> /// 生成bat文件 /// </summary> private void ProduceFileExecute() { if (this.Models == null) { VMHelp.ShowMessage("对账信息为空", false); return; } //if (!VMHelp.AskMessage("是否生成并上传对账文件?")) //{ // return; //} try { List <string> txtInfo = new List <string>(); foreach (BillFileCheck item in this.Models) { BillstrPad bp = new BillstrPad(item); string info = bp.BillPadRight(); txtInfo.Add(info); } if (txtInfo.Count > 0) { FileName = VMHelp.BankCode + DateTime.Now.ToString("yyyyMMdd") + ".dat"; FilePath = VMHelp.SYSCONFIG.BillFolder; if (client.ProduceBillFile(txtInfo, FilePath, FileName)) { VMHelp.ShowMessage("生成成功", true); } else { VMHelp.ShowMessage("生成失败", false); FileName = null; return; } // UpLoadFileExecute(); } } catch (Exception e) { SendExcetpion(e); } }
/// <summary> /// 进行关联 /// </summary> public void LinkExecute() { UnknowModel.UB_LinkStr = ""; decimal money = 0; foreach (UnKnowLinkModel item in LinkModel2) { UnknowModel.UB_LinkStr = UnknowModel.UB_LinkStr + item.DF.ID + ","; money = money + item.DF.DepositAmount.Value; } if (UnknowModel.UB_LinkStr != "") { if (money != UnknowModel.UB_Money) { VMHelp.ShowMessage(string.Format("不明账款金额:{0}\n缴存总额:{1} \n不明账款和所关联的缴存金额不一致", UnknowModel.UB_Money.Value.ToString(), money.ToString()), false); return; } UnknowModel.UB_State = "Y"; if (client.UpdateUnKownJG_Deposit(UnknowModel)) { VMHelp.ShowMessage("关联成功", true); } else { VMHelp.ShowMessage("关联失败", false); } } else { UnknowModel.UB_State = "N"; UnknowModel.UB_LinkStr = "N"; if (client.UpdateUnKownJG_Deposit(UnknowModel)) { VMHelp.ShowMessage("取消关联成功", true); } else { VMHelp.ShowMessage("取消关联失败", false); } } }
/// <summary> /// 销户命令 /// </summary> public override void DestroyAccountExecute() { if (CurModel.AM_ID != null) { // FundsRegulatoryClient.JG_AccountManageSrv.JG_AccountManageInfo jj = (FundsRegulatoryClient.JG_AccountManageSrv.JG_AccountManageInfo)obj; int index = Models.IndexOf(CurModel);//检索列表中是否存在该项 if (index > -1) { if (CurModel.AM_UseFlag != "销户") { FundsRegulatoryClient.InterestService.DayBalance db = new FundsRegulatoryClient.InterestService.DayBalance(); db.DB_ID = CurModel.AM_ID; // db.DB_Time = DateTime.Parse(DateTime.Now.AddDays(-1).ToShortDateString()); ObservableCollection <FundsRegulatoryClient.InterestService.DayBalance> dblist = InterestClient.SelectJG_DayBalanceInfo(db); if (dblist.Count == 1 && CurModel.AM_CreateDate.Value.ToShortDateString() == DateTime.Now.ToShortDateString()) { CurModel.AM_UseFlag = "销户"; client.Update(CurModel); //Models[index] = CurModel; //AccountSearch.xaml FlushExecute(); VMHelp.ShowMessage("销户成功", true); return; } if (dblist.Count == 1 || dblist[dblist.Count - 2].DB_Interest == null) { VMHelp.ShowMessage("请先结息", false); return; } CurModel.AM_UseFlag = "销户"; client.Update(CurModel); //Models[index] = CurModel; //AccountSearch.xaml FlushExecute(); VMHelp.ShowMessage("销户成功", true); } else { VMHelp.ShowMessage("已经销户", false); } } } }
/// <summary> /// 进行缴款 /// </summary> private void DepositExecute() { // 判断是否查询并且正确 if (!IsSearch) { VMHelp.ShowMessage("未进行缴款凭证编号的查询,不可提交", false); return; } if (response == null && response.ReturnCode != FinancialRegulation.Tools.PublicData.ResponseSuccess) { VMHelp.ShowMessage("信息查询失败,不可提交", false); } CurrentObj.DepositID = SearchInfo.DepositID; FundInfoAddToEdit temp = new FundInfoAddToEdit(CurrentObj, null, OBModels); if ((bool)temp.ShowDialog()) { windowClose(); } }
public override void OKExecute() { if (JirInfo.InterestRate == null) { VMHelp.ShowMessage("利率不能为空!", true); return; } JirInfo.ID = Guid.NewGuid().ToString(); JirInfo.SetDate = DateTime.Now; FundsRegulatoryClient.InterestService.DayBalance db = new FundsRegulatoryClient.InterestService.DayBalance(); db.DB_Time = DateTime.Parse(DateTime.Now.ToShortDateString()); db.DB_InterestRate = JirInfo.InterestRate; if (InterestClient.UpdateJG_DayBalanceInfo(db)) { if (client.AddJG_InterestRateInfo(JirInfo)) { VMHelp.ShowMessage("添加成功!", true); windowClose(); } } }
/// <summary> /// 添加记录 /// </summary> public override void OKExecute() { try { FundsRegulatoryClient.SqlTransSvr.FundPayment fptemp = new FundsRegulatoryClient.SqlTransSvr.FundPayment(); string strAskMessage = "付款凭证编号:" + df.PaymentID + "\r\n应支付款金额:" + df.PaymentAmount + "\r\n收款人账号:" + df.ReceiverAccount + "\r\n收款人名称:" + df.ReceiverName + "\r\n付款人账号:" + df.PayAccount + "\r\n付款人名称:" + df.PayName; if (VMHelp.AskMessage(strAskMessage + "\r\n确认进行冲正?")) { fptemp.BusinessCode = CurrentObj.BusinessCode = FinancialRegulation.Tools.PublicData.ReverseFund; fptemp.PaymentID = CurrentObj.PaymentID = df.PaymentID; fptemp.BankSerialNumber = CurrentObj.ReverseSerialNum = df.SerialNumber;//本系统产生的流水号 fptemp.ReceiveBank = CurrentObj.ReverseBank = df.PaymentBank; fptemp.BankSiteID = CurrentObj.BankSiteID = df.BankSiteID; fptemp.BankTellerID = CurrentObj.BankTellerID = df.BankTellerID; fptemp.PayID = df.PayID; fptemp.FirmName = df.FirmName; CurrentObj.BankCode = df.BankCode; CurrentObj.ReverseType = Tools.PublicData.ReversePay;//支付冲正 response = SendMessage <Response06>(CurrentObj, VMHelp.PointCode, VMHelp.UserCode); if (response.ReturnCode != Tools.PublicData.ResponseSuccess) { VMHelp.ShowMessage(HelpClass.Current.MsgDIC[response.ReturnCode], false); return; } fptemp.PayState = df.PayState = Tools.PublicData.ReverseA; fptemp.ReverseTime = df.ReverseTime = DateTime.Now; fptemp.ReverseInstr = df.ReverseInstr = CurrentObj.ReverseInstr; fptemp.BankSiteID = VMHelp.PointCode; fptemp.BankTellerID = VMHelp.UserCode; fptemp.BusinessCode = df.BusinessCode = FinancialRegulation.Tools.PublicData.ReverseFund; // fptemp.PayID = df.PayID; //if (!deClient.Update(df)) //{ // VMHelp.ShowMessage("支付数据更新失败",false); // return; //} FundsRegulatoryClient.JG_AccountManageSrv.JG_AccountManageInfo ami = new FundsRegulatoryClient.JG_AccountManageSrv.JG_AccountManageInfo(); ami.AM_JgAccount = df.PayAccount; ObservableCollection <FundsRegulatoryClient.JG_AccountManageSrv.JG_AccountManageInfo> acc = accountClient.Select(ami); FundsRegulatoryClient.InterestService.DayBalance db = new FundsRegulatoryClient.InterestService.DayBalance(); db.DB_ID = acc[0].AM_ID; db.DB_Time = DateTime.Parse(DateTime.Now.ToShortDateString()); ObservableCollection <FundsRegulatoryClient.InterestService.DayBalance> dblist = new ObservableCollection <FundsRegulatoryClient.InterestService.DayBalance>(); dblist = InterestClient.SelectJG_DayBalanceInfo(db); if (dblist.Count < 1) { VMHelp.ShowMessage("支付失败,数据无今日余额", false); return; } FundsRegulatoryClient.SqlTransSvr.DayBalance temp = new FundsRegulatoryClient.SqlTransSvr.DayBalance(); temp.DB_Balance = dblist[0].DB_Balance; temp.DB_InterestRate = dblist[0].DB_InterestRate; temp.DB_Balance = temp.DB_Balance + df.PaymentAmount; temp.ID = dblist[0].ID; temp.DB_ID = acc[0].AM_ID; temp.DB_Time = DateTime.Parse(DateTime.Now.ToShortDateString()); if (!TranClient.Update_DbAndPF(temp, fptemp, 2)) { VMHelp.ShowMessage("失败原因:\r\n 1、支付表状态更新失败 \r\n 2、当日余额更新失败", false); return; } //if (!InterestClient.UpdateJG_DayBalanceInfo(db)) //{ // VMHelp.ShowMessage("今日余额更新失败", false); // return; //} VMHelp.ShowMessage(true); windowOK(); } } catch (Exception e) { SendExcetpion(e); } }
/// <summary> /// 添加记录 /// </summary> public override void OKExecute() { try { string strAskMessage = "缴款凭证编号:" + DepositResponse.DepositID + "\r\n缴款类型:" + VMHelp.GetMoneyType(DepositResponse.DepositType) + "\r\n缴款金额:" + DepositResponse.DepositAmount + "\r\n购房人名称:" + DepositResponse.PurchaserName + "\r\n购房人证件号:" + DepositResponse.PurchaserID; if (Check() && VMHelp.AskMessage(strAskMessage + "\r\n确认进行存款?")) { model = new FundsRegulatoryClient.SqlTransSvr.DepositFund(); model2 = new DepositFund(); // model. = Guid.NewGuid().ToString(); model2.BusinessCode = CurrentObj.BusinessCode = model.BusinessCode = FinancialRegulation.Tools.PublicData.FundDeposit; //交易代码 model2.BankCode = CurrentObj.BankCode = model.BankCode = VMHelp.BankCode; //银行代码 model2.DepositNum = CurrentObj.DepositID = model.DepositNum = DepositResponse.DepositID; //缴款凭证编号 model2.DepositType = model.DepositType = DepositResponse.DepositType; //缴款类型 model2.DepositAmount = CurrentObj.DepositAmount = model.DepositAmount = DepositResponse.DepositAmount; //缴款金额 model2.PurchaserName = CurrentObj.PurchaserName = model.PurchaserName = DepositResponse.PurchaserName; //购房人名称 model2.PurchaserID = CurrentObj.PurchaserID = model.PurchaserID = DepositResponse.PurchaserID; //购房人证件号 model2.BankSiteID = CurrentObj.BankSiteID = model.BankSiteID = VMHelp.PointCode; //网点号 model2.DeSerialNumber = model.DeSerialNumber = BankSerialNumber; // VMHelp.ServiceNo;//银行流水号 model2.SerialNumber = model.SerialNumber = CurrentObj.SerialNumber = VMHelp.ServiceNo; //当前系统流水号 model2.BankTellerID = CurrentObj.BankTellerID = model.BankTellerID = VMHelp.UserCode; //柜员号 model2.BankName = model.BankName = VMHelp.BankName; //银行名称 model2.FirmName = model.FirmName = DepositResponse.FirmName; model2.DepositAccount = model.DepositAccount = DepositResponse.DepositAccount; model2.ProjectCode = model.ProjectCode = DepositResponse.ProjectCode; model2.DepositInstr = model.DepositInstr = CurrentObj.DepositInstr;//缴款说明 model2.DepositState = model.DepositState = Tools.PublicData.DepositA; //model._DE_cklb = Tools.PublicData.Deposit_Lf; //CurrentObj.BusinessTime = VMHelp.NowTime.ToString(); CurrentObj.BankName = VMHelp.BankName;//缴款银行名称 if (df != null) { model2.ID = model.ID = df.ID; model2.DepositTime = model.DepositTime = DateTime.Parse(VMHelp.NowTime);//缴款日期 } else { model2.ID = model.ID = VMHelp.GUID; model2.DepositTime = model.CheckTime = model.DepositTime = DateTime.Parse(VMHelp.NowTime);//缴款日期 } FundsRegulatoryClient.JG_AccountManageSrv.JG_AccountManageInfo ami = new FundsRegulatoryClient.JG_AccountManageSrv.JG_AccountManageInfo(); ami.AM_JgAccount = model.DepositAccount; ObservableCollection <FundsRegulatoryClient.JG_AccountManageSrv.JG_AccountManageInfo> acc = accountClient.Select(ami); if (acc.Count < 1 || acc[0].AM_UseFlag == "销户") { VMHelp.ShowMessage("缴款失败,缴存账户不存在或已销户", false); return; } FundsRegulatoryClient.InterestService.DayBalance db = new FundsRegulatoryClient.InterestService.DayBalance(); db.DB_ID = acc[0].AM_ID; db.DB_Time = DateTime.Parse(DateTime.Now.ToShortDateString()); ObservableCollection <FundsRegulatoryClient.InterestService.DayBalance> dblist = new ObservableCollection <FundsRegulatoryClient.InterestService.DayBalance>(); dblist = InterestClient.SelectJG_DayBalanceInfo(db); if (dblist.Count < 1) { VMHelp.ShowMessage("缴款失败,余额表无当日余额", false); return; } response = SendMessage <Response03>(CurrentObj, VMHelp.PointCode, VMHelp.UserCode);//发送Messageresponse.ReturnCode =="03" if (response.ReturnCode == Tools.PublicData.ResponseSuccess || response.ReturnCode == Tools.PublicData.DepositSuccess) { if (response.ReturnCode == Tools.PublicData.DepositSuccess && !VMHelp.AskMessage("缴款书已完成缴费,是否存数据库?")) { return; } if (df != null) { FundsRegulatoryClient.SqlTransSvr.DayBalance temp = new FundsRegulatoryClient.SqlTransSvr.DayBalance(); temp.DB_Balance = dblist[0].DB_Balance; temp.DB_InterestRate = dblist[0].DB_InterestRate; temp.DB_Balance = temp.DB_Balance + model.DepositAmount; temp.ID = dblist[0].ID; temp.DB_ID = acc[0].AM_ID; temp.DB_Time = DateTime.Parse(DateTime.Now.ToShortDateString()); if (!TranClient.Update_DbAndDF(temp, model, 2)) { VMHelp.ShowMessage("错误原因:\r\n 1、存款信息插入失败 \r\n 2、当日余额更新失败", false); return; } //this.Models.Remove(df); //this.Models.Add(model2); VMHelp.ShowMessage(true); windowOK(); } else { FundsRegulatoryClient.SqlTransSvr.DayBalance temp = new FundsRegulatoryClient.SqlTransSvr.DayBalance(); temp.DB_Balance = dblist[0].DB_Balance; temp.DB_InterestRate = dblist[0].DB_InterestRate; temp.DB_Balance = temp.DB_Balance + model.DepositAmount; temp.ID = dblist[0].ID; temp.DB_ID = acc[0].AM_ID; temp.DB_Time = DateTime.Parse(DateTime.Now.ToShortDateString()); if (!TranClient.Update_DbAndDF(temp, model, 1)) { VMHelp.ShowMessage("错误原因:\r\n 1、存款信息插入失败 \r\n 2、当日余额更新失败", false); return; } VMHelp.ShowMessage(true); windowOK(); } } else //if (response.ReturnCode == Tools.PublicData.DepositFail) { VMHelp.ShowMessage("缴款书不存在", false); } } } catch (Exception e) { SendExcetpion(e); } }
/// <summary> /// 发起对账 /// </summary> private void SendBillExecute() { if (FileName == null) { VMHelp.ShowMessage("文件未生成成功", false); return; } if (!client.UploadState) { VMHelp.ShowMessage("文件未上传成功", false); return; } Response01 response = new Response01(); Request01 request = new Request01(); request.BankCode = VMHelp.BankCode; request.FileName = FileName; request.BusinessCode = Tools.PublicData.CheckBill; ObservableCollection <AccountAndBalance> temp = GetBalance();//获得平台余额 decimal PlatformBalance = 0; foreach (AccountAndBalance item in temp) { PlatformBalance += item.Balance.Value; } request.PlatformBalance = PlatformBalance.ToString();//平台余额 BillCheckWindowVm vm = new BillCheckWindowVm(); BillCheckWindow bkwindow = new BillCheckWindow(vm); bkwindow.Tag = "当日对账"; if (!(bool)bkwindow.ShowDialog()) { return; } ObservableCollection <UnknowBill> checklist = new ObservableCollection <UnknowBill>(); foreach (UnknowBill item in Depositclient.SelectUnKownJG_Deposit(null)) { if (item.UB_State == "N") { checklist.Add(item); } } decimal money = 0; foreach (UnknowBill item in checklist) { money = money + item.UB_Money.Value; } request.AccoutCheckInstr = vm.BillInstruction; request.AccountBalance = money;//账务余额 try { response = SendMessage <Response01>(request, VMHelp.PointCode, VMHelp.UserCode); } catch (Exception e) { System.Windows.MessageBox.Show(e.Message); return; } if (response.ReturnCode == Tools.PublicData.ResponseSuccess) { VMHelp.ShowMessage("对账成功", true); } else { ; VMHelp.ShowMessage(Tools.HelpClass.Current.MsgDIC[response.ReturnCode], false); } }
/// <summary> /// 更新当日余额,存款表状态,支付表状态,添加退票信息 /// </summary> /// <returns></returns> private bool DayBalanceAndRefundAndState() { FundsRegulatoryClient.JG_AccountManageSrv.JG_AccountManageInfo ami = new FundsRegulatoryClient.JG_AccountManageSrv.JG_AccountManageInfo(); FundsRegulatoryClient.JG_AccountManageClient accountClient = FundsRegulatoryClient.JG_AccountManageClient.Instance; FundsRegulatoryClient.InterestManageClient InterestClient = FundsRegulatoryClient.InterestManageClient.Instance; // FundsRegulatoryClient.RefundTradeClient refundClient=fun ami.AM_JgAccount = CurrentObj.AccountName; ObservableCollection <FundsRegulatoryClient.JG_AccountManageSrv.JG_AccountManageInfo> acc = accountClient.Select(ami); if (acc.Count < 1) { VMHelp.ShowMessage("账户不存在", false); return(false); } FundsRegulatoryClient.InterestService.DayBalance db = new FundsRegulatoryClient.InterestService.DayBalance(); FundsRegulatoryClient.SqlTransSvr.DayBalance sqldb = new FundsRegulatoryClient.SqlTransSvr.DayBalance(); sqldb.DB_ID = db.DB_ID = acc[0].AM_ID; // db.DB_AccountNum = model.DepositAccount; sqldb.DB_Time = db.DB_Time = DateTime.Parse(DateTime.Now.ToShortDateString()); ObservableCollection <FundsRegulatoryClient.InterestService.DayBalance> dblist = new ObservableCollection <FundsRegulatoryClient.InterestService.DayBalance>(); dblist = InterestClient.SelectJG_DayBalanceInfo(db); if (dblist.Count > 0) { FundsRegulatoryClient.SqlTransSvr.RefundTrade temp = new FundsRegulatoryClient.SqlTransSvr.RefundTrade(); // CurrentObj.ID = temp.ID = VMHelp.GUID; temp.BussinessCode = FinancialRegulation.Tools.PublicData.Refund; temp.SerialNum = VMHelp.ServiceNo; temp.BankCode = VMHelp.BankCode; CurrentObj.Bankwebsite = temp.Bankwebsite = VMHelp.PointCode; CurrentObj.AccountTeller = temp.AccountTeller = VMHelp.UserCode; CurrentObj.RefundTime = temp.RefundTime = DateTime.Now; temp.AccountName = CurrentObj.AccountName; temp.BankSerialNum = CurrentObj.BankSerialNum; temp.PaymentID = CurrentObj.PaymentID; temp.RefundInstr = CurrentObj.RefundInstr; temp.RefundAmount = CurrentObj.RefundAmount; temp.RT_Type = RefundType; if (CurrentObj.BussinessCode == FinancialRegulation.Tools.PublicData.FundDeposit) { sqldb.DB_Balance = db.DB_Balance = dblist[0].DB_Balance; sqldb.DB_InterestRate = db.DB_InterestRate = dblist[0].DB_InterestRate; sqldb.DB_Balance = db.DB_Balance = db.DB_Balance - CurrentObj.RefundAmount; sqldb.ID = db.ID = dblist[0].ID; temp.AccountID = acc[0].AM_ID; DepositFund dftemp = (DepositFund)UpdatePayOrDeposit(1); temp.ID = VMHelp.GUID; if (sqlTran.Update_DbAndDF(sqldb, temp, dftemp)) { return(true); } else { return(false); } } else { sqldb.DB_Balance = db.DB_Balance = dblist[0].DB_Balance; sqldb.DB_InterestRate = db.DB_InterestRate = dblist[0].DB_InterestRate; sqldb.DB_Balance = db.DB_Balance = db.DB_Balance + CurrentObj.RefundAmount; sqldb.ID = db.ID = dblist[0].ID; temp.AccountID = acc[0].AM_ID; FundPayment fptemp = (FundPayment)UpdatePayOrDeposit(2); temp.ID = VMHelp.GUID; if (sqlTran.Update_DbAndPF(sqldb, fptemp, temp)) { return(true); } else { return(false); } } } else { return(false); } }
public override void OKExecute() { try { if (ExecuteCode == 1) { CurrentObj.UB_ID = VMHelp.GUID; CurrentObj.UB_SerialNum = VMHelp.ServiceNo; CurrentObj.UB_BankCode = VMHelp.BankCode; CurrentObj.UB_BankSiteID = VMHelp.PointCode; CurrentObj.UB_BankTellerID = VMHelp.UserCode; FundsRegulatoryClient.JG_AccountManageClient accountClient = FundsRegulatoryClient.JG_AccountManageClient.Instance; FundsRegulatoryClient.JG_AccountManageSrv.JG_AccountManageInfo ami = new FundsRegulatoryClient.JG_AccountManageSrv.JG_AccountManageInfo(); ami.AM_JgAccount = CurrentObj.UB_ManageAccount; ObservableCollection <FundsRegulatoryClient.JG_AccountManageSrv.JG_AccountManageInfo> acc = accountClient.Select(ami); if (acc.Count < 1 || acc[0].AM_UseFlag == "销户") { VMHelp.ShowMessage("缴款失败,缴存账户不存在或已销户", false); return; } if (Check() && deClient.AddUnKownJG_Deposit(CurrentObj)) { this.Models.Add(CurrentObj); VMHelp.ShowMessage(true); windowClose(); } } else { if (Check() && deClient.UpdateUnKownJG_Deposit(CurrentObj)) { VMHelp.ShowMessage(true); windowOK(); } } /* try * { * switch (Model._DE_ckxz) * { * case "1": * NatureOfFunding = "非贷款"; * break; * case "2": * NatureOfFunding = "商业贷款"; * break; * case "3": * NatureOfFunding = "公积金贷款"; * break; * default: * break; * } * //string strAskMessage = "合同备案号:" + Model._DE_qybh + "\r\n存款人:" + Model._DE_ckr + "\r\n存款金额:" + Model._DE_ckje + "\r\n资金性质:" + NatureOfFunding + "\r\n账户余额:" + CurrentObj.Balances; * string strAskMessage = "合同备案号:" + Model._DE_qybh + "\r\n存款人:" + Model._DE_ckr + "\r\n存款金额:" + Model._DE_ckje + "\r\n资金性质:" + NatureOfFunding ; * if (Check() && VMHelp.AskMessage(strAskMessage+"\r\n确定要补录不明存款?")) * { * if (response == null) * { * CurrentObj.BusinessCode = "112"; * CurrentObj.BusinessTime = VMHelp.NowTime; * CurrentObj.SerialNo = VMHelp.ServiceNo; * CurrentObj.PactNo = Model._DE_xybh; * CurrentObj.FormerNo = Model._DE_cklsh; * CurrentObj.ContractRecordNo = Model._DE_qybh; * CurrentObj.Depositor = Model._DE_ckr; * CurrentObj.Money = Model._DE_ckje.Value; * CurrentObj.NatureOfFunding = Model._DE_ckxz; * CurrentObj.FromBbank = VMHelp.BankCode; * CurrentObj.Balances = Model._DE_zhye.Value; * CurrentObj.CRCCode = VMHelp.CRCCode; * } * // response = SendMessage<Message.Message012>(CurrentObj); * if (response != null && response.ExceptionCode == "01") * { * Model._DE_BankCode = VMHelp.PointCode; * bool result = deClient.Update(Model); * * if (result) * { * VMHelp.ShowMessage(true); * windowClose(); * } * else * { * VMHelp.ShowMessage(false); * } * } * else * { * VMHelp.ShowMessage(response.ExceptionMessage, false); * } * } * } * catch (Exception ex) * { * VMHelp.ShowMessage(ex.Message, false); * }*/ } catch (Exception e) { SendExcetpion(e); } }