Exemplo n.º 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);
        }
Exemplo n.º 2
0
        /// <summary>
        ///     Update an existing row in the datasource.
        /// </summary>
        /// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
        /// <param name="entity">Nettiers.AdventureWorks.Entities.WorkOrderRouting object to update.</param>
        /// <remarks></remarks>
        /// <returns>Returns true if operation is successful.</returns>
        public override bool Update(TransactionManager transactionManager, Nettiers.AdventureWorks.Entities.WorkOrderRouting entity)
        {
            WsProxy.AdventureWorksServices proxy = new WsProxy.AdventureWorksServices();
            proxy.Url = Url;

            try
            {
                WsProxy.WorkOrderRouting result = proxy.WorkOrderRoutingProvider_Update(Convert(entity));
                Convert(entity, result);
                entity.AcceptChanges();
                return(true);
            }
            catch (SoapException soex)
            {
                System.Diagnostics.Debug.WriteLine(soex);
                throw soex;
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex);
                throw ex;
            }
        }