예제 #1
0
 public override void AddList(DispatchDS list)
 {
     //Add a list of entries to this schedule
     try {
         for (int i = 0; i < list.TrailerLogTable.Rows.Count; i++)
         {
             DispatchDS.TrailerLogTableRow row = list.TrailerLogTable[i];
             TrailerEntry entry = (TrailerEntry)Item();
             entry.ID        = row.ID;
             entry.Created   = row.Created;
             entry.CreatedBy = row.CreatedBy;
             if (!row.IsTrailerNumberNull())
             {
                 entry.TrailerNumber = row.TrailerNumber;
             }
             if (!row.IsIncomingDateNull())
             {
                 entry.IncomingDate = row.IncomingDate;
             }
             if (!row.IsIncomingCarrierNull())
             {
                 entry.IncomingCarrier = row.IncomingCarrier;
             }
             if (!row.IsIncomingSealNull())
             {
                 entry.IncomingSeal = row.IncomingSeal;
             }
             if (!row.IsIncomingDriverNameNull())
             {
                 entry.IncomingDriverName = row.IncomingDriverName;
             }
             if (!row.IsInitialYardLocationNull())
             {
                 entry.InitialYardLocation = row.InitialYardLocation;
             }
             if (!row.IsLoadSheetReadyNull())
             {
                 entry.LoadSheetReady = row.LoadSheetReady;
             }
             if (!row.IsMoveInProgressNull())
             {
                 entry.MoveInProgress = row.MoveInProgress;
             }
             if (!row.IsOutgoingDateNull())
             {
                 entry.OutgoingDate = row.OutgoingDate;
             }
             if (!row.IsOutgoingCarrierNull())
             {
                 entry.OutgoingCarrier = row.OutgoingCarrier;
             }
             if (!row.IsOutgoingSealNull())
             {
                 entry.OutgoingSeal = row.OutgoingSeal;
             }
             if (!row.IsOutgoingDriverNameNull())
             {
                 entry.OutgoingDriverName = row.OutgoingDriverName;
             }
             if (!row.IsMovedOutNull())
             {
                 entry.MovedOut = row.MovedOut;
             }
             if (!row.IsCommentsNull())
             {
                 entry.Comments = row.Comments;
             }
             entry.TrailerMoves.TrailerLogTable.ImportRow(row);                                  //Enable constraints for next line
             entry.TrailerMoves.Merge(row.GetTrailerMoveTableRows());
             entry.TrailerMoves.TrailerMoveTable.AcceptChanges();
             Add(entry);
         }
     }
     catch (Exception ex) { throw ex; }
 }
예제 #2
0
        public TrailerEntry(DispatchDS.TrailerLogTableRow trailerEntry, Mediator mediator) : base(mediator)
        {
            //Constructor
            try {
                if (trailerEntry != null)
                {
                    this._id        = trailerEntry.ID;
                    this._created   = trailerEntry.Created;
                    this._createdby = trailerEntry.CreatedBy;
                    if (!trailerEntry.IsTrailerNumberNull())
                    {
                        this._trailernumber = trailerEntry.TrailerNumber;
                    }
                    if (!trailerEntry.IsIncomingDateNull())
                    {
                        this._incomingdate = trailerEntry.IncomingDate;
                    }
                    if (!trailerEntry.IsIncomingCarrierNull())
                    {
                        this._incomingcarrier = trailerEntry.IncomingCarrier;
                    }
                    if (!trailerEntry.IsIncomingSealNull())
                    {
                        this._incomingseal = trailerEntry.IncomingSeal;
                    }
                    if (!trailerEntry.IsIncomingDriverNameNull())
                    {
                        this._incomingdrivername = trailerEntry.IncomingDriverName;
                    }
                    if (!trailerEntry.IsInitialYardLocationNull())
                    {
                        this._initialyardlocation = trailerEntry.InitialYardLocation;
                    }
                    if (!trailerEntry.IsLoadSheetReadyNull())
                    {
                        this._loadsheetready = trailerEntry.LoadSheetReady;
                    }
                    if (!trailerEntry.IsMoveInProgressNull())
                    {
                        this._moveinprogress = trailerEntry.MoveInProgress;
                    }
                    if (!trailerEntry.IsOutgoingDateNull())
                    {
                        this._outgoingdate = trailerEntry.OutgoingDate;
                    }
                    if (!trailerEntry.IsOutgoingCarrierNull())
                    {
                        this._outgoingcarrier = trailerEntry.OutgoingCarrier;
                    }
                    if (!trailerEntry.IsOutgoingSealNull())
                    {
                        this._outgoingseal = trailerEntry.OutgoingSeal;
                    }
                    if (!trailerEntry.IsOutgoingDriverNameNull())
                    {
                        this._outgoingdrivername = trailerEntry.OutgoingDriverName;
                    }
                    if (!trailerEntry.IsMovedOutNull())
                    {
                        this._movedout = trailerEntry.MovedOut;
                    }
                    if (!trailerEntry.IsCommentsNull())
                    {
                        this._comments = trailerEntry.Comments;
                    }

                    this.mTrailerMoves = new DispatchDS();
                    this.mTrailerMoves.TrailerLogTable.ImportRow(trailerEntry);                                 //Enable constraints for next line
                    this.mTrailerMoves.Merge(trailerEntry.GetTrailerMoveTableRows());
                    this.mTrailerMoves.TrailerMoveTable.AcceptChanges();
                }
                else
                {
                    this.mTrailerMoves = new DispatchDS();
                }
            }
            catch (Exception ex) { throw ex; }
        }