コード例 #1
0
        /// <summary>
        /// Convert a nettiers collection to the ws proxy collection.
        /// </summary>
        public static Nettiers.AdventureWorks.Entities.WorkOrderRouting Convert(Nettiers.AdventureWorks.Entities.WorkOrderRouting outItem, WsProxy.WorkOrderRouting item)
        {
            if (item != null && outItem != null)
            {
                outItem.WorkOrderId        = item.WorkOrderId;
                outItem.ProductId          = item.ProductId;
                outItem.OperationSequence  = item.OperationSequence;
                outItem.LocationId         = item.LocationId;
                outItem.ScheduledStartDate = item.ScheduledStartDate;
                outItem.ScheduledEndDate   = item.ScheduledEndDate;
                outItem.ActualStartDate    = item.ActualStartDate;
                outItem.ActualEndDate      = item.ActualEndDate;
                outItem.ActualResourceHrs  = item.ActualResourceHrs;
                outItem.PlannedCost        = item.PlannedCost;
                outItem.ActualCost         = item.ActualCost;
                outItem.ModifiedDate       = item.ModifiedDate;

                outItem.OriginalWorkOrderId       = item.WorkOrderId;
                outItem.OriginalProductId         = item.ProductId;
                outItem.OriginalOperationSequence = item.OperationSequence;
                outItem.AcceptChanges();
            }

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

            try
            {
                WsProxy.WorkOrderRouting result = proxy.WorkOrderRoutingProvider_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;
            }
        }
コード例 #3
0
 /// <summary>
 /// Convert a nettiers collection to the ws proxy collection.
 /// </summary>
 public static Nettiers.AdventureWorks.Entities.WorkOrderRouting Convert(WsProxy.WorkOrderRouting item)
 {
     Nettiers.AdventureWorks.Entities.WorkOrderRouting outItem = item == null ? null : new Nettiers.AdventureWorks.Entities.WorkOrderRouting();
     Convert(outItem, item);
     return(outItem);
 }