コード例 #1
0
        private void BindCustomerData()
        {
            StripeCustomerLabel.Text = string.Format("<a target=\"_blank\" class=\"blue\" href=\"{1}\">Stripe Account: {0}</a>",
                                                     CustomerInfosDetails.StripeCustomerId,
                                                     string.Format(Constant.StripeCustomerLink, CustomerInfosDetails.StripeCustomerId));
            FirstNameText.Text  = CustomerInfosDetails.FirstName;
            LastNameText.Text   = CustomerInfosDetails.LastName;
            CustomerIdText.Text = CustomerInfosDetails.CustomerId.ToString();
            EmailText.Text      = CustomerInfosDetails.EmailAddress;
            ZipCodeText.Text    = CustomerInfosDetails.ZipCode;
            //PasswordText.Text = CustomerInfosDetails.Password;
            StripeCustomerIdText.Text = CustomerInfosDetails.StripeCustomerId;
            CreatedDateText.Text      = string.Format("{0:MMM dd, yyyy hh:mm tt} PDT",
                                                      CustomerInfosDetails.CreatedDate.ToLosAngerlesTime());

            var discount = _customerInfoRepository.GetSubscriptionDiscount(CustomerInfosDetails.CustomerId);

            if (discount != null)
            {
                var subscription = _customerInfoRepository.GetSubscriptionActiveByDiscountId(discount.Id);
                if (subscription != null)
                {
                    MembershipNameText.Text = string.Format("{0} - {1} - {2}", subscription.Name, Helper.FormatPrice(subscription.Price), subscription.ProductHighlight);
                }
                MembershipIDText.Text      = discount.Code;
                MembershipCreatedText.Text = discount.StartDate.HasValue ? string.Format("{0:MMM dd, yyyy hh:mm tt} PDT",
                                                                                         discount.StartDate.Value.ToLosAngerlesTime()) : string.Empty;
            }

            if (CustomerInfosDetails.IsActive)
            {
                ActiveButton.Visible   = false;
                Deactivebutton.Visible = true;
            }
            else
            {
                ActiveButton.Visible   = true;
                Deactivebutton.Visible = false;
            }
        }