Beispiel #1
0
        /// <summary>
        /// 加载card信息
        /// </summary>
        public void LoadInfo()
        {
            try
            {
                ServiceManager sm = new ServiceManager();

                using (LP2ServiceClient client = sm.StartServiceClient())
                {
                    #region No use
                    //var creditCardInfo = new LP_Service.GetCreditCardRequest();
                    //creditCardInfo.hdr = new LP_Service.ReqHdr();
                    //creditCardInfo.hdr.UserId = loginUser.iUserID;

                    //var rsp = client.GetCreditCard(ref creditCardInfo);

                    //if (rsp.hdr.Successful)
                    //{
                    //    hfCardID.Value = creditCardInfo.Card_ID;
                    //    txbCardNumber.Text = creditCardInfo.Card_Number;
                    //    txbNameonCard.Text = creditCardInfo.Card_First_Name + " " + creditCardInfo.Card_Last_Name;
                    //    txbCardExpiration.Text = creditCardInfo.Card_Exp_Month.ToString() + "/" + creditCardInfo.Card_Exp_Year;

                    //    if (creditCardInfo.Card_SIC != "***")
                    //    {
                    //        txbCardCSCcode.Text = creditCardInfo.Card_SIC;
                    //    }
                    //    else
                    //{
                    //    txbCardCSCcode.Text = "";
                    //}
                    //ddlCardType.SelectedValue = creditCardInfo.Card_Type.ToString();

                    //switch (creditCardInfo.Card_Type)
                    //{
                    //    case CreditCardType.VISA:
                    //        ddlCardType.SelectedValue = "0";
                    //        break;
                    //    case CreditCardType.MasterCard:
                    //        ddlCardType.SelectedValue = "1";
                    //        break;
                    //    case CreditCardType.Amex:
                    //        ddlCardType.SelectedValue = "2";
                    //        break;
                    //    case CreditCardType.Discover:
                    //        ddlCardType.SelectedValue = "3";
                    //        break;
                    //    default: ddlCardType.SelectedValue = "";
                    //        break;
                    //}
                    #endregion

                    txbCardCSCcode.Text   = "";
                    btnAddBalance.Enabled = true;

                    var reqBalance = new LP_Service.GetUserAccountBalanceRequest();
                    reqBalance.hdr        = new LP_Service.ReqHdr();
                    reqBalance.hdr.UserId = loginUser.iUserID;
                    var rspBalance = client.GetUserAccountBalance(reqBalance);

                    if (rspBalance.hdr.Successful)
                    {
                        txbBalance.Text = rspBalance.Balance.ToString("N2");
                    }

                    #region No use
                    //}
                    //else
                    //{
                    //    btnAddBalance.Enabled = false;
                    //}
                    #endregion
                }
            }
            catch (Exception ex)
            {
                PageCommon.AlertMsg(this, "Load error:" + ex.Message);
            }
        }