private void OnFormLoad(object sender, System.EventArgs e) { //Initialize controls - set default values this.Cursor = Cursors.WaitCursor; try { //Set initial services this.Visible = true; Application.DoEvents(); //Get lists this.mCodesDS = FreightFactory.ViewDamageCodes(); //Set control services this.txtCode.MaxLength = 3; this.txtCode.Text = ""; if (!this.mCodeDS.DamageCodeTable[0].IsCodeNull()) { this.txtCode.Text = this.mCodeDS.DamageCodeTable[0].Code.ToString(); } this.txtCode.Enabled = !(this.mCode > 0); this.txtCodeDescription.MaxLength = 30; this.txtCodeDescription.Text = ""; if (!this.mCodeDS.DamageCodeTable[0].IsDescriptionNull()) { this.txtCodeDescription.Text = this.mCodeDS.DamageCodeTable[0].Description; } } catch (Exception ex) { reportError(ex); } finally { this.btnOk.Enabled = false; this.Cursor = Cursors.Default; } }
public static StationAssignments GetStationAssignments(Workstation workstation) { //Return a collection of current freight assignments for the specified workstation StationAssignments assignments = null; try { if (workstation == null) { throw new ApplicationException("Workstation is null."); } assignments = new StationAssignments(); StationAssignmentDS dsAssignments = new StationAssignmentDS(); dsAssignments.Merge(Mediator.FillDataset(USP_FREIGHTCLIENTSHIPPER, TBL_FREIGHTCLIENTSHIPPER, new object[] { workstation.WorkStationID })); foreach (StationAssignmentDS.FreightClientShipperTableRow row in dsAssignments.FreightClientShipperTable) { Client client = EnterpriseFactory.CreateClient(row.ClientNumber, row.ClientDivision, row.Client, row.ClientAddressLine1, row.ClientAddressLine2, row.ClientAddressCity, row.ClientAddressState, row.ClientAddressZip); Shipper shipper = EnterpriseFactory.CreateShipper(row.FreightType, row.ShipperNumber, row.Shipper, row.ShipperAddressLine1, row.ShipperAddressLine2, row.ShipperAddressCity, row.ShipperAddressState, row.ShipperAddressZip, row.ShipperUserData); InboundFreight shipment = FreightFactory.CreateInboundFreight(row.TerminalID, row.FreightID, row.FreightType, row.TDSNumber, row.VendorKey, row.TrailerNumber, row.PickupDate, row.PickupNumber, row.CubeRatio, client, shipper); SortProfile profile = CreateSortProfile(shipment, row.SortTypeID, row.SortType, row.LabelID, row.ExcLocation); assignments.Add(new StationAssignment("", workstation, shipment, profile)); } } catch (ApplicationException ex) { throw ex; } catch (Exception ex) { throw new ApplicationException("Unexpected error while getting station assignments (freight-client-shipper).", ex); } return(assignments); }
private InboundLabel mInboundLabel = null; //Expected inbound label //Constants //Events //Interface public SortProfile(SortProfileDS.SortProfileTableRow profile) { //Constructor try { if (profile != null) { this.mFreightType = profile.FreightType; this.mSortTypeID = profile.SortTypeID; this.mSortType = profile.SortType; this.mClientNumber = profile.ClientNumber; this.mClientDivision = profile.ClientDivision; if (!profile.IsVendorNumberNull()) { this.mVendorNumber = profile.VendorNumber; } this.mStatus = profile.Status; if (!profile.IsExceptionLocationNull()) { this.mExceptionDeliveryLocation = profile.ExceptionLocation; } if (!profile.IsLabelIDNull()) { this.mLabelID = profile.LabelID; } //Create the inbound label for this profile; this.mInboundLabel = FreightFactory.CreateInboundLabel(this.mLabelID); } } catch (ApplicationException ex) { throw ex; } catch (Exception ex) { throw new ApplicationException("Unexpected error while creating new Sort Profile instance.", ex); } }
public void RefreshCache() { //Refresh cached data try { //Validate operator state if (!this.mOperatorWorking) { throw new ApplicationException("Station Operator not started for work; call StartWork() before RefreshCache()."); } //Refresh all factory caches SortedItem.ErrorLabelTemplate = SortFactory.CreateOBLabelTemplate(this.mErrorLabelNumber, this.Station.PrinterType); EnterpriseFactory.RefreshCache(); FreightFactory.RefreshCache(); SortFactory.RefreshCache(); } catch (ApplicationException ex) { throw ex; } catch (Exception ex) { throw new ApplicationException("Unexpected error while refreshing the factory caches.", ex); } }
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 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); } } }