/// <summary> /// Convert a nettiers collection to the ws proxy collection. /// </summary> public static Nettiers.AdventureWorks.Entities.Address Convert(Nettiers.AdventureWorks.Entities.Address outItem, WsProxy.Address item) { if (item != null && outItem != null) { outItem.AddressId = item.AddressId; outItem.AddressLine1 = item.AddressLine1; outItem.AddressLine2 = item.AddressLine2; outItem.City = item.City; outItem.StateProvinceId = item.StateProvinceId; outItem.PostalCode = item.PostalCode; outItem.Rowguid = item.Rowguid; outItem.ModifiedDate = item.ModifiedDate; outItem.AcceptChanges(); } return(outItem); }
/// <summary> /// Update an existing row in the datasource. /// </summary> /// <param name="transactionManager"><see cref="TransactionManager"/> object</param> /// <param name="entity">Nettiers.AdventureWorks.Entities.Address object to update.</param> /// <remarks></remarks> /// <returns>Returns true if operation is successful.</returns> public override bool Update(TransactionManager transactionManager, Nettiers.AdventureWorks.Entities.Address entity) { WsProxy.AdventureWorksServices proxy = new WsProxy.AdventureWorksServices(); proxy.Url = Url; try { WsProxy.Address result = proxy.AddressProvider_Update(Convert(entity)); Convert(entity, result); entity.AcceptChanges(); return(true); } catch (SoapException soex) { System.Diagnostics.Debug.WriteLine(soex); throw soex; } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); throw ex; } }