Exemple #1
0
        public dlgSchedule(ScheduleEntry entry, Mediator mediator)
        {
            //Constructor
            try {
                //Required for Windows Form Designer support
                InitializeComponent();
                this.btnCancel.Text = CMD_CANCEL;
                this.btnOK.Text     = CMD_OK;

                //
                this.mEntry    = entry;
                this.mMediator = mediator;
                if (this.mEntry != null)
                {
                    this.mEntry.EntryChanged += new EventHandler(this.OnEntryChanged);
                }
                this.mToolTip = new System.Windows.Forms.ToolTip();
            }
            catch (Exception ex) { throw ex; }
        }
Exemple #2
0
        public void CopyToFolder()
        {
            //Copy the selected entries to another schedule
            dlgMoveEntry dlgCopyTo = new dlgMoveEntry();

            if (dlgCopyTo.ShowDialog(this) == DialogResult.OK)
            {
                //Package data
                DispatchDS ds = new DispatchDS();
                for (int i = 0; i < this.grdSchedule.Selected.Rows.Count; i++)
                {
                    int           ID    = Convert.ToInt32(this.grdSchedule.Selected.Rows[i].Cells["ID"].Value);
                    ScheduleEntry entry = this.mSchedule.Item(ID);
                    ds.Merge(entry.ToDataSet());
                }

                //Get destination schedule and copy data
                DispatchSchedule schedule = dlgCopyTo.Schedule;
                schedule.AddList(ds);
            }
        }
Exemple #3
0
        private void OnDragDropMouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            //Start drag\drop if user is dragging
            DataObject oData = null;

            try {
                switch (e.Button)
                {
                case MouseButtons.Left:
                    if (this.mIsDragging)
                    {
                        //Initiate drag drop operation from this schedule
                        DispatchDS ds = new DispatchDS();
                        for (int i = 0; i < this.grdSchedule.Selected.Rows.Count; i++)
                        {
                            int           ID    = Convert.ToInt32(this.grdSchedule.Selected.Rows[i].Cells["ID"].Value);
                            ScheduleEntry entry = this.mSchedule.Item(ID);
                            ds.Merge(entry.ToDataSet());
                        }
                        oData = new DataObject();
                        oData.SetData(ds);
                        DragDropEffects effect = this.grdSchedule.DoDragDrop(oData, DragDropEffects.All);

                        //After the drop- remove from this schedule on move
                        switch (effect)
                        {
                        case DragDropEffects.Move:      this.mSchedule.RemoveList(ds); break;

                        case DragDropEffects.Copy:      break;
                        }
                    }
                    break;
                }
            }
            catch (Exception ex) { reportError(ex); }
        }
Exemple #4
0
 public abstract dlgSchedule ScheduleDialog(ScheduleEntry entry);
Exemple #5
0
 public abstract bool Remove(ScheduleEntry entry);
Exemple #6
0
 public abstract bool Add(ScheduleEntry entry);
 public override dlgSchedule ScheduleDialog(ScheduleEntry entry)
 {
     return(new dlgClientInboundFreight((ClientInboundFreight)entry, base.mMediator));
 }
Exemple #8
0
 public override dlgSchedule ScheduleDialog(ScheduleEntry entry)
 {
     return(new dlgPickup((Pickup)entry, base.mMediator));
 }
Exemple #9
0
 public override dlgSchedule ScheduleDialog(ScheduleEntry entry)
 {
     return(new dlgTrailerEntry((TrailerEntry)entry, base.mMediator));
 }
Exemple #10
0
 public override dlgSchedule ScheduleDialog(ScheduleEntry entry)
 {
     return(new dlgArrival((Arrival)entry, base.mMediator));
 }