Ejemplo n.º 1
0
 protected override void UpdateEntry()
 {
     //Update this entry
     try {
         //
         TrailerEntry trailerEntry = (TrailerEntry)base.mEntry;
         trailerEntry.CreatedBy           = this.txtCreatedBy.Text;
         trailerEntry.Created             = this.dtpCreatedDate.Value;
         trailerEntry.TrailerNumber       = this.txtTrailer.Text;
         trailerEntry.IncomingDate        = this.dtpInDate.Value;
         trailerEntry.IncomingCarrier     = this.cboInCarrier.Text;
         trailerEntry.IncomingDriverName  = this.txtInDriver.Text;
         trailerEntry.IncomingSeal        = this.txtInSeal.Text;
         trailerEntry.InitialYardLocation = this.txtInLoc.Text;
         //trailerEntry.TrailerMoves.TrailerMoveTable.AcceptChanges();	//Need row states
         trailerEntry.MoveInProgress     = this.chkMoveInProgress.Checked;
         trailerEntry.LoadSheetReady     = this.chkLoadSheetReady.Checked;
         trailerEntry.OutgoingDate       = this.dtpOutDate.Value;
         trailerEntry.OutgoingCarrier    = this.cboOutCarrier.Text;
         trailerEntry.OutgoingDriverName = this.txtOutDriver.Text;
         trailerEntry.OutgoingSeal       = this.txtOutSeal.Text;
         trailerEntry.MovedOut           = this.chkTrailerOut.Checked;
         trailerEntry.Comments           = this.txtComments.Text;
     }
     catch (Exception ex)  { base.reportError(ex); }
 }
Ejemplo n.º 2
0
        public override ScheduleEntry Item(int ID)
        {
            //Return an existing entry object from the entry log
            TrailerEntry entry = null;

            try {
                //Merge from collection (dataset)
                if (ID > 0)
                {
                    DataRow[] rows = this.mSchedule.TrailerLogTable.Select("ID=" + ID);
                    if (rows.Length == 0)
                    {
                        throw new ApplicationException("Entry  " + ID + " does not exist in this schedule!\n");
                    }
                    DispatchDS.TrailerLogTableRow row = (DispatchDS.TrailerLogTableRow)rows[0];
                    entry               = new TrailerEntry(row, this.mMediator);
                    entry.DataFile      = base.mDataFile;
                    entry.EntryChanged += new EventHandler(OnEntryChanged);
                }
                else
                {
                    entry = (TrailerEntry)Item();
                }
            }
            catch (Exception ex) { throw ex; }
            return(entry);
        }
