/// <summary> /// Convert a collection from to a nettiers collection to a the ws proxy collection. /// </summary> public static WsProxy.ProductPhoto[] Convert(Nettiers.AdventureWorks.Entities.TList <ProductPhoto> items) { WsProxy.ProductPhoto[] outItems = new WsProxy.ProductPhoto[items.Count]; int count = 0; foreach (Nettiers.AdventureWorks.Entities.ProductPhoto item in items) { outItems[count++] = Convert(item); } return(outItems); }
/// <summary> /// Convert a nettiers entity to the ws proxy entity. /// </summary> public static WsProxy.ProductPhoto Convert(Nettiers.AdventureWorks.Entities.ProductPhoto item) { WsProxy.ProductPhoto outItem = new WsProxy.ProductPhoto(); outItem.ProductPhotoId = item.ProductPhotoId; outItem.ThumbNailPhoto = item.ThumbNailPhoto; outItem.ThumbnailPhotoFileName = item.ThumbnailPhotoFileName; outItem.LargePhoto = item.LargePhoto; outItem.LargePhotoFileName = item.LargePhotoFileName; outItem.ModifiedDate = item.ModifiedDate; return(outItem); }
/// <summary> /// Gets rows from the datasource based on the PK_ProductPhoto_ProductPhotoID index. /// </summary> /// <param name="start">Row number at which to start reading.</param> /// <param name="pageLength">Number of rows to return.</param> /// <param name="_productPhotoId">Primary key for ProductPhoto records.</param> /// <param name="transactionManager"><see cref="TransactionManager"/> object</param> /// <param name="count">out parameter to get total records for query</param> /// <remarks></remarks> /// <returns>Returns an instance of the <see cref="Nettiers.AdventureWorks.Entities.ProductPhoto"/> class.</returns> public override Nettiers.AdventureWorks.Entities.ProductPhoto GetByProductPhotoId(TransactionManager transactionManager, System.Int32 _productPhotoId, int start, int pageLength, out int count) { try { WsProxy.AdventureWorksServices proxy = new WsProxy.AdventureWorksServices(); proxy.Url = Url; WsProxy.ProductPhoto items = proxy.ProductPhotoProvider_GetByProductPhotoId(_productPhotoId, start, pageLength, out count); return(Convert(items)); } catch (SoapException soex) { System.Diagnostics.Debug.WriteLine(soex); throw soex; } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); throw ex; } }
/// <summary> /// Inserts a Nettiers.AdventureWorks.Entities.ProductPhoto object into the datasource using a transaction. /// </summary> /// <param name="transactionManager"><see cref="TransactionManager"/> object</param> /// <param name="entity">Nettiers.AdventureWorks.Entities.ProductPhoto object to insert.</param> /// <remarks></remarks> /// <returns>Returns true if operation is successful.</returns> public override bool Insert(TransactionManager transactionManager, Nettiers.AdventureWorks.Entities.ProductPhoto entity) { WsProxy.AdventureWorksServices proxy = new WsProxy.AdventureWorksServices(); proxy.Url = Url; try { WsProxy.ProductPhoto result = proxy.ProductPhotoProvider_Insert(Convert(entity)); Convert(entity, result); return(true); } catch (SoapException soex) { System.Diagnostics.Debug.WriteLine(soex); throw soex; } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); throw ex; } }
/// <summary> /// Convert a nettiers collection to the ws proxy collection. /// </summary> public static Nettiers.AdventureWorks.Entities.ProductPhoto Convert(Nettiers.AdventureWorks.Entities.ProductPhoto outItem, WsProxy.ProductPhoto item) { if (item != null && outItem != null) { outItem.ProductPhotoId = item.ProductPhotoId; outItem.ThumbNailPhoto = item.ThumbNailPhoto; outItem.ThumbnailPhotoFileName = item.ThumbnailPhotoFileName; outItem.LargePhoto = item.LargePhoto; outItem.LargePhotoFileName = item.LargePhotoFileName; outItem.ModifiedDate = item.ModifiedDate; outItem.AcceptChanges(); } return(outItem); }
/// <summary> /// Convert a nettiers collection to the ws proxy collection. /// </summary> public static Nettiers.AdventureWorks.Entities.ProductPhoto Convert(WsProxy.ProductPhoto item) { Nettiers.AdventureWorks.Entities.ProductPhoto outItem = item == null ? null : new Nettiers.AdventureWorks.Entities.ProductPhoto(); Convert(outItem, item); return(outItem); }
/// <summary> /// Convert a collection from to a nettiers collection to a the ws proxy collection. /// </summary> public static WsProxy.ProductPhoto[] Convert(Nettiers.AdventureWorks.Entities.TList<ProductPhoto> items) { WsProxy.ProductPhoto[] outItems = new WsProxy.ProductPhoto[items.Count]; int count = 0; foreach (Nettiers.AdventureWorks.Entities.ProductPhoto item in items) { outItems[count++] = Convert(item); } return outItems; }
/// <summary> /// Convert a nettiers entity to the ws proxy entity. /// </summary> public static WsProxy.ProductPhoto Convert(Nettiers.AdventureWorks.Entities.ProductPhoto item) { WsProxy.ProductPhoto outItem = new WsProxy.ProductPhoto(); outItem.ProductPhotoId = item.ProductPhotoId; outItem.ThumbNailPhoto = item.ThumbNailPhoto; outItem.ThumbnailPhotoFileName = item.ThumbnailPhotoFileName; outItem.LargePhoto = item.LargePhoto; outItem.LargePhotoFileName = item.LargePhotoFileName; outItem.ModifiedDate = item.ModifiedDate; return outItem; }