public override DataSet ToDataSet() { //Return a dataset containing values for this object DispatchDS ds = null; try { ds = new DispatchDS(); DispatchDS.ClientInboundTableRow row = ds.ClientInboundTable.NewClientInboundTableRow(); row.ID = this._id; row.Created = this._created; row.CreatedBy = this._createdby; row.VendorName = this._vendorname; row.ConsigneeName = this._consigneename; row.ETATime = this._etatime; row.DriverName = this._drivername; row.TrailerNumber = this._trailernumber; row.Amount = this._amount; row.AmountType = this._amounttype; row.FreightType = this._freighttype; row.Comments = this._comments; row.In = this._in; ds.ClientInboundTable.AddClientInboundTableRow(row); } catch (Exception) { } return(ds); }
public override DataSet ToDataSet() { //Return a dataset containing values for this object DispatchDS ds = null; try { ds = new DispatchDS(); DispatchDS.PickupLogTableRow row = ds.PickupLogTable.NewPickupLogTableRow(); row.ID = this._id; row.Created = this._created; row.CreatedBy = this._createdby; row.CallerName = this._callername; row.ClientName = this._clientname; row.ShipperName = this._shippername; row.ShipperAddress = this._shipperaddress; row.DeliveryWindow = this._deliverywindow; row.Terminal = this._terminal; row.DriverName = this._drivername; row.Amount = this._amount; row.AmountType = this._amounttype; row.FreightType = this._freighttype; row.AutoNumber = this._autonumber; row.RequestDate = this._requestdate; row.PickUpDate = this._pickupdate; row.Comments = this._comments; row.Updated = this._updated; row.MustBeReady = this._mustbeready; row.PickedUp = this._pickedup; ds.PickupLogTable.AddPickupLogTableRow(row); } catch (Exception) { } return(ds); }
public override bool Update() { //Update this object bool bRet = false; try { DispatchDS ds = new DispatchDS(); ds.Merge(base.mMediator.FillDataset(base.mDataFile, "", null)); DispatchDS.ClientInboundTableRow row = (DispatchDS.ClientInboundTableRow)ds.ClientInboundTable.Select("ID = " + this._id)[0]; row.VendorName = this._vendorname; row.ConsigneeName = this._consigneename; if (this._etatime != DateTime.MinValue) { row.ETATime = this._etatime; } row.DriverName = this._drivername; row.TrailerNumber = this._trailernumber; row.Amount = this._amount; row.AmountType = this._amounttype; row.FreightType = this._freighttype; row.Comments = this._comments; row.In = this._in; ds.ClientInboundTable.AcceptChanges(); bRet = base.mMediator.ExecuteNonQuery(base.mDataFile, new object[] { ds }); bRet = true; base.OnEntryChanged(this, new EventArgs()); } catch (Exception ex) { throw ex; } return(bRet); }
public override DataSet ToDataSet() { //Return a dataset containing values for this object DispatchDS ds = null; try { ds = new DispatchDS(); DispatchDS.TrailerLogTableRow trailerEntry = ds.TrailerLogTable.NewTrailerLogTableRow(); trailerEntry.ID = this._id; trailerEntry.Created = this._created; trailerEntry.CreatedBy = this._createdby; trailerEntry.TrailerNumber = this._trailernumber; trailerEntry.IncomingDate = this._incomingdate; trailerEntry.IncomingCarrier = this._incomingcarrier; trailerEntry.IncomingSeal = this._incomingseal; trailerEntry.IncomingDriverName = this._incomingdrivername; trailerEntry.InitialYardLocation = this._initialyardlocation; trailerEntry.LoadSheetReady = this._loadsheetready; trailerEntry.MoveInProgress = this._moveinprogress; trailerEntry.OutgoingDate = this._outgoingdate; trailerEntry.OutgoingCarrier = this._outgoingcarrier; trailerEntry.OutgoingSeal = this._outgoingseal; trailerEntry.OutgoingDriverName = this._outgoingdrivername; trailerEntry.MovedOut = this._movedout; trailerEntry.Comments = this._comments; ds.TrailerLogTable.AddTrailerLogTableRow(trailerEntry); ds.Merge(this.mTrailerMoves); ds.AcceptChanges(); } catch (Exception) { } return(ds); }
public override DataSet ToDataSet() { //Return a dataset containing values for this object DispatchDS ds = null; try { ds = new DispatchDS(); DispatchDS.ScheduledOutboundTableRow row = ds.ScheduledOutboundTable.NewScheduledOutboundTableRow(); row.ID = this._id; row.Created = this._created; row.CreatedBy = this._createdby; row.DriverName = this._drivername; row.TrailerNumber = this._trailernumber; row.FromLocation = this._fromlocation; row.ToLocation = this._tolocation; row.ScheduledDeparture = this._scheduleddeparture; row.ActualDeparture = this._actualdeparture; row.ScheduledDelivery = this._scheduleddelivery; row.ActualDelivery = this._actualdelivery; row.Comments = this._comments; row.Confirmed = this._confirmed; ds.ScheduledOutboundTable.AddScheduledOutboundTableRow(row); } catch (Exception) { } return(ds); }
public override bool Create() { //Save this object bool bRet = false; try { DispatchDS ds = new DispatchDS(); ds.Merge(base.mMediator.FillDataset(base.mDataFile, "", null)); if (this._id <= 0) { //For new entries only; some entries are moved between schedules int ID = 0; for (int i = 0; i < ds.LineHaulTable.Rows.Count; i++) { if (ds.LineHaulTable[i].ID > ID) { ID = ds.LineHaulTable[i].ID; } } this._id = ID + 1; } ds.LineHaulTable.AddLineHaulTableRow(this._id, this._created, this._createdby, this._trailernumber, this._terminal, this._scheduledarrival, this._actualarrival, this._comments); ds.LineHaulTable.AcceptChanges(); bRet = base.mMediator.ExecuteNonQuery(base.mDataFile, new object[] { ds }); bRet = true; base.OnEntryChanged(this, new EventArgs()); } catch (Exception ex) { throw ex; } return(bRet); }
public override void AddList(DispatchDS list) { // try { for (int i = 0; i < list.ClientInboundTable.Rows.Count; i++) { DispatchDS.ClientInboundTableRow row = list.ClientInboundTable[i]; ClientInboundFreight entry = (ClientInboundFreight)Item(); entry.ID = row.ID; entry.Created = row.Created; entry.CreatedBy = row.CreatedBy; if (!row.IsVendorNameNull()) { entry.VendorName = row.VendorName; } if (!row.IsConsigneeNameNull()) { entry.ConsigneeName = row.ConsigneeName; } if (!row.IsETATimeNull()) { entry.ETATime = row.ETATime; } if (!row.IsDriverNameNull()) { entry.DriverName = row.DriverName; } if (!row.IsTrailerNumberNull()) { entry.TrailerNumber = row.TrailerNumber; } if (!row.IsAmountNull()) { entry.Amount = row.Amount; } if (!row.IsAmountTypeNull()) { entry.AmountType = row.AmountType; } if (!row.IsFreightTypeNull()) { entry.FreightType = row.FreightType; } if (!row.IsCommentsNull()) { entry.Comments = row.Comments; } if (!row.IsInNull()) { entry.In = row.In; } Add(entry); } } catch (Exception ex) { throw ex; } }
public override bool Create() { //Save this object bool bRet = false; try { DispatchDS ds = new DispatchDS(); ds.Merge(base.mMediator.FillDataset(base.mDataFile, "", null)); if (this._id <= 0) { //For new entries only; some entries are moved between schedules int ID = 0; for (int i = 0; i < ds.ScheduledOutboundTable.Rows.Count; i++) { if (ds.ScheduledOutboundTable[i].ID > ID) { ID = ds.ScheduledOutboundTable[i].ID; } } this._id = ID + 1; } DispatchDS.ScheduledOutboundTableRow row = ds.ScheduledOutboundTable.NewScheduledOutboundTableRow(); row.ID = this._id; row.Created = this._created; row.CreatedBy = this._createdby; row.DriverName = this._drivername; row.TrailerNumber = this._trailernumber; row.FromLocation = this._fromlocation; row.ToLocation = this._tolocation; if (this._scheduleddeparture != DateTime.MinValue) { row.ScheduledDeparture = this._scheduleddeparture; } if (this._actualdeparture != DateTime.MinValue) { row.ActualDeparture = this._actualdeparture; } if (this._scheduleddelivery != DateTime.MinValue) { row.ScheduledDelivery = this._scheduleddelivery; } if (this._actualdelivery != DateTime.MinValue) { row.ActualDelivery = this._actualdelivery; } row.Comments = this._comments; row.Confirmed = this._confirmed; ds.ScheduledOutboundTable.AddScheduledOutboundTableRow(row); ds.ScheduledOutboundTable.AcceptChanges(); bRet = base.mMediator.ExecuteNonQuery(base.mDataFile, new object[] { ds }); bRet = true; base.OnEntryChanged(this, new EventArgs()); } catch (Exception ex) { throw ex; } return(bRet); }
public override void AddList(DispatchDS list) { // try { for (int i = 0; i < list.ScheduledInboundTable.Rows.Count; i++) { DispatchDS.ScheduledInboundTableRow row = list.ScheduledInboundTable[i]; InboundFreight entry = (InboundFreight)Item(); entry.ID = row.ID; entry.Created = row.Created; entry.CreatedBy = row.CreatedBy; if (!row.IsDriverNameNull()) { entry.DriverName = row.DriverName; } if (!row.IsTrailerNumberNull()) { entry.TrailerNumber = row.TrailerNumber; } if (!row.IsFromLocationNull()) { entry.FromLocation = row.FromLocation; } if (!row.IsToLocationNull()) { entry.ToLocation = row.ToLocation; } if (!row.IsScheduledDepartureNull()) { entry.ScheduledDeparture = row.ScheduledDeparture; } if (!row.IsActualDepartureNull()) { entry.ActualDeparture = row.ActualDeparture; } if (!row.IsScheduledDeliveryNull()) { entry.ScheduledDelivery = row.ScheduledDelivery; } if (!row.IsActualDeliveryNull()) { entry.ActualDelivery = row.ActualDelivery; } if (!row.IsCommentsNull()) { entry.Comments = row.Comments; } if (!row.IsConfirmedNull()) { entry.Confirmed = row.Confirmed; } Add(entry); } } catch (Exception ex) { throw ex; } }
public override bool Create() { //Save this object bool bRet = false; try { DispatchDS ds = new DispatchDS(); ds.Merge(base.mMediator.FillDataset(base.mDataFile, "", null)); if (this._id <= 0) { //For new entries only; some entries are moved between schedules int ID = 0; for (int i = 0; i < ds.PickupLogTable.Rows.Count; i++) { if (ds.PickupLogTable[i].ID > ID) { ID = ds.PickupLogTable[i].ID; } } this._id = ID + 1; } DispatchDS.PickupLogTableRow row = ds.PickupLogTable.NewPickupLogTableRow(); row.ID = this._id; row.Created = this._created; row.CreatedBy = this._createdby; row.CallerName = this._callername; row.ClientName = this._clientname; row.ShipperName = this._shippername; row.ShipperAddress = this._shipperaddress; row.DeliveryWindow = this._deliverywindow; row.Terminal = this._terminal; row.DriverName = this._drivername; row.Amount = this._amount; row.AmountType = this._amounttype; row.FreightType = this._freighttype; row.AutoNumber = this._autonumber; row.RequestDate = this._requestdate; if (this._pickupdate != DateTime.MinValue) { row.PickUpDate = this._pickupdate; } row.Comments = this._comments; row.Updated = this._updated; row.MustBeReady = this._mustbeready; row.PickedUp = this._pickedup; ds.PickupLogTable.AddPickupLogTableRow(this._id, this._created, this._createdby, this._callername, this._clientname, this._shippername, this._shipperaddress, this._deliverywindow, this._terminal, this._drivername, this._amount, this._amounttype, this._freighttype, this._autonumber, this._requestdate, this._pickupdate, this._comments, this._updated, this._mustbeready, this._pickedup); ds.PickupLogTable.AcceptChanges(); bRet = base.mMediator.ExecuteNonQuery(base.mDataFile, new object[] { ds }); base.OnEntryChanged(this, new EventArgs()); } catch (Exception ex) { throw ex; } return(bRet); }
public override void RemoveList(DispatchDS list) { //Remove a list of entries from this schedule try { for (int i = 0; i < list.PickupLogTable.Rows.Count; i++) { DispatchDS.PickupLogTableRow row = list.PickupLogTable[i]; Pickup entry = (Pickup)Item(row.ID); entry.Delete(); } } catch (Exception ex) { throw ex; } }
private void OnDragDrop(object sender, System.Windows.Forms.DragEventArgs e) { //Event handler for dropping onto the window try { DataObject oData = (DataObject)e.Data; if (oData.GetDataPresent(DataFormats.Serializable, true)) { DispatchDS ds = (DispatchDS)oData.GetData(DataFormats.Serializable); this.mSchedule.AddList(ds); } } catch (Exception ex) { reportError(ex); } }
public override void RemoveList(DispatchDS list) { //Remove a list of entries from this schedule try { for (int i = 0; i < list.ClientInboundTable.Rows.Count; i++) { DispatchDS.ClientInboundTableRow row = list.ClientInboundTable[i]; ClientInboundFreight entry = (ClientInboundFreight)Item(row.ID); entry.Delete(); } } catch (Exception ex) { throw ex; } }
//Interface public DispatchSchedule(string scheduleName, string tableName, string dataFile, Mediator mediator) { //Constructor try { //Set custom attributes this.mScheduleName = scheduleName; this.mTableName = tableName; this.mDataFile = dataFile; this.mMediator = mediator; this.mSchedule = new DispatchDS(); } catch (Exception ex) { throw ex; } }
public override bool Create() { //Save this object bool bRet = false; try { DispatchDS ds = new DispatchDS(); ds.Merge(base.mMediator.FillDataset(base.mDataFile, "", null)); if (this._id <= 0) { //For new entries only; some entries are moved between schedules int ID = 0; for (int i = 0; i < ds.ClientInboundTable.Rows.Count; i++) { if (ds.ClientInboundTable[i].ID > ID) { ID = ds.ClientInboundTable[i].ID; } } this._id = ID + 1; } DispatchDS.ClientInboundTableRow row = ds.ClientInboundTable.NewClientInboundTableRow(); row.ID = this._id; row.Created = this._created; row.CreatedBy = this._createdby; row.VendorName = this._vendorname; row.ConsigneeName = this._consigneename; if (this._etatime != DateTime.MinValue) { row.ETATime = this._etatime; } row.DriverName = this._drivername; row.TrailerNumber = this._trailernumber; row.Amount = this._amount; row.AmountType = this._amounttype; row.FreightType = this._freighttype; row.Comments = this._comments; row.In = this._in; ds.ClientInboundTable.AddClientInboundTableRow(row); ds.ClientInboundTable.AcceptChanges(); bRet = base.mMediator.ExecuteNonQuery(base.mDataFile, new object[] { ds }); bRet = true; base.OnEntryChanged(this, new EventArgs()); } catch (Exception ex) { throw ex; } return(bRet); }
public override bool Delete() { //Delete this object bool bRet = false; try { DispatchDS ds = new DispatchDS(); ds.Merge(base.mMediator.FillDataset(base.mDataFile, "", null)); DispatchDS.PickupLogTableRow row = (DispatchDS.PickupLogTableRow)ds.PickupLogTable.Select("ID = " + this._id)[0]; row.Delete(); ds.PickupLogTable.AcceptChanges(); bRet = base.mMediator.ExecuteNonQuery(base.mDataFile, new object[] { ds }); base.OnEntryChanged(this, new EventArgs()); } catch (Exception ex) { throw ex; } return(bRet); }
public override DataSet ToDataSet() { //Return a dataset containing values for this object DispatchDS ds = null; try { ds = new DispatchDS(); DispatchDS.LineHaulTableRow row = ds.LineHaulTable.NewLineHaulTableRow(); row.ID = this._id; row.Created = this._created; row.CreatedBy = this._createdby; row.TrailerNumber = this._trailernumber; row.Terminal = this._terminal; row.ScheduledArrival = this._scheduledarrival; row.ActualArrival = this._actualarrival; row.Comments = this._comments; ds.LineHaulTable.AddLineHaulTableRow(row); } catch (Exception) { } return(ds); }
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); } }
public override bool Update() { //Update this object bool bRet = false; try { DispatchDS ds = new DispatchDS(); ds.Merge(base.mMediator.FillDataset(base.mDataFile, "", null)); DispatchDS.ScheduledOutboundTableRow row = (DispatchDS.ScheduledOutboundTableRow)ds.ScheduledOutboundTable.Select("ID = " + this._id)[0]; row.DriverName = this._drivername; row.TrailerNumber = this._trailernumber; row.FromLocation = this._fromlocation; row.ToLocation = this._tolocation; if (this._scheduleddeparture != DateTime.MinValue) { row.ScheduledDeparture = this._scheduleddeparture; } if (this._actualdeparture != DateTime.MinValue) { row.ActualDeparture = this._actualdeparture; } if (this._scheduleddelivery != DateTime.MinValue) { row.ScheduledDelivery = this._scheduleddelivery; } if (this._actualdelivery != DateTime.MinValue) { row.ActualDelivery = this._actualdelivery; } row.Comments = this._comments; row.Confirmed = this._confirmed; ds.ScheduledOutboundTable.AcceptChanges(); bRet = base.mMediator.ExecuteNonQuery(base.mDataFile, new object[] { ds }); bRet = true; base.OnEntryChanged(this, new EventArgs()); } catch (Exception ex) { throw ex; } return(bRet); }
public override bool Update() { //Update this object bool bRet = false; try { DispatchDS ds = new DispatchDS(); ds.Merge(base.mMediator.FillDataset(base.mDataFile, "", null)); DispatchDS.LineHaulTableRow row = (DispatchDS.LineHaulTableRow)ds.LineHaulTable.Select("ID = " + this._id)[0]; row.TrailerNumber = this._trailernumber; row.Terminal = this._terminal; row.ScheduledArrival = this._scheduledarrival; row.ActualArrival = this._actualarrival; row.Comments = this._comments; ds.LineHaulTable.AcceptChanges(); bRet = base.mMediator.ExecuteNonQuery(base.mDataFile, new object[] { ds }); bRet = true; base.OnEntryChanged(this, new EventArgs()); } catch (Exception ex) { throw ex; } return(bRet); }
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); } }
public override bool Update() { //Update this object bool bRet = false; try { DispatchDS ds = new DispatchDS(); ds.Merge(base.mMediator.FillDataset(base.mDataFile, "", null)); DispatchDS.PickupLogTableRow row = (DispatchDS.PickupLogTableRow)ds.PickupLogTable.Select("ID = " + this._id)[0]; row.CallerName = this._callername; row.ClientName = this._clientname; row.ShipperName = this._shippername; row.ShipperAddress = this._shipperaddress; row.DeliveryWindow = this._deliverywindow; row.Terminal = this._terminal; row.DriverName = this._drivername; row.Amount = this._amount; row.AmountType = this._amounttype; row.FreightType = this._freighttype; row.AutoNumber = this._autonumber; row.RequestDate = this._requestdate; if (this._pickupdate != DateTime.MinValue) { row.PickUpDate = this._pickupdate; } row.Comments = this._comments; row.Updated = this._updated; row.MustBeReady = this._mustbeready; row.PickedUp = this._pickedup; ds.PickupLogTable.AcceptChanges(); bRet = base.mMediator.ExecuteNonQuery(base.mDataFile, new object[] { ds }); base.OnEntryChanged(this, new EventArgs()); } catch (Exception ex) { throw ex; } return(bRet); }
public override bool Delete() { //Delete this object and all child objects bool bRet = false; try { DispatchDS ds = new DispatchDS(); ds.Merge(base.mMediator.FillDataset(base.mDataFile, "", null)); DispatchDS.TrailerLogTableRow row = (DispatchDS.TrailerLogTableRow)ds.TrailerLogTable.Select("ID = " + this._id)[0]; row.Delete(); for (int i = 0; i < this.mTrailerMoves.TrailerMoveTable.Rows.Count; i++) { DispatchDS.TrailerMoveTableRow _row = (DispatchDS.TrailerMoveTableRow)ds.TrailerMoveTable.Select("ID = " + this.mTrailerMoves.TrailerMoveTable[i].ID)[0]; _row.Delete(); } ds.TrailerMoveTable.AcceptChanges(); ds.TrailerLogTable.AcceptChanges(); bRet = base.mMediator.ExecuteNonQuery(base.mDataFile, new object[] { ds }); bRet = true; base.OnEntryChanged(this, new EventArgs()); } catch (Exception ex) { throw ex; } return(bRet); }
public override void AddList(DispatchDS list) { // try { for (int i = 0; i < list.LineHaulTable.Rows.Count; i++) { DispatchDS.LineHaulTableRow row = list.LineHaulTable[i]; Arrival entry = (Arrival)Item(); entry.ID = row.ID; entry.Created = row.Created; entry.CreatedBy = row.CreatedBy; if (!row.IsTrailerNumberNull()) { entry.TrailerNumber = row.TrailerNumber; } if (!row.IsTerminalNull()) { entry.Terminal = row.Terminal; } if (!row.IsScheduledArrivalNull()) { entry.ScheduledArrival = row.ScheduledArrival; } if (!row.IsActualArrivalNull()) { entry.ActualArrival = row.ActualArrival; } if (!row.IsCommentsNull()) { entry.Comments = row.Comments; } Add(entry); } } catch (Exception ex) { throw ex; } }
public abstract void RemoveList(DispatchDS entries);
public abstract void AddList(DispatchDS entries);
public override bool Update() { //Update this object and all child objects bool bRet = false; try { DispatchDS ds = new DispatchDS(); ds.Merge(base.mMediator.FillDataset(base.mDataFile, "", null)); DispatchDS.TrailerLogTableRow row = (DispatchDS.TrailerLogTableRow)ds.TrailerLogTable.Select("ID = " + this._id)[0]; row.Created = this._created; row.CreatedBy = this._createdby; row.TrailerNumber = this._trailernumber; row.IncomingDate = this._incomingdate; row.IncomingCarrier = this._incomingcarrier; row.IncomingSeal = this._incomingseal; row.IncomingDriverName = this._incomingdrivername; row.InitialYardLocation = this._initialyardlocation; row.LoadSheetReady = this._loadsheetready; row.MoveInProgress = this._moveinprogress; row.OutgoingDate = this._outgoingdate; row.OutgoingCarrier = this._outgoingcarrier; row.OutgoingSeal = this._outgoingseal; row.OutgoingDriverName = this._outgoingdrivername; row.MovedOut = this._movedout; row.Comments = this._comments; for (int i = 0; i < this.mTrailerMoves.TrailerMoveTable.Rows.Count; i++) { DispatchDS.TrailerMoveTableRow _row = (DispatchDS.TrailerMoveTableRow) this.mTrailerMoves.TrailerMoveTable[i]; if (_row.RowState == DataRowState.Added) { DispatchDS.TrailerMoveTableRow __row = (DispatchDS.TrailerMoveTableRow)ds.TrailerMoveTable.NewTrailerMoveTableRow(); __row.ID = _row.ID; __row.Requested = _row.Requested; __row.RequestedBy = _row.RequestedBy; if (!_row.IsMoveFromNull()) { __row.MoveFrom = _row.MoveFrom; } if (!_row.IsMoveToNull()) { __row.MoveTo = _row.MoveTo; } if (!_row.IsSwitcherNull()) { __row.Switcher = _row.Switcher; } if (!_row.IsLoadedWithNull()) { __row.LoadedWith = _row.LoadedWith; } if (!_row.IsScheduledTimeNull()) { __row.ScheduledTime = _row.ScheduledTime; } if (!_row.IsActualTimeNull()) { __row.ActualTime = _row.ActualTime; } __row.TrailerLogTableRow = row; ds.TrailerMoveTable.AddTrailerMoveTableRow(__row); } else if (_row.RowState == DataRowState.Modified) { DispatchDS.TrailerMoveTableRow __row = (DispatchDS.TrailerMoveTableRow)ds.TrailerMoveTable.Select("ID = " + _row.ID)[0]; if (!_row.IsMoveFromNull()) { __row.MoveFrom = _row.MoveFrom; } if (!_row.IsMoveToNull()) { __row.MoveTo = _row.MoveTo; } if (!_row.IsSwitcherNull()) { __row.Switcher = _row.Switcher; } if (!_row.IsLoadedWithNull()) { __row.LoadedWith = _row.LoadedWith; } if (!_row.IsScheduledTimeNull()) { __row.ScheduledTime = _row.ScheduledTime; } if (!_row.IsActualTimeNull()) { __row.ActualTime = _row.ActualTime; } } else if (_row.RowState == DataRowState.Deleted) { DispatchDS.TrailerMoveTableRow __row = (DispatchDS.TrailerMoveTableRow)ds.TrailerMoveTable.Select("ID = " + _row.ID)[0]; __row.Delete(); } } ds.TrailerMoveTable.AcceptChanges(); ds.TrailerLogTable.AcceptChanges(); bRet = base.mMediator.ExecuteNonQuery(base.mDataFile, new object[] { ds }); bRet = true; base.OnEntryChanged(this, new EventArgs()); } catch (Exception ex) { throw ex; } return(bRet); }
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; } }
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; } }
public override void AddList(DispatchDS list) { //Add a list of entries to this schedule try { for (int i = 0; i < list.PickupLogTable.Rows.Count; i++) { DispatchDS.PickupLogTableRow row = list.PickupLogTable[i]; Pickup entry = (Pickup)Item(); entry.ID = row.ID; entry.Created = row.Created; entry.CreatedBy = row.CreatedBy; if (!row.IsCallerNameNull()) { entry.CallerName = row.CallerName; } if (!row.IsClientNameNull()) { entry.ClientName = row.ClientName; } if (!row.IsShipperNameNull()) { entry.ShipperName = row.ShipperName; } if (!row.IsShipperAddressNull()) { entry.ShipperAddress = row.ShipperAddress; } if (!row.IsDeliveryWindowNull()) { entry.DeliveryWindow = row.DeliveryWindow; } if (!row.IsTerminalNull()) { entry.Terminal = row.Terminal; } if (!row.IsDriverNameNull()) { entry.DriverName = row.DriverName; } if (!row.IsAmountNull()) { entry.Amount = row.Amount; } if (!row.IsAmountTypeNull()) { entry.AmountType = row.AmountType; } if (!row.IsFreightTypeNull()) { entry.FreightType = row.FreightType; } if (!row.IsAutoNumberNull()) { entry.AutoNumber = row.AutoNumber; } if (!row.IsRequestDateNull()) { entry.RequestDate = row.RequestDate; } if (!row.IsPickUpDateNull()) { entry.PickUpDate = row.PickUpDate; } if (!row.IsCommentsNull()) { entry.Comments = row.Comments; } if (!row.IsUpdatedNull()) { entry.Updated = row.Updated; } if (!row.IsMustBeReadyNull()) { entry.MustBeReady = row.MustBeReady; } if (!row.IsPickedUpNull()) { entry.PickedUp = row.PickedUp; } Add(entry); } } catch (Exception ex) { throw ex; } }