Пример #1
0
        public static string GetCreditCard(RestCommand command, int creditCardID)
        {
            CreditCard creditCard = CreditCards.GetCreditCard(command.LoginUser, creditCardID);

            if (creditCard.OrganizationID != command.Organization.OrganizationID)
            {
                throw new RestException(HttpStatusCode.Unauthorized);
            }
            return(creditCard.GetXml("CreditCard", true));
        }
    private void LoadCredit(int creditID)
    {
        CreditCard    creditCard = (CreditCard)CreditCards.GetCreditCard(UserSession.LoginUser, creditID);
        StringBuilder builder    = new StringBuilder();

        builder.Append("<tr><td style=\"width: 200px;\"><strong>Name: </strong></td><td>");
        builder.Append(creditCard.NameOnCard + "</td></tr>");
        builder.Append("<tr><td><strong>Number: </strong></td><td>");
        builder.Append(creditCard.DisplayNumber + "</td></tr>");
        builder.Append("<tr><td><strong>Type: </strong></td><td>");
        builder.Append(DataUtils.CreditCardTypeString(creditCard.CreditCardType) + "</td></tr>");
        builder.Append("<tr><td><strong>Security Code: </strong></td><td>");
        builder.Append(creditCard.SecurityCode + "</td></tr>");
        builder.Append("<tr><td><strong>Expiration Date: </strong></td><td>");
        builder.Append(creditCard.ExpirationDate.ToString() + "</td></tr>");

        litCredit.Text = builder.ToString();
    }