/// <summary> /// Convert a collection from to a nettiers collection to a the ws proxy collection. /// </summary> public static WsProxy.SalesTerritoryHistory[] Convert(Nettiers.AdventureWorks.Entities.TList <SalesTerritoryHistory> items) { WsProxy.SalesTerritoryHistory[] outItems = new WsProxy.SalesTerritoryHistory[items.Count]; int count = 0; foreach (Nettiers.AdventureWorks.Entities.SalesTerritoryHistory item in items) { outItems[count++] = Convert(item); } return(outItems); }
/// <summary> /// Convert a nettiers entity to the ws proxy entity. /// </summary> public static WsProxy.SalesTerritoryHistory Convert(Nettiers.AdventureWorks.Entities.SalesTerritoryHistory item) { WsProxy.SalesTerritoryHistory outItem = new WsProxy.SalesTerritoryHistory(); outItem.SalesPersonId = item.SalesPersonId; outItem.TerritoryId = item.TerritoryId; outItem.StartDate = item.StartDate; outItem.EndDate = item.EndDate; outItem.Rowguid = item.Rowguid; outItem.ModifiedDate = item.ModifiedDate; outItem.OriginalSalesPersonId = item.OriginalSalesPersonId; outItem.OriginalStartDate = item.OriginalStartDate; outItem.OriginalTerritoryId = item.OriginalTerritoryId; return(outItem); }
/// <summary> /// Gets rows from the datasource based on the PK_SalesTerritoryHistory_SalesPersonID_StartDate_TerritoryID index. /// </summary> /// <param name="start">Row number at which to start reading.</param> /// <param name="pageLength">Number of rows to return.</param> /// <param name="_salesPersonId">Primary key for SalesTerritoryHistory records.</param> /// <param name="_startDate">Date the sales representive started work in the territory.</param> /// <param name="_territoryId">Territory identification number. Foreign key to SalesTerritory.SalesTerritoryID.</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.SalesTerritoryHistory"/> class.</returns> public override Nettiers.AdventureWorks.Entities.SalesTerritoryHistory GetBySalesPersonIdStartDateTerritoryId(TransactionManager transactionManager, System.Int32 _salesPersonId, System.DateTime _startDate, System.Int32 _territoryId, int start, int pageLength, out int count) { try { WsProxy.AdventureWorksServices proxy = new WsProxy.AdventureWorksServices(); proxy.Url = Url; WsProxy.SalesTerritoryHistory items = proxy.SalesTerritoryHistoryProvider_GetBySalesPersonIdStartDateTerritoryId(_salesPersonId, _startDate, _territoryId, 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.SalesTerritoryHistory object into the datasource using a transaction. /// </summary> /// <param name="transactionManager"><see cref="TransactionManager"/> object</param> /// <param name="entity">Nettiers.AdventureWorks.Entities.SalesTerritoryHistory object to insert.</param> /// <remarks></remarks> /// <returns>Returns true if operation is successful.</returns> public override bool Insert(TransactionManager transactionManager, Nettiers.AdventureWorks.Entities.SalesTerritoryHistory entity) { WsProxy.AdventureWorksServices proxy = new WsProxy.AdventureWorksServices(); proxy.Url = Url; try { WsProxy.SalesTerritoryHistory result = proxy.SalesTerritoryHistoryProvider_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 collection from to a nettiers collection to a the ws proxy collection. /// </summary> public static WsProxy.SalesTerritoryHistory[] Convert(Nettiers.AdventureWorks.Entities.TList<SalesTerritoryHistory> items) { WsProxy.SalesTerritoryHistory[] outItems = new WsProxy.SalesTerritoryHistory[items.Count]; int count = 0; foreach (Nettiers.AdventureWorks.Entities.SalesTerritoryHistory item in items) { outItems[count++] = Convert(item); } return outItems; }
/// <summary> /// Convert a nettiers entity to the ws proxy entity. /// </summary> public static WsProxy.SalesTerritoryHistory Convert(Nettiers.AdventureWorks.Entities.SalesTerritoryHistory item) { WsProxy.SalesTerritoryHistory outItem = new WsProxy.SalesTerritoryHistory(); outItem.SalesPersonId = item.SalesPersonId; outItem.TerritoryId = item.TerritoryId; outItem.StartDate = item.StartDate; outItem.EndDate = item.EndDate; outItem.Rowguid = item.Rowguid; outItem.ModifiedDate = item.ModifiedDate; outItem.OriginalSalesPersonId = item.OriginalSalesPersonId; outItem.OriginalStartDate = item.OriginalStartDate; outItem.OriginalTerritoryId = item.OriginalTerritoryId; return outItem; }
/// <summary> /// Convert a nettiers collection to the ws proxy collection. /// </summary> public static Nettiers.AdventureWorks.Entities.SalesTerritoryHistory Convert(Nettiers.AdventureWorks.Entities.SalesTerritoryHistory outItem, WsProxy.SalesTerritoryHistory item) { if (item != null && outItem != null) { outItem.SalesPersonId = item.SalesPersonId; outItem.TerritoryId = item.TerritoryId; outItem.StartDate = item.StartDate; outItem.EndDate = item.EndDate; outItem.Rowguid = item.Rowguid; outItem.ModifiedDate = item.ModifiedDate; outItem.OriginalSalesPersonId = item.SalesPersonId; outItem.OriginalStartDate = item.StartDate; outItem.OriginalTerritoryId = item.TerritoryId; outItem.AcceptChanges(); } return(outItem); }
/// <summary> /// Convert a nettiers collection to the ws proxy collection. /// </summary> public static Nettiers.AdventureWorks.Entities.SalesTerritoryHistory Convert(WsProxy.SalesTerritoryHistory item) { Nettiers.AdventureWorks.Entities.SalesTerritoryHistory outItem = item == null ? null : new Nettiers.AdventureWorks.Entities.SalesTerritoryHistory(); Convert(outItem, item); return(outItem); }