protected void btnSave_Click(object sender, EventArgs e)
    {
        messageContent.InnerHtml = "";

        if (String.IsNullOrEmpty(lbUserID.Text.Trim()))
        {
            messageContent.InnerHtml = GetLocalResourceObject("SaveError2").ToString();
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "RestLoadStyle('0');", true);
            return;
        }

        string strBackCashAmount = (!String.IsNullOrEmpty(lbBackCashAmount.Text.Trim()) && lbBackCashAmount.Text.Trim().IndexOf('.') >= 0) ? lbBackCashAmount.Text.Trim().Substring(0, lbBackCashAmount.Text.Trim().IndexOf('.')) : lbBackCashAmount.Text.Trim();
        if (String.IsNullOrEmpty(lbBackCashAmount.Text.Trim()) || !ChkNumber(strBackCashAmount))
        {
            messageContent.InnerHtml = GetLocalResourceObject("SaveError7").ToString();
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "RestLoadStyle('0');", true);
            return;
        }

        string errMsg = string.Empty;
        if ("0".Equals(hidCommonType.Value.Trim()) && (String.IsNullOrEmpty(txtBankOwner.Text.Trim()) || String.IsNullOrEmpty(txtBankName.Text.Trim()) || String.IsNullOrEmpty(txtBankBranch.Text.Trim()) || String.IsNullOrEmpty(txtBankCardNumber.Text.Trim())))
        {
            errMsg = GetLocalResourceObject("SaveError3").ToString();
        }
        else if ("1".Equals(hidCommonType.Value.Trim()) && (String.IsNullOrEmpty(txtBackTel.Text.Trim())))
        {
            errMsg = GetLocalResourceObject("SaveError4").ToString();
        }
        else if ("2".Equals(hidCommonType.Value.Trim()) && (String.IsNullOrEmpty(txtBao.Text.Trim())))
        {
            errMsg = GetLocalResourceObject("SaveError5").ToString();
        }
        else if ("2".Equals(hidCommonType.Value.Trim()) && (String.IsNullOrEmpty(txtBaoName.Text.Trim())))
        {
            errMsg = GetLocalResourceObject("SaveError8").ToString();
        }

        if (!String.IsNullOrEmpty(errMsg))
        {
            messageContent.InnerHtml = errMsg;
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "RestLoadStyle('0');", true);
            return;
        }

        _cashbackEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _cashbackEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _cashbackEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _cashbackEntity.LogMessages.IpAddress = UserSession.Current.UserIP;

        _cashbackEntity.CashBackDBEntity = new List<CashBackDBEntity>();
        CashBackDBEntity cashbackDBEntity = new CashBackDBEntity();
        cashbackDBEntity.UserID = lbUserID.Text.Trim();
        cashbackDBEntity.OrderNo = lbOrderNo.Text.Trim();
        cashbackDBEntity.BackCashAmount = lbBackCashAmount.Text.Trim();
        cashbackDBEntity.BackCashType = hidCommonType.Value.Trim();
        cashbackDBEntity.BankOwner = txtBankOwner.Text.Trim();
        cashbackDBEntity.BankName = txtBankName.Text.Trim();
        cashbackDBEntity.BankBranch = txtBankBranch.Text.Trim();
        cashbackDBEntity.BankCardNumber = txtBankCardNumber.Text.Trim();
        cashbackDBEntity.BackTel = txtBackTel.Text.Trim();
        cashbackDBEntity.BackBao = txtBao.Text.Trim();
        cashbackDBEntity.BackBaoName = txtBaoName.Text.Trim();
        cashbackDBEntity.Remark = txtRemark.Text.Trim();
        cashbackDBEntity.BackInType = "0";
        _cashbackEntity.CashBackDBEntity.Add(cashbackDBEntity);
        _cashbackEntity = CashBackBP.SaveCashBackRequest(_cashbackEntity);
        int iResult = _cashbackEntity.Result;

        _commonEntity.LogMessages = _cashbackEntity.LogMessages;
        _commonEntity.CommonDBEntity = new List<CommonDBEntity>();
        CommonDBEntity commonDBEntity = new CommonDBEntity();
        commonDBEntity.Event_Type = "创建提现申请-保存";
        commonDBEntity.Event_ID = lbUserID.Text.Trim();
        string conTent = GetLocalResourceObject("EventInsertMessage").ToString();

        conTent = string.Format(conTent, cashbackDBEntity.UserID, cashbackDBEntity.BackCashAmount, cashbackDBEntity.BackCashType, cashbackDBEntity.BankName, cashbackDBEntity.BankBranch, cashbackDBEntity.BankCardNumber, cashbackDBEntity.BackTel, cashbackDBEntity.BackBao, cashbackDBEntity.Remark, cashbackDBEntity.BackInType);
        commonDBEntity.Event_Content = conTent;

        if (iResult == 1)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("SaveSuccess").ToString();
            messageContent.InnerHtml = GetLocalResourceObject("SaveSuccess").ToString();
        }
        else
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("SaveError1").ToString() + _cashbackEntity.ErrorMSG;
            messageContent.InnerHtml = GetLocalResourceObject("SaveError1").ToString() + _cashbackEntity.ErrorMSG;
        }
        _commonEntity.CommonDBEntity.Add(commonDBEntity);
        CommonBP.InsertEventHistory(_commonEntity);

        this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "RestLoadStyle('0');", true);
    }
    protected void btnSet_Click(object sender, EventArgs e)
    {
        messageContent.InnerHtml = "";
        if (String.IsNullOrEmpty(txtOrderNo.Text.Trim()))
        {
            messageContent.InnerHtml = GetLocalResourceObject("SaveError2").ToString();
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "RestLoadStyle('0');", true);
            return;
        }

        _cashbackEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _cashbackEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _cashbackEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _cashbackEntity.LogMessages.IpAddress = UserSession.Current.UserIP;

        _cashbackEntity.CashBackDBEntity = new List<CashBackDBEntity>();
        CashBackDBEntity cashbackDBEntity = new CashBackDBEntity();
        cashbackDBEntity.OrderNo = txtOrderNo.Text.Trim();
        _cashbackEntity.CashBackDBEntity.Add(cashbackDBEntity);

        DataSet dsResult = CashBackBP.BindOrderInfo(_cashbackEntity).QueryResult;

        if (dsResult.Tables.Count == 0 || dsResult.Tables[0].Rows.Count == 0)
        {
            messageContent.InnerHtml = GetLocalResourceObject("WarningMessage").ToString();
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "RestLoadStyle('0');", true);
            return;
        }

        if (!"8".Equals(dsResult.Tables[0].Rows[0]["FOG_AUDITSTATUS"].ToString()))
        {
            messageContent.InnerHtml = GetLocalResourceObject("WarningMessageAudi").ToString();
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "RestLoadStyle('0');", true);
            return;
        }

        if (!"2".Equals(dsResult.Tables[0].Rows[0]["CashTaskStatus"].ToString()))
        {
            hidCashSN.Value = dsResult.Tables[0].Rows[0]["CashSN"].ToString();
            messageContent.InnerHtml = GetLocalResourceObject("WarningMessageExist").ToString();
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "RestLoadStyle('0');", true);
            return;
        }

        lbOrderNo.Text = dsResult.Tables[0].Rows[0]["fog_order_num"].ToString();
        lbHotelNM.Text = dsResult.Tables[0].Rows[0]["hotel_name"].ToString();
        lbInDate.Text = dsResult.Tables[0].Rows[0]["INDATE"].ToString();
        lbConPer.Text = dsResult.Tables[0].Rows[0]["contact_name"].ToString();
        lbTiceketCode.Text = dsResult.Tables[0].Rows[0]["ticket_usercode"].ToString();
        lbBackAmount.Text = dsResult.Tables[0].Rows[0]["ticket_amount"].ToString();
        lbBackCashAmount.Text = dsResult.Tables[0].Rows[0]["ticket_amount"].ToString();
        lbOrderAmount.Text = dsResult.Tables[0].Rows[0]["book_total_price"].ToString();

        lbUserID.Text = dsResult.Tables[0].Rows[0]["login_mobile"].ToString();
        lbCanamount.Text = dsResult.Tables[0].Rows[0]["can_applictaion_amount"].ToString();
        lbAuditamount.Text = dsResult.Tables[0].Rows[0]["audit_amount"].ToString();
        lbPullingamount.Text = dsResult.Tables[0].Rows[0]["pulling_amount"].ToString();

        //txtHotelNM.Text = dsResult.Tables[0].Rows[0]["HOTELNM"].ToString();
        //txtHotelNMEN.Text = dsResult.Tables[0].Rows[0]["HotelNMEN"].ToString();
        //dpOpenDate.Value = dsResult.Tables[0].Rows[0]["OPENDATE"].ToString();
        //dpRepairDate.Value = dsResult.Tables[0].Rows[0]["REPAIRDATE"].ToString();
        //txtAddress.Text = dsResult.Tables[0].Rows[0]["ADDRESS"].ToString();
        //txtWebSite.Text = dsResult.Tables[0].Rows[0]["WEBSITE"].ToString();
        //txtPhone.Text = dsResult.Tables[0].Rows[0]["PHONE"].ToString();
        //txtFax.Text = dsResult.Tables[0].Rows[0]["FAX"].ToString();
        this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "RestLoadStyle('0');", true);
    }
    protected void btnInSet_Click(object sender, EventArgs e)
    {
        inMessageContent.InnerHtml = "";

        if (String.IsNullOrEmpty(txtInUserID.Text.Trim()))
        {
            inMessageContent.InnerHtml = GetLocalResourceObject("SaveError6").ToString();
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "RestLoadStyle('1');", true);
            return;
        }

        _cashbackEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _cashbackEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _cashbackEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _cashbackEntity.LogMessages.IpAddress = UserSession.Current.UserIP;

        _cashbackEntity.CashBackDBEntity = new List<CashBackDBEntity>();
        CashBackDBEntity cashbackDBEntity = new CashBackDBEntity();
        cashbackDBEntity.UserID = txtInUserID.Text.Trim();
        _cashbackEntity.CashBackDBEntity.Add(cashbackDBEntity);

        DataSet dsResult = CashBackBP.BindOrderInfoByUser(_cashbackEntity).QueryResult;

        if (dsResult.Tables.Count == 0 || dsResult.Tables[0].Rows.Count == 0)
        {
            inMessageContent.InnerHtml = GetLocalResourceObject("WarningInMessage").ToString();
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "RestLoadStyle('1');", true);
            return;
        }

        lbInUserID.Text = txtInUserID.Text.Trim();
        lbInCanamount.Text = dsResult.Tables[0].Rows[0]["can_applictaion_amount"].ToString();
        lbInAuditamount.Text = dsResult.Tables[0].Rows[0]["audit_amount"].ToString();
        lbInPullingamount.Text = dsResult.Tables[0].Rows[0]["pulling_amount"].ToString();

        this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "RestLoadStyle('1');", true);
    }
 /// <summary>
 /// 获取sql中的操作历史
 /// </summary>
 /// <returns></returns>
 private DataTable GetCashBackHistoryByEventHistory()
 {
     CashBackEntity _cashBackEntity = new CashBackEntity();
     _cashBackEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
     _cashBackEntity.LogMessages.Userid = UserSession.Current.UserAccount;
     _cashBackEntity.LogMessages.Username = UserSession.Current.UserDspName;
     _cashBackEntity.LogMessages.IpAddress = UserSession.Current.UserIP;
     _cashBackEntity.CashBackDBEntity = new List<CashBackDBEntity>();
     CashBackDBEntity cashBackDBEntity = new CashBackDBEntity();
     cashBackDBEntity.Sn = this.HidSN.Value;
     cashBackDBEntity.Type = "用户提现处理--修改支付宝姓名";
     _cashBackEntity.CashBackDBEntity.Add(cashBackDBEntity);
     DataTable dtResult = CashBackBP.GetCashBackHistoryByEventHistory(_cashBackEntity).QueryResult.Tables[0];
     return dtResult;
 }
    /// <summary>
    /// 手机充值接口
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void MobilePort_Click(object sender, EventArgs e)
    {
        CashBackEntity _cashBackEntity = new CashBackEntity();
        _cashBackEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _cashBackEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _cashBackEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _cashBackEntity.LogMessages.IpAddress = UserSession.Current.UserIP;
        _cashBackEntity.CashBackDBEntity = new List<CashBackDBEntity>();
        CashBackDBEntity cashBackDBEntity = new CashBackDBEntity();
        cashBackDBEntity.LoginMobile = lbl_User_ID_mobile.Text;//登录号
        cashBackDBEntity.BackCashAmount = lbl_pick_cash_amount_mobile.Text;//充值金额
        cashBackDBEntity.BackCashType = "3";//3:手机充值
        cashBackDBEntity.Phone = lbl_recharge_phone_number_mobile.Text;//手机充值号码
        cashBackDBEntity.Sn = this.HidSN.Value;//SN
        cashBackDBEntity.CreateUser = UserSession.Current.UserAccount;//操作人
        cashBackDBEntity.Remark = this.txtRemark.Text;

        _cashBackEntity.CashBackDBEntity.Add(cashBackDBEntity);
        _cashBackEntity = CashBackBP.autoPay(_cashBackEntity);

        _commonEntity.LogMessages = _cashBackEntity.LogMessages;
        _commonEntity.CommonDBEntity = new List<CommonDBEntity>();
        CommonDBEntity commonDBEntity = new CommonDBEntity();
        commonDBEntity.Event_Type = "用户提现处理--手机充值";
        commonDBEntity.Event_ID = this.HidSN.Value;
        commonDBEntity.Event_Content = "SN:" + this.HidSN.Value + "登录手机号:" + lbl_User_ID_mobile.Text + ",充值金额:" + lbl_pick_cash_amount_mobile.Text + ",充值手机号码:" + lbl_recharge_phone_number_mobile.Text + ",操作人:" + UserSession.Current.UserAccount + ",描述:" + txtRemark.Text;
        if (_cashBackEntity.Result == 1)
        {
            commonDBEntity.Event_Result = "操作成功,提示:" + _cashBackEntity.ErrorMSG;
            _commonEntity.CommonDBEntity.Add(commonDBEntity);
            CommonBP.InsertEventHistory(_commonEntity);
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "tishi", "alert('操作成功,原因:" + _cashBackEntity.ErrorMSG + "!');", true);
        }
        else
        {
            commonDBEntity.Event_Result = "操作失败,原因:" + _cashBackEntity.ErrorMSG;
            _commonEntity.CommonDBEntity.Add(commonDBEntity);
            CommonBP.InsertEventHistory(_commonEntity);
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "tishi", "alert('操作失败,原因:" + _cashBackEntity.ErrorMSG + "!');", true);
        }
    }
    /// <summary>
    /// 修改支付宝用户名
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnEditAlipayName_Click(object sender, EventArgs e)
    {
        CashBackEntity _cashBackEntity = new CashBackEntity();
        _cashBackEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _cashBackEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _cashBackEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _cashBackEntity.LogMessages.IpAddress = UserSession.Current.UserIP;
        _cashBackEntity.CashBackDBEntity = new List<CashBackDBEntity>();
        CashBackDBEntity cashBackDBEntity = new CashBackDBEntity();
        cashBackDBEntity.AlipayName = this.HidAlipayName.Value;//支付宝姓名
        cashBackDBEntity.Sn = this.HidSN.Value;//SN

        _cashBackEntity.CashBackDBEntity.Add(cashBackDBEntity);
        //_cashBackEntity = CashBackBP.autoPay(_cashBackEntity);
        _cashBackEntity.Result = 1;
        _commonEntity.LogMessages = _cashBackEntity.LogMessages;
        _commonEntity.CommonDBEntity = new List<CommonDBEntity>();
        CommonDBEntity commonDBEntity = new CommonDBEntity();
        commonDBEntity.Event_Type = "用户提现处理--修改支付宝姓名";
        commonDBEntity.Event_ID = this.HidSN.Value;
        commonDBEntity.Event_Content = "处理备注:" + txtRemark.Text + ",支付宝姓名:" + HidAlipayName.Value + ",操作人:" + UserSession.Current.UserAccount;
        if (_cashBackEntity.Result >= 1)
        {
            this.btnOk.Text = "付款";
            this.btnOk.Enabled = true;
            this.UpdatePanel1.Update();
            commonDBEntity.Event_Result = "成功";
            _commonEntity.CommonDBEntity.Add(commonDBEntity);
            CommonBP.InsertEventHistory(_commonEntity);
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "tishi1", "alert('修改成功!');", true);
            ScriptManager.RegisterStartupScript(this.UpdatePanel3, this.GetType(), "alertClose", "BtnCompleteStyle();", true);
            BindLToCash();
        }
        else
        {
            commonDBEntity.Event_Result = "失败";
            _commonEntity.CommonDBEntity.Add(commonDBEntity);
            CommonBP.InsertEventHistory(_commonEntity);
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "tishi1", "alert('修改失败!');", true);
            ScriptManager.RegisterStartupScript(this.UpdatePanel3, this.GetType(), "alertClose", "BtnCompleteStyle();", true);
            BindLToCash();
        }
    }
    /// <summary>
    /// 支付宝
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void AlipayPort_Click(object sender, EventArgs e)
    {
        CashBackEntity _cashBackEntity = new CashBackEntity();
        _cashBackEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _cashBackEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _cashBackEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _cashBackEntity.LogMessages.IpAddress = UserSession.Current.UserIP;
        _cashBackEntity.CashBackDBEntity = new List<CashBackDBEntity>();
        CashBackDBEntity cashBackDBEntity = new CashBackDBEntity();
        cashBackDBEntity.LoginMobile = lbl_User_ID_alipay.Text;//登录号
        cashBackDBEntity.BackCashAmount = lbl_pick_cash_amount_alipay.Text;//充值金额
        cashBackDBEntity.BackCashType = "2";//2:支付宝返还
        cashBackDBEntity.AlipayAccount = lbl_Alipay_Port.Text;//支付宝账号
        //cashBackDBEntity.AlipayAccount = "*****@*****.**";
        cashBackDBEntity.AlipayName = this.HidAlipayName.Value;//支付宝姓名
        //cashBackDBEntity.AlipayName = "123";//支付宝姓名
        cashBackDBEntity.Sn = this.HidSN.Value;//SN
        cashBackDBEntity.CreateUser = UserSession.Current.UserAccount;//操作人
        cashBackDBEntity.Remark = this.txtRemark.Text;

        _cashBackEntity.CashBackDBEntity.Add(cashBackDBEntity);
        _cashBackEntity = CashBackBP.autoPay(_cashBackEntity);

        _commonEntity.LogMessages = _cashBackEntity.LogMessages;
        _commonEntity.CommonDBEntity = new List<CommonDBEntity>();
        CommonDBEntity commonDBEntity = new CommonDBEntity();
        commonDBEntity.Event_Type = "用户提现处理--支付宝";
        commonDBEntity.Event_ID = this.HidSN.Value;
        commonDBEntity.Event_Content = "SN:" + this.HidSN.Value + "登录手机号:" + lbl_User_ID_alipay.Text + ",充值金额:" + lbl_pick_cash_amount_alipay.Text + ",支付宝账号:" + lbl_Alipay_Port.Text + ",支付宝姓名:" + HidAlipayName.Value + ",操作人:" + UserSession.Current.UserAccount + ",描述:" + txtRemark.Text;
        if (_cashBackEntity.Result == 1)
        {
            commonDBEntity.Event_Result = "操作成功,提示:" + _cashBackEntity.ErrorMSG;
            _commonEntity.CommonDBEntity.Add(commonDBEntity);
            CommonBP.InsertEventHistory(_commonEntity);
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "tishi1", "alert('操作成功,原因:" + _cashBackEntity.ErrorMSG + "!');", true);
        }
        else
        {
            commonDBEntity.Event_Result = "操作失败,原因:" + _cashBackEntity.ErrorMSG;
            _commonEntity.CommonDBEntity.Add(commonDBEntity);
            CommonBP.InsertEventHistory(_commonEntity);
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "tishi1", "alert('操作失败,原因:" + _cashBackEntity.ErrorMSG + "!');", true);
        }
    }