예제 #1
0
        /// <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()
        {
            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);
            }
        }