Esempio n. 1
0
        public bool ChangeTrailerEntry(TrailerEntry entry)
        {
            //Change an existing trailer log entry
            bool changed = false;

            try {
                //Create the TransactionScope to execute the commands, guaranteeing that both commands can commit or roll back as a single unit of work
                using (TransactionScope scope = new TransactionScope()) {
                    //
                    changed = new DispatchGateway().UpdateTrailerEntry(entry);

                    //Commits the transaction; if an exception is thrown, Complete is not called and the transaction is rolled back
                    scope.Complete();
                }
            }
            catch (Exception ex) { throw new FaultException <DispatchFault>(new DispatchFault(ex.Message), "Service Error"); }
            return(changed);
        }
Esempio n. 2
0
        public bool UpdateTrailerEntry(TrailerEntry entry)
        {
            //Update an existing trailer entry in the Trailer Log
            bool updated = false;

            try {
                updated = new DataService().ExecuteNonQuery(SQL_CONNID, USP_TRAILERLOG_UPDATE,
                                                            new object[] {
                    entry.ID, entry.ScheduleDate, entry.TrailerNumber,
                    (entry.InboundDate != DateTime.MinValue ? entry.InboundDate : null as object),
                    entry.InboundCarrier, entry.InboundSeal, entry.InboundDriverName, entry.TDSNumber, entry.InitialYardLocation,
                    (entry.OutboundDate != DateTime.MinValue ? entry.OutboundDate : null as object),
                    entry.OutboundCarrier, entry.OutboundSeal, entry.OutboundDriverName, entry.BOLNumber,
                    entry.Comments, entry.LastUpdated, entry.UserID
                });
            }
            catch (Exception ex) { throw new ApplicationException(ex.Message, ex); }
            return(updated);
        }