private void Update() { var user = GetUserEntity(UserId, _context); user.SetAttributeValue(AttributeMapApproved, Approved); user.SetAttributeValue(AttributeMapLastLogin, LastLogin.ToUniversalTime()); _context.Attach(user); _context.UpdateObject(user); _context.SaveChanges(); _context.Detach(user); }
public override string ToString() { return($@" <customer customer-no=""{CustomerId}""> <credentials> <login>{Email}</login> <password encrypted=""false"">{Password}</password> <enabled-flag>true</enabled-flag> <password-question /> <password-answer /> </credentials> <profile> <salutation/> <title>{Title}</title> <first-name>{FirstName}</first-name> <second-name/> <last-name>{LastName}</last-name> <suffix/> <company-name>{CompanyName}</company-name> <job-title/> <email>{Email}</email> <phone-home>{Phone}</phone-home> <phone-business>{PhoneWork}</phone-business> <phone-mobile/> <fax>{Fax}</fax> <gender></gender> <creation-date>{CreationDate.ToUniversalTime().ToString("yyy-MM-ddTHH:mm:ssZ")}</creation-date> <last-login-time>{LastLogin.ToUniversalTime().ToString("yyy-MM-ddTHH:mm:ssZ")}</last-login-time> <last-visit-time>{LastLogin.ToUniversalTime().ToString("yyy-MM-ddTHH:mm:ssZ")}</last-visit-time> <preferred-locale/> <custom-attributes> <custom-attribute attribute-id=""priceLevel"">{GetPriceLevel}</custom-attribute> </custom-attributes> </profile> <addresses> <address address-id=""Billing"" preferred=""true""> <salutation/> <title/> <first-name>{AttentionFirstName}</first-name> <second-name>{AttentionSecondName}</second-name> <last-name>{AttentionLastName}</last-name> <suffix/> <company-name>{CompanyName}</company-name> <job-title/> <address1>{Address}</address1> <address2>{Address2}</address2> <suite/> <postbox/> <city>{City}</city> <postal-code>{PostalCode}</postal-code> <state-code>{StateAbbrev}</state-code> <country-code>US</country-code> <phone>{Phone}</phone> </address> <address address-id=""Shipping"" preferred=""false""> <salutation/> <title/> <first-name>{ShippingAttentionFirstName}</first-name> <second-name>{ShippingAttentionSecondName}</second-name> <last-name>{ShippingAttentionLastName}</last-name> <suffix/> <company-name>{Shipping_CompanyName}</company-name> <job-title/> <address1>{Shipping_Address}</address1> <address2>{Shipping_Address2}</address2> <suite/> <postbox/> <city>{Shipping_City}</city> <postal-code>{Shipping_PostalCode}</postal-code> <state-code>{Shipping_StateAbbrev}</state-code> <country-code>US</country-code> <phone>{Shipping_Phone}</phone> </address> </addresses> <note/> </customer>"); }