コード例 #1
0
 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;
 }
コード例 #2
0
 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);
 }
コード例 #3
0
 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();
 }