/// <summary>
        /// 设置按钮是否可以
        /// </summary>
        /// <param name="d"></param>
        /// <param name="e"></param>
        private static void SetCmdEnable(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            PaymentDetails ower = d as PaymentDetails;

            if (ower.ChuJinInfo.State == "0")
            {
                ower.IsCmdEnable = true;
                ower.CanJuJue    = true;
            }
            else
            {
                ower.IsCmdEnable = false;
                if (ower.ChuJinInfo.State == "4")
                {
                    ower.CanJuJue = true;
                }
                else
                {
                    ower.CanJuJue = false;
                }
            }
        }
 /// <summary>
 /// 付款
 /// </summary>
 /// <param name="obj"></param>
 void win_PaymentEvent(PaymentDetails obj)
 {
     string msg = "";
     if (CurChuJin != null && CurChuJin.State == "0")
     {
         MessageBoxResult result = MessageBox.Show("确定付款吗?", "提示信息", MessageBoxButton.OKCancel, MessageBoxImage.Information);
         if (result == MessageBoxResult.OK)
         {
             string state = "";
             ErrType err = _businessService.ProcessChuJin(CurChuJin.ApplyId, _loginID, ref state);
             if (err.Err == ERR.SUCCESS)
             {
                 //if (err.Dec == "3")
                 //{
                 //    CurChuJin.State = "3";
                 //    MessageBox.Show("银行正在付款,请稍后查看付款状态", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
                 //}
                 //else if (err.Dec == "4")
                 //{
                 //    CurChuJin.State = "4";
                 //    MessageBox.Show("银行付款失败,请手工调账(出金金额+3元手续费)至客户账户后,让客户重新发起出金申请", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
                 //}
                 //else
                 //{
                 //    CurChuJin.State = "1";
                 //    MessageBox.Show("付款成功", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
                 //}
                 obj.Close();
                
             }
             else
             {
                 MessageBox.Show("付款失败", "", MessageBoxButton.OK, MessageBoxImage.Warning);
             }
             CurChuJin.State = state;
         }
     }
     else
     {
         MessageBox.Show("请选择状态为【已申请】的数据!", "提示信息", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
        void win_RefusedEvent(PaymentDetails obj)
        {
            if (MessageBox.Show("确定拒绝吗?", "提示", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
            {
                ErrType err = _businessService.RefusedChuJin(CurChuJin.ApplyId, _loginID);
                if (err == GeneralErr.Success)
                {
                    MessageBox.Show("操作成功!");
                    //GetChuJinExecuted();
                    obj.Close();
                    CurChuJin.State = "2";
                    
                }
                else
                {

                    MessageBox.Show(err.ErrMsg);
                }
            }
        }
        /// <summary>
        /// 显示出金详情
        /// </summary>
        public void ShowPaymentDetails()
        {
            if (CurChuJin == null)
            {
                MessageBox.Show("请先选择需要查看的数据!");
                return;
            }

            FcQueryConInfomation infomation = new FcQueryConInfomation
            {
                LoginID = _loginID,
                Account = CurChuJin.Account,
                Endtime = DateTime.Today.AddDays(1),
                Starttime = DateTime.Today.AddYears(-1),
                OrgName = null,
                Reason = "4"
            };
            int pageCount = 0;
            List<FundChangeInformation> list = new List<FundChangeInformation>();
            ClientFundChangeInfo InFundInfo = _businessService.GetMultiFundChangeWithPage(infomation, 1, 5, ref  pageCount);

            if (!InFundInfo.Result)
            {
                MessageBox.Show(FundChangeInfo.Desc, "错误", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;

            }

            infomation.Reason = "5";
            ClientFundChangeInfo OutFundInfo = _businessService.GetMultiFundChangeWithPage(infomation, 1, 5, ref  pageCount);

            if (!OutFundInfo.Result)
            {
                MessageBox.Show(FundChangeInfo.Desc, "错误", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;

            }
             
            PaymentDetails win = new PaymentDetails() 
            { 
                ChuJinInfo = CurChuJin,
                InFundInfo = InFundInfo,
                OutFundInfo = OutFundInfo
            };
            win.PaymentEvent += new Action<PaymentDetails>(win_PaymentEvent);
            win.RefusedEvent += new Action<PaymentDetails>(win_RefusedEvent);
            win.ShowDialog();

        }