public StationFreightAssignment(SortStation station, InboundFreight freight, string sortType) { //Constructor try { //Configure this assignment from the assignment configuration information this.mStation = station; this.mFreight = freight; this.mSortType = sortType; } catch (Exception ex) { throw new ApplicationException("Unexpected error while creating new Station Assignment instance.", ex); } }
public static SortStation GetStation(string number) { //Get a station SortStation station = null; IDictionaryEnumerator oEnum = SortStations.GetEnumerator(); while (oEnum.MoveNext()) { DictionaryEntry oEntry = (DictionaryEntry)oEnum.Current; if (oEntry.Key.ToString() == number.Trim().PadLeft(3, '0')) { station = (SortStation)oEntry.Value; break; } } return(station); }
public void RefreshIndirectAssignments() { //Load trip assignments try { this.mIndirectAssignments.Clear(); StationAssignmentDS assignments = new StationAssignmentDS(); assignments.Merge(this.mMediator.FillDataset(App.USP_INDIRECTASSIGNMENTS, App.TBL_INDIRECTASSIGNMENTS, null)); foreach (StationAssignmentDS.IndirectAssignmentTableRow row in assignments.IndirectAssignmentTable) { SortStation station = EnterpriseFactory.GetStation(row.StationNumber); InboundFreight freight = FreightFactory.CreateInboundFreight(0, row.TripNumber, "", "", 0); this.mIndirectAssignments.Add(station.Number + freight.FreightID, new StationFreightAssignment(station, freight, "")); } } catch (Exception ex) { throw ex; } finally { if (IndirectAssignmentsChanged != null) { IndirectAssignmentsChanged(this, EventArgs.Empty); } } }
public static void RefreshSortStations() { //Load sort stations for this terminal try { SortStations.Clear(); WorkstationDS workstations = new WorkstationDS(); workstations.Merge(Mediator.FillDataset(App.USP_SORTSTATIONS, App.TBL_SORTSTATIONS, null)); for (int i = 0; i < workstations.WorkstationDetailTable.Rows.Count; i++) { EnterpriseTerminal terminal = GetTerminal(workstations.WorkstationDetailTable[i].TerminalID); SortStation station = new SortStation(workstations.WorkstationDetailTable[i], terminal); SortStations.Add(station.Number.Trim().PadLeft(3, '0'), station); } } catch (Exception ex) { throw new ApplicationException("Unexpected error while refreshing sort stations.", ex); } finally { if (SortStationsChanged != null) { SortStationsChanged(null, EventArgs.Empty); } } }
public void RefreshDirectAssignments() { //Load direct freight assignments try { this.mDirectAssignments.Clear(); StationAssignmentDS assignments = new StationAssignmentDS(); assignments.Merge(this.mMediator.FillDataset(App.USP_DIRECTASSIGNMENTS, App.TBL_DIRECTASSIGNMENTS, null)); foreach (StationAssignmentDS.DirectAssignmentTableRow row in assignments.DirectAssignmentTable) { SortStation station = EnterpriseFactory.GetStation(row.StationNumber); Client client = EnterpriseFactory.CreateClient(row.ClientNumber, row.ClientDivision, row.Client, "", "", "", "", ""); Shipper shipper = EnterpriseFactory.CreateShipper(row.FreightType, row.ShipperNumber, row.Shipper, "", "", "", "", "", ""); InboundFreight freight = FreightFactory.CreateInboundFreight(row.TerminalID, row.FreightID, row.FreightType, row.TDSNumber, "", row.TrailerNumber, row.Pickup, row.Pickup, 0, client, shipper); this.mDirectAssignments.Add(station.Number + freight.FreightID, new StationFreightAssignment(station, freight, row.SortType)); } } catch (Exception ex) { throw ex; } finally { if (DirectAssignmentsChanged != null) { DirectAssignmentsChanged(this, EventArgs.Empty); } } }