void DoEditAddress(ShipAddressItem item) { AddressId = item.Id; AddressName = item.Name; AddressDescription = item.Description; AddressLongitude = item.AddressLongitude; AddressLatitude = item.AddressLatitude; PhysicalAddress = item.PhysicalAddress; PostalAddress = item.PostalAddress; }
void DoRemoveAddress(ShipAddressItem item) { ShippingAddresses.Remove(item); var deletedItem = new ShipToAddress { MasterId = item.Id, Name = item.Name, PhysicalAddress = item.PhysicalAddress, PostalAddress = item.PostalAddress, Longitude = item.AddressLongitude, Latitude = item.AddressLatitude, Description = item.Description, EntityStatus = (int)EntityStatus.Deleted }; DeletedAddresses.Add(deletedItem); }
void DoAddAddress() { var addressItem = new ShipAddressItem { Id = AddressId, Name = AddressName, Description = AddressDescription, AddressLongitude = AddressLongitude, AddressLatitude = AddressLatitude, PhysicalAddress = PhysicalAddress, PostalAddress = PostalAddress }; var address = ShippingAddresses.FirstOrDefault(n => n.Id == addressItem.Id); if (address != null) { ShippingAddresses.Remove(address); ShippingAddresses.Add(addressItem); } else { addressItem.Id = Guid.NewGuid(); ShippingAddresses.Add(addressItem); } ClearDisplayedAddressItem(); }