/// <summary>
        /// 初始化
        /// </summary>
        private void InitData()
        {
            Hashtable ht = depositManager.GetDataByID(_key);

            if (ht.Count > 0 && ht != null)
            {
                ControlBindHelper.SetWebControls(this.Page, ht);
                if (ht["STATE"].ToString().Equals("2") || ht["STATE"].ToString().Equals("3"))
                {
                    State.Disabled = true;
                    Remark.Enabled = false;
                    Save.Visible   = false;
                    Save.Enabled   = false;
                }
                DepositPayWay.Text = Asiasofti.SmartVehicle.Common.EnumHelper.GetEnumShowName(typeof(Asiasofti.SmartVehicle.Common.Enum.UserFinancialOperatorWay), Convert.ToInt32(ht["DEPOSITPAYWAY"].ToString()));
            }
        }
예제 #2
0
 /// <summary>
 /// 秒退款操作
 /// </summary>
 /// <param name="applyid"></param>
 /// <returns></returns>
 private bool Refund(string applyid)
 {
     try
     {
         bool result = false;
         DepositReturnManager depositManager = new DepositReturnManager();
         Hashtable            ht             = depositManager.GetDataByID(applyid);
         string  state          = SiteHelper.GetHashTableValueByKey(ht, "State");
         string  depositMoney   = SiteHelper.GetHashTableValueByKey(ht, "DepositMoney");
         string  depositPayWay  = SiteHelper.GetHashTableValueByKey(ht, "DepositPayWay");
         string  depositTradeNo = SiteHelper.GetHashTableValueByKey(ht, "DepositTradeNo");
         decimal refundMoney    = 0.00m;
         refundMoney = decimal.Parse(depositMoney);
         string errmsg = "";
         string code   = "";
         if (depositPayWay == "1")
         {
             //查询支付结果 支付宝退款
             AlipayRefund alipay = new AlipayRefund();
             result = alipay.Refund2(depositTradeNo, refundMoney, out errmsg, out code);
         }
         else if (depositPayWay == "2")
         {
             //微信退款
             WxRefund wxpay = new WxRefund();
             result = wxpay.refund2(depositTradeNo, refundMoney, out errmsg);
         }
         else if (depositPayWay == "5")
         {
             //微信公众号退款
             api.weapp.pay.wxpay.WxRefund wxpay = new api.weapp.pay.wxpay.WxRefund();
             result = wxpay.refund2(depositTradeNo, refundMoney, out errmsg);
         }
         if (result)
         {
             result = depositManager.HandleReturnDeposit(applyid, "2", "", "系统");
         }
         return(result);
     }
     catch
     {
         return(false);
     }
 }