/// <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); } } } }
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> /// <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); } }
/// <summary> /// 修改 /// </summary> /// <param name="obj"></param> public override void ModifyExecute() { //if (CurModel.AM_ID!=null) //{ // //FundsRegulatoryClient.JG_AccountManageSrv.JG_AccountManageInfo jj = (FundsRegulatoryClient.JG_AccountManageSrv.JG_AccountManageInfo)obj; // ObservableCollection<JG_AccountManageInfo> temp = new ObservableCollection<JG_AccountManageInfo>(); // int index = this.Models.IndexOf(CurModel); // OpenAccountAddToEdit page = new OpenAccountAddToEdit(CurModel, Models); // page.ShowDialog(); // this.dg.SelectedIndex = index; // // this.Models[index] = CurModel; // //foreach (JG_AccountManageInfo item in this.Models) // //{ // // temp.Add(item); // //} // //this.Models.Clear(); // //this.Models = temp; // // FlushExecute(); //} 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 == "正常") { VMHelp.ShowMessage("账户已经启用", false); return; } CurModel.AM_UseFlag = "正常"; ObservableCollection <FundsRegulatoryClient.JG_InterestRateSrv.JG_InterestRateInfo> rate = InterestRateClient.Selects(); int i = 0; for (; i < rate.Count; i++) { if (rate[i].Flag == "1") { break; } } if (rate.Count < 1 || i == rate.Count) { VMHelp.ShowMessage("未启用最新利率或设置利率", false); return; } FundsRegulatoryClient.InterestService.DayBalance db = new FundsRegulatoryClient.InterestService.DayBalance(); db.DB_ID = CurModel.AM_ID; // db.DB_Time = DateTime.Parse(DateTime.Now.ToShortDateString()); ObservableCollection <FundsRegulatoryClient.InterestService.DayBalance> dblist = InterestClient.SelectJG_DayBalanceInfo(db); FundsRegulatoryClient.SqlTransSvr.JG_AccountManageInfo tempacc = new FundsRegulatoryClient.SqlTransSvr.JG_AccountManageInfo(); tempacc.AM_ID = CurModel.AM_ID; tempacc.AM_BankCode = VMHelp.BankCode;//银行代码 tempacc.AM_CreateDate = DateTime.Parse(VMHelp.NowTime); tempacc.AM_CorpName = CurModel.AM_CorpName; tempacc.AM_ItemName = CurModel.AM_ItemName; tempacc.AM_JgAccount = CurModel.AM_JgAccount; tempacc.AM_ProjectCode = CurModel.AM_ProjectCode; tempacc.AM_UseFlag = CurModel.AM_UseFlag; tempacc.AM_zhmc = CurModel.AM_zhmc; tempacc.AM_Person = CurModel.AM_Person; FundsRegulatoryClient.SqlTransSvr.DayBalance tempdb = new FundsRegulatoryClient.SqlTransSvr.DayBalance(); //每天余额表添加一条 tempdb.DB_ID = CurModel.AM_ID; tempdb.DB_AccountNum = CurModel.AM_JgAccount; tempdb.DB_InterestRate = rate[0].InterestRate; //利率; tempdb.DB_Time = DateTime.Parse(DateTime.Now.ToShortDateString()); if (dblist.Count > 0) { tempdb.DB_Balance = dblist[dblist.Count - 1].DB_Balance; } else { tempdb.DB_Balance = null; } tempdb.ID = Guid.NewGuid().ToString(); //季度结息表更新 FundsRegulatoryClient.SqlTransSvr.SeasonInterest si = new FundsRegulatoryClient.SqlTransSvr.SeasonInterest(); FundsRegulatoryClient.InterestService.SeasonInterest tempsi = new FundsRegulatoryClient.InterestService.SeasonInterest(); tempsi.SI_ID = si.SI_ID = tempdb.DB_ID; ObservableCollection <FundsRegulatoryClient.InterestService.SeasonInterest> silist = InterestClient.SelectJG_SeasonInterestInfo(tempsi); si.SI_Time = tempdb.DB_Time.Value.AddMonths(3); si.SI_AccountNum = tempdb.DB_AccountNum; if (dblist[dblist.Count - 1].DB_Time == DateTime.Parse(DateTime.Now.ToShortDateString())) { if (tranClient.CreateAccountSIDB(tempacc, null, null, 2)) { VMHelp.ShowMessage("启用成功!", true); } else { VMHelp.ShowMessage("启用失败", false); } } else if (silist[silist.Count - 1].SI_Time <= DateTime.Parse(DateTime.Now.ToShortDateString())) { si.ID = silist[silist.Count - 1].ID; if (tranClient.CreateAccountSIDB(tempacc, si, tempdb, 2)) { VMHelp.ShowMessage("启用成功!", true); // windowClose(); } else { VMHelp.ShowMessage("启用失败", false); } } FlushExecute(); } } }
/// <summary> /// 添加记录 /// </summary> public override void OKExecute() { try { string strAskMessage = "付款凭证编号:" + PayResponse.PaymentID + "\r\n应支付款金额:" + PayResponse.PaymentAmount + "\r\n收款人账号:" + PayResponse.ReceiverAccount + "\r\n收款人名称:" + PayResponse.ReceiverName + "\r\n付款人账号:" + PayResponse.PayerAccount + "\r\n付款人名称:" + PayResponse.PayerName; if (Check() && VMHelp.AskMessage(strAskMessage + "\r\n确认进行存款?")) { model = new FundPayment(); model2 = new FundsRegulatoryClient.SqlTransSvr.FundPayment(); // model. = Guid.NewGuid().ToString(); model2.BusinessCode = CurrentObj.BusinessCode = model.BusinessCode = FinancialRegulation.Tools.PublicData.FundPay; //交易代码 model2.BankCode = CurrentObj.BankCode = model.BankCode = VMHelp.BankCode; model2.PaymentAmount = CurrentObj.PaymentAmount = model.PaymentAmount = PayResponse.PaymentAmount; //支付金额 model2.FirmOperatorName = model.FirmOperatorName = CurrentObj.FirmOperatorName; //企业经办人 model2.FirmOperatorID = model.FirmOperatorID = CurrentObj.FirmOperatorID; //经办人证件号 model2.PaymentBank = model.PaymentBank = CurrentObj.PaymentBank = VMHelp.BankName; //支付银行 model2.BankSiteID = CurrentObj.BankSiteID = model.BankSiteID = VMHelp.PointCode; //网点号 model2.BankSerialNumber = model.BankSerialNumber = BankSerialNumber; // 银行流水号 model2.SerialNumber = model.SerialNumber = CurrentObj.SerialNumber = VMHelp.ServiceNo; //当前流水号 model2.BankTellerID = CurrentObj.BankTellerID = model.BankTellerID = VMHelp.UserCode; //柜员号 model2.PaymentInstr = model.PaymentInstr = CurrentObj.PaymentInstr; //付款说明 model2.PayState = model.PayState = Tools.PublicData.PayA; model2.PaymentID = model.PaymentID = CurrentObj.PaymentID = PayResponse.PaymentID; //支付凭证编号 model2.ReceiverAccount = model.ReceiverAccount = PayResponse.ReceiverAccount; model2.ReceiverName = model.ReceiverName = PayResponse.ReceiverName; model2.ReceiveBank = model.ReceiveBank = PayResponse.ReceiverBankName; model2.PayName = model.PayName = PayResponse.PayerName; model2.PayAccount = model.PayAccount = PayResponse.PayerAccount; model2.PaymentBank = model.PaymentBank = PayResponse.PayBank; model2.ProjectCode = model.ProjectCode = PayResponse.ProjectID; // model2.FirmName = model.FirmName = "";//公司名称 //model._DE_cklb = Tools.PublicData.Deposit_Lf; //CurrentObj.BusinessTime = VMHelp.NowTime.ToString(); if (df != null) { model2.PayID = model.PayID = df.PayID; model2.PaymentTime = model.PaymentTime = DateTime.Parse(VMHelp.NowTime);//缴款日期 } else { model2.PayID = model.PayID = VMHelp.GUID; model2.PaymentTime = model.PaymentTime = model.PaymentConfirmTime = DateTime.Parse(VMHelp.NowTime);//缴款日期 } FundsRegulatoryClient.JG_AccountManageSrv.JG_AccountManageInfo ami = new FundsRegulatoryClient.JG_AccountManageSrv.JG_AccountManageInfo(); ami.AM_JgAccount = model.PayAccount; ObservableCollection <FundsRegulatoryClient.JG_AccountManageSrv.JG_AccountManageInfo> acc = accountClient.Select(ami); if (acc.Count < 1 || acc[0].AM_UseFlag == "销户") { VMHelp.ShowMessage("付款账户不存在或已销户", false); return; } ////获取企业名称 model2.FirmName = model.FirmName = acc[0].AM_CorpName; 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 < 0) { VMHelp.ShowMessage("支付失败,数据无今日余额", false); return; } if (dblist[0].DB_Balance < model.PaymentAmount) { VMHelp.ShowMessage("账户余额不足,无法支付", false); return; } response = SendMessage <Response05>(CurrentObj, VMHelp.PointCode, VMHelp.UserCode);//发送Messageresponse.ReturnCode =="00" if (response.ReturnCode == Tools.PublicData.ResponseSuccess || response.ReturnCode == Tools.PublicData.PaymentSuccess) { if (response.ReturnCode == Tools.PublicData.PaymentSuccess && !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.PaymentAmount; temp.ID = dblist[0].ID; temp.DB_ID = acc[0].AM_ID; temp.DB_Time = DateTime.Parse(DateTime.Now.ToShortDateString()); if (sqlTran.Update_DbAndPF(temp, model2, 2)) { VMHelp.ShowMessage(true);//"付款凭证已经完成支付", windowOK(); } else { VMHelp.ShowMessage("操作失败原因:\r\n 1、支付表更新失败 \r\n 2、余额表更新失败", false); return; } } else { //if (dblist[0].DB_Balance < model.PaymentAmount) //{ // 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 - model.PaymentAmount; temp.ID = dblist[0].ID; temp.DB_ID = acc[0].AM_ID; temp.DB_Time = DateTime.Parse(DateTime.Now.ToShortDateString()); if (sqlTran.Update_DbAndPF(temp, model2, 1)) { VMHelp.ShowMessage(true);//"付款凭证已经完成支付", windowOK(); } else { VMHelp.ShowMessage("操作失败原因:\r\n 1、支付表添加失败 \r\n 2、余额表更新失败", false); return; } } } else //if (response.ReturnCode == Tools.PublicData.PaymentFail) { VMHelp.ShowMessage("付款凭证不存在", false); } } } catch (Exception e) { SendExcetpion(e); } }
/// <summary> /// 添加记录 /// </summary> public override void OKExecute() { try { FundsRegulatoryClient.SqlTransSvr.DepositFund dftemp = new FundsRegulatoryClient.SqlTransSvr.DepositFund(); string strAskMessage = "缴款凭证编号:" + df.DepositNum + "\r\n缴款类型:" + VMHelp.GetMoneyType(df.DepositType) + "\r\n缴款金额:" + df.DepositAmount + "\r\n购房人名称:" + df.PurchaserName + "\r\n购房人证件号:" + df.PurchaserID; if (VMHelp.AskMessage(strAskMessage + "\r\n确认进行冲正?")) { dftemp.BusinessCode = CurrentObj.BusinessCode = FinancialRegulation.Tools.PublicData.ReverseFund; dftemp.DepositNum = CurrentObj.PaymentID = df.DepositNum; dftemp.DeSerialNumber = CurrentObj.ReverseSerialNum = df.SerialNumber;//本系统产生的流水号 dftemp.BankName = CurrentObj.ReverseBank = df.BankName; dftemp.FirmName = df.FirmName; dftemp.BankSiteID = CurrentObj.BankSiteID = df.BankSiteID; dftemp.BankTellerID = CurrentObj.BankTellerID = df.BankTellerID; dftemp.ID = df.ID; dftemp.BankSiteID = VMHelp.PointCode; dftemp.BankTellerID = VMHelp.UserCode; CurrentObj.BankCode = df.BankCode; CurrentObj.ReverseType = Tools.PublicData.ReverseDeposit; //存款冲正 response = SendMessage <Response06>(CurrentObj, VMHelp.PointCode, VMHelp.UserCode); //发送Messageresponse.ReturnCode =="03" //if (response.ReturnCode != Tools.PublicData.ResponseSuccess && response.ReturnCode == Tools.PublicData.ReverseSucces) //{ VMHelp.ShowMessage("原交易不存在无法冲正", false); return; } //if (response.ReturnCode == Tools.PublicData.DepositSuccess && !VMHelp.AskMessage("缴款书已完成缴费,是否存数据库?")) //{ // return; //} //返回码为失败时 if (response.ReturnCode != Tools.PublicData.ResponseSuccess) { VMHelp.ShowMessage(HelpClass.Current.MsgDIC[response.ReturnCode], false); return; } dftemp.DepositState = df.DepositState = Tools.PublicData.ReverseA; dftemp.ReverseTime = df.ReverseTime = DateTime.Now; dftemp.ReverseInstr = df.ReverseInstr = CurrentObj.ReverseInstr; dftemp.BusinessCode = df.BusinessCode = FinancialRegulation.Tools.PublicData.ReverseFund; FundsRegulatoryClient.JG_AccountManageSrv.JG_AccountManageInfo ami = new FundsRegulatoryClient.JG_AccountManageSrv.JG_AccountManageInfo(); ami.AM_JgAccount = df.DepositAccount; 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.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, dftemp, 2)) { VMHelp.ShowMessage("失败原因:\r\n 1、存款表状态更新失败 \r\n 2、当日余额更新失败", false); return; } VMHelp.ShowMessage(true); windowOK(); } } catch (Exception e) { SendExcetpion(e); } }