public static StationAssignment GetAssignment(string stationNumber, string tripNumber) { //Get a station assignment StationAssignment assignment = null; int cartonCount = 0; string carrier = "", trailerNumber = ""; try { //Merge from collection (dataset) DataRow[] rows = _Assignments.BwareStationTripTable.Select("StationNumber='" + stationNumber + "' AND TripNumber='" + tripNumber + "'"); if (rows.Length > 0) { //Existing assignment BearwareDS.BwareStationTripTableRow row = (BearwareDS.BwareStationTripTableRow)rows[0]; cartonCount = row.CartonCount; carrier = row.Carrier; trailerNumber = row.TrailerNumber; } else { //New assignment cartonCount = 0; carrier = trailerNumber = ""; } Workstation station = new Workstation(stationNumber); BearwareTrip trip = new BearwareTrip(tripNumber, cartonCount, carrier, trailerNumber); assignment = new StationAssignment("", station, trip); assignment.Changed += new EventHandler(OnAssignmentChanged); } catch (Exception ex) { throw ex; } return(assignment); }
public static BearwareTrip GetTripAssignment(string stationNumber) { //Get the trip assigned to the specified station BearwareTrip trip = null; try { DataSet ds = App.Mediator.FillDataset(USP_TRIP_ASSIGNMENT, TBL_TRIP_ASSIGNMENT, new object[] { stationNumber }); if (ds.Tables[TBL_TRIP_ASSIGNMENT].Rows.Count == 0) { throw new ApplicationException("There are no trips assigned to station " + stationNumber + "."); } else if (ds.Tables[TBL_TRIP_ASSIGNMENT].Rows.Count > 0) { BearwareDS dsAssignment = new BearwareDS(); dsAssignment.Merge(ds); BearwareDS.BwareTripTableRow row = (BearwareDS.BwareTripTableRow)dsAssignment.BwareTripTable.Rows[0]; trip = new BearwareTrip(); trip.Number = row.Number.TrimEnd(); trip.CartonCount = row.IsCartonCountNull() ? 0 : row.CartonCount; trip.Carrier = row.IsCarrierNull() ? "" : row.Carrier.TrimEnd(); trip.TrailerNumber = row.IsTrailerNumberNull() ? "" : row.TrailerNumber.TrimEnd(); } } catch (Exception ex) { throw new ApplicationException("Unexpected error reading trip assignments for station " + stationNumber + ".", ex); } return(trip); }
public StationAssignment(string assignmentID, Workstation sortStation, BearwareTrip inboundFreight) { //Constructor try { //Configure this assignment from the assignment configuration information this.mAssignmentID = assignmentID; this.mStation = sortStation; this.mFreight = inboundFreight; } catch (Exception ex) { throw new ApplicationException("Unexpected error while creating new StationAssignment instance.", ex); } }
public Carton(string scan, BearwareTrip shipment, Client client, Store store, ClientVendor shipper, Zone zone, Workstation workstation) { //Constructor try { this.mScanData = scan; this.mInboundFreight = shipment; this.mClient = client; this.mStore = store; this.mClientVendor = shipper; this.mZone = zone; this.mWorkstation = workstation; } catch (Exception ex) { throw new ApplicationException("Unexpected error creating new Carton instance.", ex); } }
//Interface public dlgTrip(ref BearwareTrip trip) { //Constructor try { //Required for Windows Form Designer support InitializeComponent(); #region Set command button identities (used for onclick handler) this.btnCancel.Text = CMD_CANCEL; this.btnOK.Text = CMD_OK; #endregion //Set members this.mTrip = trip; this.Text = "Add New Trip"; } catch (Exception ex) { throw ex; } }
public void RefreshTripAssignment() { //Update trip assignment for this station string priorTripNumber = ""; try { this.mCartonsScanned = 0; priorTripNumber = (this.mAssignment != null) ? this.mAssignment.Number : ""; this.mAssignment = null; this.mAssignment = FreightService.GetTripAssignment(this.mStation.Number); } catch (ApplicationException ex) { throw ex; } catch (Exception ex) { throw new ApplicationException("Unexpected error while refreshing trip assignments.", ex); } finally { if (this.AssignmentChanged != null) { this.AssignmentChanged(this, EventArgs.Empty); } } }
public static BearwareTrip GetFreight(string tripNumber) { //Get a Bearware trip BearwareTrip trip = null; try { if (tripNumber.Length > 0) { //Merge from collection (dataset) BearwareDS.BwareTripTableRow row = (BearwareDS.BwareTripTableRow)_InboundFreight.BwareTripTable.Select("Number='" + tripNumber + "'")[0]; trip = new BearwareTrip(row); } else { trip = new BearwareTrip(); } trip.Changed += new EventHandler(OnTripChanged); } catch (Exception ex) { throw ex; } return(trip); }