public string ProcessAddresses(NopCommerceDataReader dataReader, NopImportContext nopImportContext) { var addressData = dataReader.GetAddressData(); _session.Transact(session => { foreach (var data in addressData) { var country = nopImportContext.FindNew<Country>(data.Country.GetValueOrDefault()); var address = new Address { Address1 = data.Address1, Address2 = data.Address2, City = data.City, Company = data.Company, CountryCode = country == null ? string.Empty : country.ISOTwoLetterCode, FirstName = data.FirstName, LastName = data.LastName, PhoneNumber = data.PhoneNumber, PostalCode = data.PostalCode, StateProvince = data.StateProvince, }; session.Save(address); nopImportContext.AddEntry(data.Id, address); } }); return string.Format("{0} addresses added", addressData.Count); }
public string GetAddress(Address address, string email) { var stringBuilder = new StringBuilder(); stringBuilder.AppendFormat("name={0},", address.Name); stringBuilder.AppendFormat("company={0},", address.Company); stringBuilder.AppendFormat("addr_1={0},", address.Address1); stringBuilder.AppendFormat("addr_2={0},", address.Address2); stringBuilder.AppendFormat("city={0},", address.City); stringBuilder.AppendFormat("state={0},", address.StateProvince); stringBuilder.AppendFormat("post_code={0},", address.PostalCode); stringBuilder.AppendFormat("country={0},", address.GetCountryName()); stringBuilder.AppendFormat("email={0},", email); return stringBuilder.ToString(); }
public void Delete(Address address) { _session.Transact(session => session.Delete(address)); }
public void Update(Address address) { _session.Transact(session => session.Update(address)); }
public void SetBillingAddress(Address address) { _cartSessionManager.SetSessionValue(CurrentBillingAddressKey, _getUserGuid.UserGuid, address); }
public void SetShippingAddress(Address address, Guid? userGuid = null) { _cartSessionManager.SetSessionValue(CurrentShippingAddressKey, userGuid ?? _getUserGuid.UserGuid, address); }
public void SetShippingAddress(Address address) { _cartManager.SetShippingAddress(address); }
public void Save(Address item) { _session.Transact(session => session.SaveOrUpdate(item)); }