Example #1
0
        /// <summary>
        /// Convert a collection from  to a nettiers collection to a the ws proxy collection.
        /// </summary>
        public static WsProxy.CustomerAddress[] Convert(Nettiers.AdventureWorks.Entities.TList <CustomerAddress> items)
        {
            WsProxy.CustomerAddress[] outItems = new WsProxy.CustomerAddress[items.Count];
            int count = 0;

            foreach (Nettiers.AdventureWorks.Entities.CustomerAddress item in items)
            {
                outItems[count++] = Convert(item);
            }
            return(outItems);
        }
Example #2
0
        /// <summary>
        /// Convert a nettiers entity to the ws proxy entity.
        /// </summary>
        public static WsProxy.CustomerAddress Convert(Nettiers.AdventureWorks.Entities.CustomerAddress item)
        {
            WsProxy.CustomerAddress outItem = new WsProxy.CustomerAddress();
            outItem.CustomerId    = item.CustomerId;
            outItem.AddressId     = item.AddressId;
            outItem.AddressTypeId = item.AddressTypeId;
            outItem.Rowguid       = item.Rowguid;
            outItem.ModifiedDate  = item.ModifiedDate;

            outItem.OriginalCustomerId = item.OriginalCustomerId;
            outItem.OriginalAddressId  = item.OriginalAddressId;

            return(outItem);
        }
Example #3
0
        /// <summary>
        ///     Gets rows from the datasource based on the PK_CustomerAddress_CustomerID_AddressID index.
        /// </summary>
        /// <param name="start">Row number at which to start reading.</param>
        /// <param name="pageLength">Number of rows to return.</param>
        /// <param name="_customerId">Primary key. Foreign key to Customer.CustomerID.</param>
        /// <param name="_addressId">Primary key. Foreign key to Address.AddressID.</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.CustomerAddress"/> class.</returns>
        public override Nettiers.AdventureWorks.Entities.CustomerAddress GetByCustomerIdAddressId(TransactionManager transactionManager, System.Int32 _customerId, System.Int32 _addressId, int start, int pageLength, out int count)
        {
            try
            {
                WsProxy.AdventureWorksServices proxy = new WsProxy.AdventureWorksServices();
                proxy.Url = Url;
                WsProxy.CustomerAddress items = proxy.CustomerAddressProvider_GetByCustomerIdAddressId(_customerId, _addressId, 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;
            }
        }
Example #4
0
        /// <summary>
        ///     Inserts a Nettiers.AdventureWorks.Entities.CustomerAddress object into the datasource using a transaction.
        /// </summary>
        /// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
        /// <param name="entity">Nettiers.AdventureWorks.Entities.CustomerAddress object to insert.</param>
        /// <remarks></remarks>
        /// <returns>Returns true if operation is successful.</returns>
        public override bool Insert(TransactionManager transactionManager, Nettiers.AdventureWorks.Entities.CustomerAddress entity)
        {
            WsProxy.AdventureWorksServices proxy = new WsProxy.AdventureWorksServices();
            proxy.Url = Url;

            try
            {
                WsProxy.CustomerAddress result = proxy.CustomerAddressProvider_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.CustomerAddress[] Convert(Nettiers.AdventureWorks.Entities.TList<CustomerAddress> items)
		{
			WsProxy.CustomerAddress[] outItems = new WsProxy.CustomerAddress[items.Count];
			int count = 0;
		
			foreach (Nettiers.AdventureWorks.Entities.CustomerAddress item in items)
			{
				outItems[count++] = Convert(item);
			}
			return outItems;
		}
		/// <summary>
		/// Convert a nettiers entity to the ws proxy entity.
		/// </summary>
		public static WsProxy.CustomerAddress Convert(Nettiers.AdventureWorks.Entities.CustomerAddress item)
		{			
			WsProxy.CustomerAddress outItem = new WsProxy.CustomerAddress();			
			outItem.CustomerId = item.CustomerId;
			outItem.AddressId = item.AddressId;
			outItem.AddressTypeId = item.AddressTypeId;
			outItem.Rowguid = item.Rowguid;
			outItem.ModifiedDate = item.ModifiedDate;

			outItem.OriginalCustomerId = item.OriginalCustomerId;
			outItem.OriginalAddressId = item.OriginalAddressId;
							
			return outItem;
		}
Example #7
0
        /// <summary>
        /// Convert a nettiers collection to the ws proxy collection.
        /// </summary>
        public static Nettiers.AdventureWorks.Entities.CustomerAddress Convert(Nettiers.AdventureWorks.Entities.CustomerAddress outItem, WsProxy.CustomerAddress item)
        {
            if (item != null && outItem != null)
            {
                outItem.CustomerId    = item.CustomerId;
                outItem.AddressId     = item.AddressId;
                outItem.AddressTypeId = item.AddressTypeId;
                outItem.Rowguid       = item.Rowguid;
                outItem.ModifiedDate  = item.ModifiedDate;

                outItem.OriginalCustomerId = item.CustomerId;
                outItem.OriginalAddressId  = item.AddressId;
                outItem.AcceptChanges();
            }

            return(outItem);
        }
Example #8
0
 /// <summary>
 /// Convert a nettiers collection to the ws proxy collection.
 /// </summary>
 public static Nettiers.AdventureWorks.Entities.CustomerAddress Convert(WsProxy.CustomerAddress item)
 {
     Nettiers.AdventureWorks.Entities.CustomerAddress outItem = item == null ? null : new Nettiers.AdventureWorks.Entities.CustomerAddress();
     Convert(outItem, item);
     return(outItem);
 }