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); } } }
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); } } } }
/// <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> public override void OKExecute() { if (Models == null && CurrentObj.AM_JgAccount != null) { if (Check() && VMHelp.AskMessage("确认要进行开户?")) { ObservableCollection <FundsRegulatoryClient.JG_InterestRateSrv.JG_InterestRateInfo> rate = InterestRateClient.Selects(); if (rate.Count > 0) { CurrentObj.AM_ID = Guid.NewGuid().ToString(); CurrentObj.AM_BankCode = "07";//银行代码 CurrentObj.AM_CreateDate = DateTime.Parse(VMHelp.NowTime); //bool result = client.Add(CurrentObj); //对象赋值转换 FundsRegulatoryClient.SqlTransSvr.JG_AccountManageInfo tempacc = new FundsRegulatoryClient.SqlTransSvr.JG_AccountManageInfo(); tempacc.AM_ID = CurrentObj.AM_ID; tempacc.AM_BankCode = VMHelp.BankCode;//银行代码 tempacc.AM_CreateDate = DateTime.Parse(VMHelp.NowTime); tempacc.AM_CorpName = CurrentObj.AM_CorpName; tempacc.AM_ItemName = CurrentObj.AM_ItemName; tempacc.AM_JgAccount = CurrentObj.AM_JgAccount; tempacc.AM_ProjectCode = CurrentObj.AM_ProjectCode; tempacc.AM_UseFlag = CurrentObj.AM_UseFlag; tempacc.AM_zhmc = CurrentObj.AM_zhmc; tempacc.AM_Person = CurrentObj.AM_Person;; FundsRegulatoryClient.SqlTransSvr.DayBalance db = new FundsRegulatoryClient.SqlTransSvr.DayBalance(); //每天余额表添加一条 db.DB_ID = CurrentObj.AM_ID; db.DB_AccountNum = CurrentObj.AM_JgAccount; db.DB_Balance = 0; db.DB_InterestRate = rate[0].InterestRate; //利率; db.DB_Time = DateTime.Parse(DateTime.Now.ToShortDateString()); db.ID = Guid.NewGuid().ToString(); // bool result2 = InterestClient.AddJG_DayBalanceInfo(db); //季度结息表增加一条 FundsRegulatoryClient.SqlTransSvr.SeasonInterest si = new FundsRegulatoryClient.SqlTransSvr.SeasonInterest(); DateTime?dt = FinancialRegulation.Tools.HelpClass.Current.SYSCONFIG.PayAccuralDate; if (dt == null || dt.Value.AddMonths(3) < DateTime.Parse(DateTime.Now.ToShortDateString())) { VMHelp.ShowMessage("请先设置结息日期", false); return; } if (dt.Value < DateTime.Parse(DateTime.Now.ToShortDateString())) { si.SI_Time = dt.Value.AddMonths(3); } else { si.SI_Time = dt.Value; } //si.SI_Time = db.DB_Time.Value.AddMonths(3); si.SI_ID = CurrentObj.AM_ID; si.SI_AccountNum = db.DB_AccountNum; si.ID = Guid.NewGuid().ToString(); // bool result3 = InterestClient.AddJG_SeasonInterestInfo(si); if (tranClient.CreateAccountSIDB(tempacc, si, db, 1)) { VMHelp.ShowMessage("开户成功!", true); windowClose(); } else { VMHelp.ShowMessage("开户信息保存失败", false); } } else { VMHelp.ShowMessage("请先设置利率", false); } } } else if (Check() && VMHelp.AskMessage("确认要进行修改?")) { bool result = client.Update(CurrentObj); if (result) { int index = this.Models.IndexOf(para); if (index > -1) { this.Models[index] = CurrentObj; } VMHelp.ShowMessage("账户修改成功!", true); windowClose(); } else { VMHelp.ShowMessage("账户修改信息保存失败", false); } } }
/// <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); } }
//TODO:在此处添加命令 #endregion 命令定义 #region 命令方法 /// <summary> /// 利息结算 /// </summary> public void InterestCommandExecute() { bool ISinterest = false; //if (!Check()) { return; } if (!VMHelp.AskMessage("是否进行结息?")) { return; } if (DayBalanceList.Count < 1) { VMHelp.ShowMessage("当前余额表为空,无法结息", false); return; } SeasonInterest si = new SeasonInterest(); si.SI_AccountNum = SelectedSeanson.SI_AccountNum; si.SI_ID = SelectedSeanson.SI_ID; DateTime?dt = FinancialRegulation.Tools.HelpClass.Current.SYSCONFIG.PayAccuralDate; if (dt == null) { //if (dt < DateTime.Parse(DateTime.Now.ToShortDateString())) //{ VMHelp.ShowMessage("请先设置结息日期", false); return; //} } else if (dt > DateTime.Parse(DateTime.Now.ToShortDateString()) || SelectedSeanson.SI_Time != dt.Value) { VMHelp.AskMessage("结息日期为" + VMHelp.SYSCONFIG.PayAccuralDate.Value.ToShortDateString() + ",不能进行结息"); return; } else { FundsRegulatoryClient.SysConfigClient client = FundsRegulatoryClient.SysConfigClient.Instance; VMHelp.SYSCONFIG.PayAccuralDate = VMHelp.SYSCONFIG.PayAccuralDate.Value.AddMonths(3); client.Update(VMHelp.SYSCONFIG); } ObservableCollection <DayBalance> temp = new ObservableCollection <DayBalance>(); ObservableCollection <FundsRegulatoryClient.SqlTransSvr.DayBalance> Tran_temp = new ObservableCollection <FundsRegulatoryClient.SqlTransSvr.DayBalance>(); decimal?money = 0; foreach (DayBalance db in DayBalanceList) { db.DB_Interest = db.DB_InterestRate * db.DB_Balance / 365; money += db.DB_Interest; money = decimal.Parse(money.Value.ToString("f2")); temp.Add(db); FundsRegulatoryClient.SqlTransSvr.DayBalance Tran_db = new FundsRegulatoryClient.SqlTransSvr.DayBalance(); Tran_db.ID = db.ID; Tran_db.DB_Interest = db.DB_Interest; Tran_db.DB_InterestRate = db.DB_InterestRate; Tran_temp.Add(Tran_db); } money = decimal.Parse(money.Value.ToString("f2")); //结息时,将利息加到之后的余额上。 if (Tran_temp == null || Tran_temp.Count == 0) { return; } foreach (var item in MoreInterestList) { item.DB_Balance += money; Tran_temp.Add(item); } DayBalanceList.Clear(); DayBalanceList = temp; InterestAmount = money; si.SI_Money = money; si.SI_Time = SelectedSeanson.SI_Time; si.SI_Memo = Memo; si.SI_BankSerialNumber = VMHelp.ServiceNo; si.SI_BankTellerID = VMHelp.UserCode; si.SI_CertificateNum = VMHelp.BankCode + DateTime.Now.ToString("yyyyMMdd"); si.ID = SelectedSeanson.ID; //利息消息 //Request07 request = new Request07(); //request.DepositNum = SelectedSeanson.SI_CertificateNum; //request.BankCode = VMHelp.BankCode; //request.BusinessCode = Tools.PublicData.InterestRecord; //request.InterestAmount = money; //request.ProjectCode = SelectedAccount.AccountInfo.AM_ProjectCode; //request.RecordInstr = Memo; ////消息发送 //response = new Response07(); //try //{ // response = SendMessage<Response07>(request, VMHelp.PointCode, VMHelp.UserCode);//发送Messageresponse.ReturnCode =="03" //} //catch (Exception ex) //{ // SendExcetpion(ex); // return; //} //if (response.ReturnCode != Tools.PublicData.ResponseSuccess)// && response.ReturnCode == Tools.PublicData.) //{ VMHelp.ShowMessage(Tools.HelpClass.Current.MsgDIC[response.ReturnCode], false); return; } //if (response.ReturnCode == Tools.PublicData.DepositSuccess && !VMHelp.AskMessage("缴款书已完成缴费,是否存数据库?")) //{ // return; //} FundsRegulatoryClient.SqlTransSvr.SeasonInterest SI_temp = new FundsRegulatoryClient.SqlTransSvr.SeasonInterest(); SI_temp.SI_Money = si.SI_Money; //SI_temp.SI_Time = si.SI_Time; SI_temp.SI_Memo = si.SI_Memo; SI_temp.SI_BankSerialNumber = si.SI_BankSerialNumber;//本系统产生的流水号 SI_temp.SI_BankTellerID = si.SI_BankTellerID; SI_temp.SI_CertificateNum = si.SI_CertificateNum; SI_temp.ID = SelectedSeanson.ID; if (SelectedSeanson.SI_Time < DateTime.Parse(DateTime.Now.ToShortDateString())) { SI_temp.SI_Time = SelectedSeanson.SI_Time; si.SI_Time = SelectedSeanson.SI_Time; } if (!TranClient.Update_DbAndSI(Tran_temp.ToList <FundsRegulatoryClient.SqlTransSvr.DayBalance>(), SI_temp, 2)) { VMHelp.ShowMessage("结息失败", false); return; } //foreach (DayBalance db in DayBalanceList) //{ // InterestClient.UpdateJG_DayBalanceInfo(db); //} //InterestClient.UpdateJG_SeasonInterestInfo(si); //季度结息新插入一条 int index = dg.SelectedIndex; if (index > -1) { SeansonList[index] = si; dg.SelectedIndex = index; } //插入一条季度结息 SeasonInterest Insert = new SeasonInterest(); Insert.ID = VMHelp.GUID; Insert.SI_Time = DateTime.Parse(DateTime.Now.ToShortDateString()).AddMonths(3); if (SelectedSeanson.SI_Time < DateTime.Parse(DateTime.Now.ToShortDateString())) { Insert.SI_Time = SelectedSeanson.SI_Time.Value.AddMonths(3); FundsRegulatoryClient.SysConfigClient client = FundsRegulatoryClient.SysConfigClient.Instance; VMHelp.SYSCONFIG.PayAccuralDate = Insert.SI_Time; client.Update(VMHelp.SYSCONFIG); } Insert.SI_AccountNum = si.SI_AccountNum; Insert.SI_ID = si.SI_ID; this.SeansonList.Add(Insert); InterestClient.AddJG_SeasonInterestInfo(Insert); //if (ISinterest) //{ //if (!VMHelp.AskMessage("是否将 " + VMHelp.SYSCONFIG.PayAccuralDate.Value.ToShortDateString() + " 设置为新的结息日期")) //{ // return; //} // } VMHelp.ShowMessage(true); FlushExecute(); }
/// <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); } }