示例#1
0
 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);
               }
     }
 }
示例#2
0
 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);
               }
     }
 }