/// <summary> /// Convert a nettiers entity to the ws proxy entity. /// </summary> public static WsProxy.Product Convert(Nettiers.AdventureWorks.Entities.Product item) { WsProxy.Product outItem = new WsProxy.Product(); outItem.ProductId = item.ProductId; outItem.Name = item.Name; outItem.ProductNumber = item.ProductNumber; outItem.MakeFlag = item.MakeFlag; outItem.FinishedGoodsFlag = item.FinishedGoodsFlag; outItem.Color = item.Color; outItem.SafetyStockLevel = item.SafetyStockLevel; outItem.ReorderPoint = item.ReorderPoint; outItem.StandardCost = item.StandardCost; outItem.ListPrice = item.ListPrice; outItem.Size = item.Size; outItem.SizeUnitMeasureCode = item.SizeUnitMeasureCode; outItem.WeightUnitMeasureCode = item.WeightUnitMeasureCode; outItem.Weight = item.Weight; outItem.DaysToManufacture = item.DaysToManufacture; outItem.ProductLine = item.ProductLine; outItem.SafeNameClass = item.SafeNameClass; outItem.Style = item.Style; outItem.ProductSubcategoryId = item.ProductSubcategoryId; outItem.ProductModelId = item.ProductModelId; outItem.SellStartDate = item.SellStartDate; outItem.SellEndDate = item.SellEndDate; outItem.DiscontinuedDate = item.DiscontinuedDate; outItem.Rowguid = item.Rowguid; outItem.ModifiedDate = item.ModifiedDate; return(outItem); }
/// <summary> /// Convert a collection from to a nettiers collection to a the ws proxy collection. /// </summary> public static WsProxy.Product[] Convert(Nettiers.AdventureWorks.Entities.TList <Product> items) { WsProxy.Product[] outItems = new WsProxy.Product[items.Count]; int count = 0; foreach (Nettiers.AdventureWorks.Entities.Product item in items) { outItems[count++] = Convert(item); } return(outItems); }
/// <summary> /// Gets rows from the datasource based on the PK_Product_ProductID index. /// </summary> /// <param name="start">Row number at which to start reading.</param> /// <param name="pageLength">Number of rows to return.</param> /// <param name="_productId">Primary key for Product 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.Product"/> class.</returns> public override Nettiers.AdventureWorks.Entities.Product GetByProductId(TransactionManager transactionManager, System.Int32 _productId, int start, int pageLength, out int count) { try { WsProxy.AdventureWorksServices proxy = new WsProxy.AdventureWorksServices(); proxy.Url = Url; WsProxy.Product items = proxy.ProductProvider_GetByProductId(_productId, 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.Product object into the datasource using a transaction. /// </summary> /// <param name="transactionManager"><see cref="TransactionManager"/> object</param> /// <param name="entity">Nettiers.AdventureWorks.Entities.Product object to insert.</param> /// <remarks></remarks> /// <returns>Returns true if operation is successful.</returns> public override bool Insert(TransactionManager transactionManager, Nettiers.AdventureWorks.Entities.Product entity) { WsProxy.AdventureWorksServices proxy = new WsProxy.AdventureWorksServices(); proxy.Url = Url; try { WsProxy.Product result = proxy.ProductProvider_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.Product Convert(WsProxy.Product item) { Nettiers.AdventureWorks.Entities.Product outItem = item == null ? null : new Nettiers.AdventureWorks.Entities.Product(); Convert(outItem, item); return(outItem); }
/// <summary> /// Convert a collection from to a nettiers collection to a the ws proxy collection. /// </summary> public static WsProxy.Product[] Convert(Nettiers.AdventureWorks.Entities.TList<Product> items) { WsProxy.Product[] outItems = new WsProxy.Product[items.Count]; int count = 0; foreach (Nettiers.AdventureWorks.Entities.Product item in items) { outItems[count++] = Convert(item); } return outItems; }
/// <summary> /// Convert a nettiers entity to the ws proxy entity. /// </summary> public static WsProxy.Product Convert(Nettiers.AdventureWorks.Entities.Product item) { WsProxy.Product outItem = new WsProxy.Product(); outItem.ProductId = item.ProductId; outItem.Name = item.Name; outItem.ProductNumber = item.ProductNumber; outItem.MakeFlag = item.MakeFlag; outItem.FinishedGoodsFlag = item.FinishedGoodsFlag; outItem.Color = item.Color; outItem.SafetyStockLevel = item.SafetyStockLevel; outItem.ReorderPoint = item.ReorderPoint; outItem.StandardCost = item.StandardCost; outItem.ListPrice = item.ListPrice; outItem.Size = item.Size; outItem.SizeUnitMeasureCode = item.SizeUnitMeasureCode; outItem.WeightUnitMeasureCode = item.WeightUnitMeasureCode; outItem.Weight = item.Weight; outItem.DaysToManufacture = item.DaysToManufacture; outItem.ProductLine = item.ProductLine; outItem.SafeNameClass = item.SafeNameClass; outItem.Style = item.Style; outItem.ProductSubcategoryId = item.ProductSubcategoryId; outItem.ProductModelId = item.ProductModelId; outItem.SellStartDate = item.SellStartDate; outItem.SellEndDate = item.SellEndDate; outItem.DiscontinuedDate = item.DiscontinuedDate; outItem.Rowguid = item.Rowguid; outItem.ModifiedDate = item.ModifiedDate; return outItem; }