Ejemplo n.º 1
0
        public void UpdateProfile()
        {
            ProfileBase profile = HttpContext.Current.Profile;

            profile["Address1"]       = address1;
            profile["Address2"]       = address2;
            profile["City"]           = city;
            profile["Region"]         = region;
            profile["PostalCode"]     = postalCode;
            profile["Country"]        = country;
            profile["ShippingRegion"] = shippingRegion;
            profile["DayPhone"]       = dayPhone;
            profile["EvePhone"]       = evePhone;
            profile["MobPhone"]       = mobPhone;
            profile["CreditCard"]     = creditCard;
            MembershipUser user = Membership.GetUser(profile.UserName);

            user.Email = email;
            Membership.UpdateUser(user); try
            {
                SecureCard secureCard = new SecureCard(
                    creditCardHolder, creditCardNumber,
                    creditCardIssueDate, creditCardExpiryDate,
                    creditCardIssueNumber, creditCardType);
                profile["CreditCard"] = secureCard.EncryptedData;
            }

            catch
            {
                creditCard = "";
            }
        }
Ejemplo n.º 2
0
        public ProfileWrapper()
        {
            ProfileBase profile = HttpContext.Current.Profile;

            address1   = (string)profile["Address1"];
            address2   = (string)profile["Address2"];
            city       = (string)profile["City"];
            region     = (string)profile["Region"];
            postalCode = (string)profile["PostalCode"];
            country    = (string)profile["Country"];


            shippingRegion =
                (profile["ShippingRegion"] == null ||
                 (string)profile["ShippingRegion"] == ""
            ? "1" : (string)profile["ShippingRegion"]);
            dayPhone = (string)profile["DayPhone"];
            evePhone = (string)profile["EvePhone"];
            mobPhone = (string)profile["MobPhone"];
            email    = Membership.GetUser(profile.UserName).Email;
            try
            {
                SecureCard secureCard = new SecureCard((string)profile["CreditCard"]);
                creditCard            = secureCard.CardNumberX;
                creditCardHolder      = secureCard.CardHolder;
                creditCardNumber      = secureCard.CardNumber;
                creditCardIssueDate   = secureCard.IssueDate;
                creditCardIssueNumber = secureCard.IssueNumber;
                creditCardExpiryDate  = secureCard.ExpiryDate;
                creditCardType        = secureCard.CardType;
            }
            catch
            {
                creditCard = "Няма въведена.";
            }
        }