Esempio n. 1
0
        /// <summary>
        /// Convert a nettiers entity to the ws proxy entity.
        /// </summary>
        public static WsProxy.SalesOrderHeader Convert(Nettiers.AdventureWorks.Entities.SalesOrderHeader item)
        {
            WsProxy.SalesOrderHeader outItem = new WsProxy.SalesOrderHeader();
            outItem.SalesOrderId           = item.SalesOrderId;
            outItem.RevisionNumber         = item.RevisionNumber;
            outItem.OrderDate              = item.OrderDate;
            outItem.DueDate                = item.DueDate;
            outItem.ShipDate               = item.ShipDate;
            outItem.Status                 = item.Status;
            outItem.OnlineOrderFlag        = item.OnlineOrderFlag;
            outItem.SalesOrderNumber       = item.SalesOrderNumber;
            outItem.PurchaseOrderNumber    = item.PurchaseOrderNumber;
            outItem.AccountNumber          = item.AccountNumber;
            outItem.CustomerId             = item.CustomerId;
            outItem.ContactId              = item.ContactId;
            outItem.SalesPersonId          = item.SalesPersonId;
            outItem.TerritoryId            = item.TerritoryId;
            outItem.BillToAddressId        = item.BillToAddressId;
            outItem.ShipToAddressId        = item.ShipToAddressId;
            outItem.ShipMethodId           = item.ShipMethodId;
            outItem.CreditCardId           = item.CreditCardId;
            outItem.CreditCardApprovalCode = item.CreditCardApprovalCode;
            outItem.CurrencyRateId         = item.CurrencyRateId;
            outItem.SubTotal               = item.SubTotal;
            outItem.TaxAmt                 = item.TaxAmt;
            outItem.Freight                = item.Freight;
            outItem.TotalDue               = item.TotalDue;
            outItem.Comment                = item.Comment;
            outItem.Rowguid                = item.Rowguid;
            outItem.ModifiedDate           = item.ModifiedDate;


            return(outItem);
        }
Esempio n. 2
0
        /// <summary>
        ///     Inserts a Nettiers.AdventureWorks.Entities.SalesOrderHeader object into the datasource using a transaction.
        /// </summary>
        /// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
        /// <param name="entity">Nettiers.AdventureWorks.Entities.SalesOrderHeader object to insert.</param>
        /// <remarks></remarks>
        /// <returns>Returns true if operation is successful.</returns>
        public override bool Insert(TransactionManager transactionManager, Nettiers.AdventureWorks.Entities.SalesOrderHeader entity)
        {
            WsProxy.AdventureWorksServices proxy = new WsProxy.AdventureWorksServices();
            proxy.Url = Url;

            try
            {
                WsProxy.SalesOrderHeader result = proxy.SalesOrderHeaderProvider_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;
            }
        }
Esempio n. 3
0
 /// <summary>
 /// Convert a nettiers collection to the ws proxy collection.
 /// </summary>
 public static Nettiers.AdventureWorks.Entities.SalesOrderHeader Convert(WsProxy.SalesOrderHeader item)
 {
     Nettiers.AdventureWorks.Entities.SalesOrderHeader outItem = item == null ? null : new Nettiers.AdventureWorks.Entities.SalesOrderHeader();
     Convert(outItem, item);
     return(outItem);
 }