Ejemplo n.º 3
0
        private void OnFormLoad(object sender, System.EventArgs e)
        {
            //Event handler for form load event
            this.Cursor = Cursors.WaitCursor;
            try {
                //Load selection lists
                try {
                    base.LoadSelections(base.mEntry.EntryType, this.cboInCarrier);
                    base.LoadSelections(base.mEntry.EntryType, this.cboOutCarrier);
                } catch (Exception) { }

                #region Grid control
                this.grdMoves.DisplayLayout.Override.AllowUpdate                             = DefaultableBoolean.True;
                this.grdMoves.DisplayLayout.Bands[0].Override.AllowAddNew                    = AllowAddNew.TemplateOnBottom;
                this.grdMoves.DisplayLayout.Bands[0].Override.AllowUpdate                    = DefaultableBoolean.True;
                this.grdMoves.DisplayLayout.Bands[0].Override.AllowDelete                    = DefaultableBoolean.True;
                this.grdMoves.DisplayLayout.Bands[0].Override.CellClickAction                = CellClickAction.Edit;
                this.grdMoves.DisplayLayout.Bands[0].Override.RowFilterMode                  = RowFilterMode.AllRowsInBand;
                this.grdMoves.DisplayLayout.Bands[0].Columns["ID"].CellActivation            = Activation.NoEdit;
                this.grdMoves.DisplayLayout.Bands[0].Columns["Requested"].CellActivation     = Activation.NoEdit;
                this.grdMoves.DisplayLayout.Bands[0].Columns["MoveFrom"].CellActivation      = Activation.AllowEdit;
                this.grdMoves.DisplayLayout.Bands[0].Columns["MoveTo"].CellActivation        = Activation.AllowEdit;
                this.grdMoves.DisplayLayout.Bands[0].Columns["Switcher"].CellActivation      = Activation.AllowEdit;
                this.grdMoves.DisplayLayout.Bands[0].Columns["LoadedWith"].CellActivation    = Activation.AllowEdit;
                this.grdMoves.DisplayLayout.Bands[0].Columns["ScheduledTime"].CellActivation = Activation.AllowEdit;
                this.grdMoves.DisplayLayout.Bands[0].Columns["ActualTime"].CellActivation    = Activation.AllowEdit;
                this.grdMoves.DisplayLayout.Bands[0].Columns["Requested"].SortIndicator      = SortIndicator.Ascending;
                #endregion
                //Load controls
                this.Text = base.mEntry.EntryType + "(" + base.mEntry.EntryID.ToString() + ")";
                TrailerEntry trailerEntry = (TrailerEntry)base.mEntry;
                this.txtCreatedBy.Text         = trailerEntry.CreatedBy;
                this.dtpCreatedDate.Value      = trailerEntry.Created;
                this.txtCreatedBy.Enabled      = this.dtpCreatedDate.Enabled = false;
                this.txtTrailer.Text           = trailerEntry.TrailerNumber;
                this.dtpInDate.Value           = trailerEntry.IncomingDate;
                this.cboInCarrier.Text         = trailerEntry.IncomingCarrier;
                this.txtInDriver.Text          = trailerEntry.IncomingDriverName;
                this.txtInSeal.Text            = trailerEntry.IncomingSeal;
                this.txtInLoc.Text             = trailerEntry.InitialYardLocation;
                this.grdMoves.DataSource       = trailerEntry.TrailerMoves;
                this.chkMoveInProgress.Checked = trailerEntry.MoveInProgress;
                this.chkLoadSheetReady.Checked = trailerEntry.LoadSheetReady;
                this.dtpOutDate.Value          = trailerEntry.OutgoingDate;
                this.cboOutCarrier.Text        = trailerEntry.OutgoingCarrier;
                this.txtOutDriver.Text         = trailerEntry.OutgoingDriverName;
                this.txtOutSeal.Text           = trailerEntry.OutgoingSeal;
                this.chkTrailerOut.Checked     = trailerEntry.MovedOut;
                this.txtComments.Text          = trailerEntry.Comments;
            }
            catch (Exception ex) { base.reportError(ex); }
            finally {
                OnValidateForm(null, null);
                base.btnOK.Enabled = false;
                this.Cursor        = Cursors.Default;
            }
        }
Ejemplo n.º 4
0
        public override ScheduleEntry Item()
        {
            //Return a new blank entry object
            TrailerEntry entry = null;

            try {
                entry               = new TrailerEntry(this.mMediator);
                entry.DataFile      = base.mDataFile;
                entry.EntryChanged += new EventHandler(OnEntryChanged);
            }
            catch (Exception ex) { throw ex; }
            return(entry);
        }
Ejemplo n.º 5
0
 public override void RemoveList(DispatchDS list)
 {
     //Remove a list of entries from this schedule
     try {
         for (int i = 0; i < list.TrailerLogTable.Rows.Count; i++)
         {
             DispatchDS.TrailerLogTableRow row = list.TrailerLogTable[i];
             TrailerEntry entry = (TrailerEntry)Item(row.ID);
             entry.Delete();
         }
     }
     catch (Exception ex) { throw ex; }
 }
Ejemplo n.º 6
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; }
 }