Visual Basic 2010 Modified Shipping Hub App
ShippingHubModified/ShippingHubModified/bin/Debug/ShippingHubModified.exe
ShippingHubModified/ShippingHubModified/bin/Debug/ShippingHubModified.pdb
ShippingHubModified/ShippingHubModified/bin/Debug/ShippingHubModified.vshost.exe
ShippingHubModified/ShippingHubModified/bin/Debug/ShippingHubModified.vshost.exe.manifest
ShippingHubModified/ShippingHubModified/bin/Debug/ShippingHubModified.xml
ShippingHubModified
ShippingHubModified/ShippingHubModified/My Project/Application.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.239 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.ShippingHubModified.ShippingHubForm End Sub End Class End Namespace
ShippingHubModified/ShippingHubModified/My Project/Application.myapp
<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>ShippingHubForm</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>
ShippingHubModified/ShippingHubModified/My Project/AssemblyInfo.vb
Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("ShippingHubModified")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("ShippingHubModified")> <Assembly: AssemblyCopyright("Copyright © 2008")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("4735f78c-768a-4d94-b944-d16b07559fb8")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>
ShippingHubModified/ShippingHubModified/My Project/Resources.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.239 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Imports System Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("ShippingHubModified.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set resourceCulture = value End Set End Property End Module End Namespace
ShippingHubModified/ShippingHubModified/My Project/Resources.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
ShippingHubModified/ShippingHubModified/My Project/Settings.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.239 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.ShippingHubModified.My.MySettings Get Return Global.ShippingHubModified.My.MySettings.Default End Get End Property End Module End Namespace
ShippingHubModified/ShippingHubModified/My Project/Settings.settings
ShippingHubModified/ShippingHubModified/obj/Debug/DesignTimeResolveAssemblyReferences.cache
ShippingHubModified/ShippingHubModified/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
ShippingHubModified/ShippingHubModified/obj/Debug/ShippingHubModified.exe
ShippingHubModified/ShippingHubModified/obj/Debug/ShippingHubModified.pdb
ShippingHubModified/ShippingHubModified/obj/Debug/ShippingHubModified.Resources.resources
ShippingHubModified/ShippingHubModified/obj/Debug/ShippingHubModified.ShippingHubForm.resources
ShippingHubModified/ShippingHubModified/obj/Debug/ShippingHubModified.vbproj.FileListAbsolute.txt
C:\Solutions\Tutorial20Solutions\ShippingHubModified\ShippingHubModified\bin\Debug\ShippingHubModified.exe C:\Solutions\Tutorial20Solutions\ShippingHubModified\ShippingHubModified\bin\Debug\ShippingHubModified.pdb C:\Solutions\Tutorial20Solutions\ShippingHubModified\ShippingHubModified\bin\Debug\ShippingHubModified.xml C:\Solutions\Tutorial20Solutions\ShippingHubModified\ShippingHubModified\obj\Debug\ResolveAssemblyReference.cache C:\Solutions\Tutorial20Solutions\ShippingHubModified\ShippingHubModified\obj\Debug\ShippingHubModified.Resources.resources C:\Solutions\Tutorial20Solutions\ShippingHubModified\ShippingHubModified\obj\Debug\ShippingHubModified.ShippingHubForm.resources C:\Solutions\Tutorial20Solutions\ShippingHubModified\ShippingHubModified\obj\Debug\ShippingHubModified.vbproj.GenerateResource.Cache C:\Solutions\Tutorial20Solutions\ShippingHubModified\ShippingHubModified\obj\Debug\ShippingHubModified.exe C:\Solutions\Tutorial20Solutions\ShippingHubModified\ShippingHubModified\obj\Debug\ShippingHubModified.xml C:\Solutions\Tutorial20Solutions\ShippingHubModified\ShippingHubModified\obj\Debug\ShippingHubModified.pdb C:\Examples\Tutorial20\Exercises\ShippingHubModified\ShippingHubModified\obj\Debug\ShippingHubModified.exe C:\Examples\Tutorial20\Exercises\ShippingHubModified\ShippingHubModified\obj\Debug\ShippingHubModified.xml C:\Examples\Tutorial20\Exercises\ShippingHubModified\ShippingHubModified\obj\Debug\ShippingHubModified.pdb C:\books\2012\SimplyVB2010\Examples\ch20\Exercises\ShippingHubModified\ShippingHubModified\obj\Debug\ShippingHubModified.exe C:\books\2012\SimplyVB2010\Examples\ch20\Exercises\ShippingHubModified\ShippingHubModified\obj\Debug\ShippingHubModified.xml C:\books\2012\SimplyVB2010\Examples\ch20\Exercises\ShippingHubModified\ShippingHubModified\obj\Debug\ShippingHubModified.pdb C:\Users\Garrett\Documents\CSCI 310 - Spring 2015\TEMPLATES\ch20\Exercises\ShippingHubModified\ShippingHubModified\obj\Debug\ShippingHubModified.exe C:\Users\Garrett\Documents\CSCI 310 - Spring 2015\TEMPLATES\ch20\Exercises\ShippingHubModified\ShippingHubModified\obj\Debug\ShippingHubModified.xml C:\Users\Garrett\Documents\CSCI 310 - Spring 2015\TEMPLATES\ch20\Exercises\ShippingHubModified\ShippingHubModified\obj\Debug\ShippingHubModified.pdb
ShippingHubModified/ShippingHubModified/obj/Debug/ShippingHubModified.vbproj.GenerateResource.Cache
ShippingHubModified/ShippingHubModified/obj/Debug/ShippingHubModified.xml
ShippingHubModified
ShippingHubModified/ShippingHubModified/obj/Debug/TempPE/My Project.Resources.Designer.vb.dll
ShippingHubModified/ShippingHubModified/Package.vb
Public Class Package Private addressValue As String ' package address Private cityValue As String ' package city Private stateValue As String ' package state Private zipValue As String ' package zip code Private timeValue As Date ' arrival time Private packagenumberValue As Integer ' package number ' CPackage contructor Public Sub New(packageID As Integer) ArrivalTime = Date.Now SetPackage(String.Empty, String.Empty, String.Empty, String.Empty) PackageNumber = packageID ' unique package number End Sub ' New ' set properties of CPackage object Private Sub SetPackage(address As String, city As String, state As String, zip As String) addressValue = address cityValue = City stateValue = state zipValue = zip End Sub ' SetPackage ' property Address Public Property Address() As String ' get addressValue Get Return addressValue End Get ' set addressValue Set(value As String) addressValue = value End Set End Property ' Address ' property City Public Property City() As String ' get cityValue Get Return cityValue End Get ' set cityValue Set(value As String) cityValue = value End Set End Property ' City ' property State Public Property State() As String ' get stateValue Get Return stateValue End Get ' set stateValue Set(value As String) stateValue = value End Set End Property ' State ' property Zip Public Property Zip() As String ' get zipValue Get Return zipValue End Get ' set zipValue Set(value As String) zipValue = value End Set End Property ' Zip ' property PackageNumber Public Property PackageNumber() As Integer ' get packagenumberValue Get Return packagenumberValue End Get ' set packagenumberValue Set(value As Integer) packagenumberValue = value End Set End Property ' PackageNumber ' property ArrivalTime Public Property ArrivalTime() As Date ' get timeValue Get Return timeValue End Get ' set timeValue Set(value As Date) timeValue = value End Set End Property ' ArrivalTime End Class ' Package '************************************************************************** '* (C) Copyright 1992-2013 by Deitel & Associates, Inc. and * '* Pearson Education, Inc. All Rights Reserved. * '* * '* DISCLAIMER: The authors and publisher of this book have used their * '* best efforts in preparing the book. These efforts include the * '* development, research, and testing of the theories and programs * '* to determine their effectiveness. The authors and publisher make * '* no warranty of any kind, expressed or implied, with regard to these * '* programs or to the documentation contained in these books. The authors * '* and publisher shall not be liable in any event for incidental or * '* consequential damages in connection with, or arising out of, the * '* furnishing, performance, or use of these programs. * '**************************************************************************
ShippingHubModified/ShippingHubModified/ShippingHub.Designer.vb
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class ShippingHubForm Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.informationGroupBox = New System.Windows.Forms.GroupBox Me.arrivalTimeLabel = New System.Windows.Forms.Label Me.arrivedLabel = New System.Windows.Forms.Label Me.zipTextBox = New System.Windows.Forms.TextBox Me.stateComboBox = New System.Windows.Forms.ComboBox Me.cityTextBox = New System.Windows.Forms.TextBox Me.addressTextBox = New System.Windows.Forms.TextBox Me.packageNumberLabel = New System.Windows.Forms.Label Me.Label7 = New System.Windows.Forms.Label Me.stateLabel = New System.Windows.Forms.Label Me.cityLabel = New System.Windows.Forms.Label Me.addressLabel = New System.Windows.Forms.Label Me.packageIDLabel = New System.Windows.Forms.Label Me.addButton = New System.Windows.Forms.Button Me.newButton = New System.Windows.Forms.Button Me.removeButton = New System.Windows.Forms.Button Me.editUpdateButton = New System.Windows.Forms.Button Me.backButton = New System.Windows.Forms.Button Me.viewPackagesComboBox = New System.Windows.Forms.ComboBox Me.packagesListBox = New System.Windows.Forms.ListBox Me.nextButton = New System.Windows.Forms.Button Me.listByGroupBox = New System.Windows.Forms.GroupBox Me.informationGroupBox.SuspendLayout() Me.listByGroupBox.SuspendLayout() Me.SuspendLayout() ' 'informationGroupBox ' Me.informationGroupBox.Controls.Add(Me.arrivalTimeLabel) Me.informationGroupBox.Controls.Add(Me.arrivedLabel) Me.informationGroupBox.Controls.Add(Me.zipTextBox) Me.informationGroupBox.Controls.Add(Me.stateComboBox) Me.informationGroupBox.Controls.Add(Me.cityTextBox) Me.informationGroupBox.Controls.Add(Me.addressTextBox) Me.informationGroupBox.Controls.Add(Me.packageNumberLabel) Me.informationGroupBox.Controls.Add(Me.Label7) Me.informationGroupBox.Controls.Add(Me.stateLabel) Me.informationGroupBox.Controls.Add(Me.cityLabel) Me.informationGroupBox.Controls.Add(Me.addressLabel) Me.informationGroupBox.Controls.Add(Me.packageIDLabel) Me.informationGroupBox.Enabled = False Me.informationGroupBox.Location = New System.Drawing.Point(13, 13) Me.informationGroupBox.Name = "informationGroupBox" Me.informationGroupBox.Size = New System.Drawing.Size(554, 185) Me.informationGroupBox.TabIndex = 0 Me.informationGroupBox.TabStop = False Me.informationGroupBox.Text = "Package Information" ' 'arrivalTimeLabel ' Me.arrivalTimeLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D Me.arrivalTimeLabel.Location = New System.Drawing.Point(310, 35) Me.arrivalTimeLabel.Name = "arrivalTimeLabel" Me.arrivalTimeLabel.Size = New System.Drawing.Size(235, 23) Me.arrivalTimeLabel.TabIndex = 9 Me.arrivalTimeLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft ' 'arrivedLabel ' Me.arrivedLabel.AutoSize = True Me.arrivedLabel.Location = New System.Drawing.Point(243, 39) Me.arrivedLabel.Name = "arrivedLabel" Me.arrivedLabel.Size = New System.Drawing.Size(61, 15) Me.arrivedLabel.TabIndex = 8 Me.arrivedLabel.Text = "Arrived at:" ' 'zipTextBox ' Me.zipTextBox.Location = New System.Drawing.Point(445, 145) Me.zipTextBox.MaxLength = 5 Me.zipTextBox.Name = "zipTextBox" Me.zipTextBox.Size = New System.Drawing.Size(100, 23) Me.zipTextBox.TabIndex = 3 Me.zipTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Right ' 'stateComboBox ' Me.stateComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.stateComboBox.FormattingEnabled = True Me.stateComboBox.Items.AddRange(New Object() {"AL", "FL", "GA", "KY", "MS", "NC", "SC", "TN", "VA", "WV"}) Me.stateComboBox.Location = New System.Drawing.Point(285, 145) Me.stateComboBox.Name = "stateComboBox" Me.stateComboBox.Size = New System.Drawing.Size(75, 23) Me.stateComboBox.TabIndex = 2 ' 'cityTextBox ' Me.cityTextBox.Location = New System.Drawing.Point(87, 145) Me.cityTextBox.Name = "cityTextBox" Me.cityTextBox.Size = New System.Drawing.Size(100, 23) Me.cityTextBox.TabIndex = 1 ' 'addressTextBox ' Me.addressTextBox.Location = New System.Drawing.Point(87, 90) Me.addressTextBox.Name = "addressTextBox" Me.addressTextBox.Size = New System.Drawing.Size(458, 23) Me.addressTextBox.TabIndex = 0 ' 'packageNumberLabel ' Me.packageNumberLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D Me.packageNumberLabel.Location = New System.Drawing.Point(87, 35) Me.packageNumberLabel.Name = "packageNumberLabel" Me.packageNumberLabel.Size = New System.Drawing.Size(138, 23) Me.packageNumberLabel.TabIndex = 7 Me.packageNumberLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft ' 'Label7 ' Me.Label7.AutoSize = True Me.Label7.Location = New System.Drawing.Point(412, 148) Me.Label7.Name = "Label7" Me.Label7.Size = New System.Drawing.Size(27, 15) Me.Label7.TabIndex = 11 Me.Label7.Text = "Zip:" ' 'stateLabel ' Me.stateLabel.AutoSize = True Me.stateLabel.Location = New System.Drawing.Point(243, 148) Me.stateLabel.Name = "stateLabel" Me.stateLabel.Size = New System.Drawing.Size(36, 15) Me.stateLabel.TabIndex = 10 Me.stateLabel.Text = "State:" ' 'cityLabel ' Me.cityLabel.AutoSize = True Me.cityLabel.Location = New System.Drawing.Point(13, 148) Me.cityLabel.Name = "cityLabel" Me.cityLabel.Size = New System.Drawing.Size(31, 15) Me.cityLabel.TabIndex = 6 Me.cityLabel.Text = "City:" ' 'addressLabel ' Me.addressLabel.AutoSize = True Me.addressLabel.Location = New System.Drawing.Point(13, 93) Me.addressLabel.Name = "addressLabel" Me.addressLabel.Size = New System.Drawing.Size(52, 15) Me.addressLabel.TabIndex = 5 Me.addressLabel.Text = "Address:" ' 'packageIDLabel ' Me.packageIDLabel.AutoSize = True Me.packageIDLabel.Location = New System.Drawing.Point(13, 39) Me.packageIDLabel.Name = "packageIDLabel" Me.packageIDLabel.Size = New System.Drawing.Size(68, 15) Me.packageIDLabel.TabIndex = 4 Me.packageIDLabel.Text = "Package ID:" ' 'addButton ' Me.addButton.Enabled = False Me.addButton.Location = New System.Drawing.Point(108, 213) Me.addButton.Name = "addButton" Me.addButton.Size = New System.Drawing.Size(75, 23) Me.addButton.TabIndex = 2 Me.addButton.Text = "&Add" Me.addButton.UseVisualStyleBackColor = True ' 'newButton ' Me.newButton.Location = New System.Drawing.Point(13, 213) Me.newButton.Name = "newButton" Me.newButton.Size = New System.Drawing.Size(75, 23) Me.newButton.TabIndex = 1 Me.newButton.Text = "&Scan New" Me.newButton.UseVisualStyleBackColor = True ' 'removeButton ' Me.removeButton.Enabled = False Me.removeButton.Location = New System.Drawing.Point(203, 213) Me.removeButton.Name = "removeButton" Me.removeButton.Size = New System.Drawing.Size(75, 23) Me.removeButton.TabIndex = 3 Me.removeButton.Text = "&Remove" Me.removeButton.UseVisualStyleBackColor = True ' 'editUpdateButton ' Me.editUpdateButton.Enabled = False Me.editUpdateButton.Location = New System.Drawing.Point(298, 213) Me.editUpdateButton.Name = "editUpdateButton" Me.editUpdateButton.Size = New System.Drawing.Size(75, 23) Me.editUpdateButton.TabIndex = 4 Me.editUpdateButton.Text = "&Edit" Me.editUpdateButton.UseVisualStyleBackColor = True ' 'backButton ' Me.backButton.Enabled = False Me.backButton.Location = New System.Drawing.Point(393, 213) Me.backButton.Name = "backButton" Me.backButton.Size = New System.Drawing.Size(75, 23) Me.backButton.TabIndex = 5 Me.backButton.Text = "< &BACK" Me.backButton.UseVisualStyleBackColor = True ' 'viewPackagesComboBox ' Me.viewPackagesComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.viewPackagesComboBox.FormattingEnabled = True Me.viewPackagesComboBox.Items.AddRange(New Object() {"AL", "FL", "GA", "KY", "MS", "NC", "SC", "TN", "VA", "WV"}) Me.viewPackagesComboBox.Location = New System.Drawing.Point(41, 35) Me.viewPackagesComboBox.Name = "viewPackagesComboBox" Me.viewPackagesComboBox.Size = New System.Drawing.Size(121, 23) Me.viewPackagesComboBox.TabIndex = 0 ' 'packagesListBox ' Me.packagesListBox.FormattingEnabled = True Me.packagesListBox.ItemHeight = 15 Me.packagesListBox.Location = New System.Drawing.Point(41, 74) Me.packagesListBox.Name = "packagesListBox" Me.packagesListBox.Size = New System.Drawing.Size(121, 139) Me.packagesListBox.TabIndex = 1 ' 'nextButton ' Me.nextButton.Enabled = False Me.nextButton.Location = New System.Drawing.Point(492, 213) Me.nextButton.Name = "nextButton" Me.nextButton.Size = New System.Drawing.Size(75, 23) Me.nextButton.TabIndex = 6 Me.nextButton.Text = "&NEXT >" Me.nextButton.UseVisualStyleBackColor = True ' 'listByGroupBox ' Me.listByGroupBox.Controls.Add(Me.packagesListBox) Me.listByGroupBox.Controls.Add(Me.viewPackagesComboBox) Me.listByGroupBox.Location = New System.Drawing.Point(583, 13) Me.listByGroupBox.Name = "listByGroupBox" Me.listByGroupBox.Size = New System.Drawing.Size(200, 223) Me.listByGroupBox.TabIndex = 7 Me.listByGroupBox.TabStop = False Me.listByGroupBox.Text = "Packages by Destination" ' 'ShippingHubForm ' Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 15.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(797, 249) Me.Controls.Add(Me.informationGroupBox) Me.Controls.Add(Me.addButton) Me.Controls.Add(Me.newButton) Me.Controls.Add(Me.removeButton) Me.Controls.Add(Me.editUpdateButton) Me.Controls.Add(Me.backButton) Me.Controls.Add(Me.nextButton) Me.Controls.Add(Me.listByGroupBox) Me.Font = New System.Drawing.Font("Segoe UI", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Name = "ShippingHubForm" Me.Text = "Shipping Hub" Me.informationGroupBox.ResumeLayout(False) Me.informationGroupBox.PerformLayout() Me.listByGroupBox.ResumeLayout(False) Me.ResumeLayout(False) End Sub Friend WithEvents informationGroupBox As System.Windows.Forms.GroupBox Friend WithEvents arrivalTimeLabel As System.Windows.Forms.Label Friend WithEvents arrivedLabel As System.Windows.Forms.Label Friend WithEvents zipTextBox As System.Windows.Forms.TextBox Friend WithEvents stateComboBox As System.Windows.Forms.ComboBox Friend WithEvents cityTextBox As System.Windows.Forms.TextBox Friend WithEvents addressTextBox As System.Windows.Forms.TextBox Friend WithEvents packageNumberLabel As System.Windows.Forms.Label Friend WithEvents Label7 As System.Windows.Forms.Label Friend WithEvents stateLabel As System.Windows.Forms.Label Friend WithEvents cityLabel As System.Windows.Forms.Label Friend WithEvents addressLabel As System.Windows.Forms.Label Friend WithEvents packageIDLabel As System.Windows.Forms.Label Friend WithEvents addButton As System.Windows.Forms.Button Friend WithEvents newButton As System.Windows.Forms.Button Friend WithEvents removeButton As System.Windows.Forms.Button Friend WithEvents editUpdateButton As System.Windows.Forms.Button Friend WithEvents backButton As System.Windows.Forms.Button Friend WithEvents viewPackagesComboBox As System.Windows.Forms.ComboBox Friend WithEvents packagesListBox As System.Windows.Forms.ListBox Friend WithEvents nextButton As System.Windows.Forms.Button Friend WithEvents listByGroupBox As System.Windows.Forms.GroupBox End Class
ShippingHubModified/ShippingHubModified/ShippingHub.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
ShippingHubModified/ShippingHubModified/ShippingHub.vb
Public Class ShippingHubForm Private list As System.Collections.Generic.List(Of Package) Private packageObject As Package ' current package Private position As Integer ' position of current package Private randomObject As Random ' random number for package ID Private packageID As Integer ' individual package number ' Form Load event Private Sub ShippingHubForm_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load position = 0 ' set initial position to zero randomObject = New Random() ' create new Random object packageID = randomObject.Next(1, 100000) ' new package ID ' show first state in ComboBox (using the Items property) stateComboBox.Text = _ Convert.ToString(stateComboBox.Items.Item(0)) list = New System.Collections.Generic.List(Of Package)() End Sub ' ShippingHubForm_Load ' Scan New Button Click event Private Sub newButton_Click(sender As System.Object, e As System.EventArgs) Handles newButton.Click packageID += 1 ' increment package ID packageObject = New Package(packageID) ' create package ClearControls() ' clear fields packageNumberLabel.Text = _ packageObject.PackageNumber.ToString() ' package number arrivalTimeLabel.Text = _ packageObject.ArrivalTime.ToString() ' display arrival time ' only allow user to add package informationGroupBox.Enabled = True ' disable GroupBox and controls SetButtons(False) ' enable/disable Buttons addButton.Enabled = True ' enable Add Button newButton.Enabled = False ' disable Scan New Button addressTextBox.Focus() ' transfer the focus to addressTextBox End Sub ' newButton_Click ' Add Button Click event Private Sub addButton_Click(sender As System.Object, e As System.EventArgs) Handles addButton.Click SetPackage() ' set Package properties from TextBoxes list.Add(packageObject) ' add package to List informationGroupBox.Enabled = False ' disable GroupBox SetButtons(True) ' enable appropriate Buttons ' package cannot be added until Scan New is clicked addButton.Enabled = False ' disable Add Button ' if package's state displayed, add ID to ListBox If stateComboBox.Text = viewPackagesComboBox.Text Then packagesListBox.Items.Add(packageObject.PackageNumber) End If viewPackagesComboBox.Text = packageObject.State ' list package newButton.Enabled = True ' enable Scan New Button End Sub ' addButton_Click ' Back Button Click event Private Sub backButton_Click(sender As System.Object, e As System.EventArgs) Handles backButton.Click ' move backward one package in the list If position > 0 Then position -= 1 Else ' wrap to end of list position = list.Count - 1 End If LoadPackage() ' load package data from item in list End Sub ' backButton_Click ' Next Button Click event Private Sub nextButton_Click(sender As System.Object, e As System.EventArgs) Handles nextButton.Click ' move forward one package in the list If position < list.Count - 1 Then position += 1 Else position = 0 ' wrap to beginning of list End If LoadPackage() ' load package data from item in list End Sub ' nextButton_Click ' Remove Button click event Private Sub RemoveButton_Click(sender As System.Object, e As System.EventArgs) Handles removeButton.Click ' remove ID from ListBox if state displayed If stateComboBox.Text = viewPackagesComboBox.Text Then packagesListBox.Items.Remove(packageObject.PackageNumber) End If list.RemoveAt(position) ' remove package from list ' load next package in list if there is one If list.Count > 0 Then ' if not at first position, go to previous one If position > 0 Then position -= 1 End If LoadPackage() ' load package data from item in list Else ClearControls() ' clear fields End If SetButtons(True) ' enable appropriate Buttons End Sub ' RemoveButton_Click ' Edit/Update Button Click event Private Sub editUpdateButton_Click(sender As System.Object, e As System.EventArgs) Handles editUpdateButton.Click ' when Button reads "Edit", allow user to ' edit package information only If editUpdateButton.Text = "&Edit" Then informationGroupBox.Enabled = True SetButtons(False) editUpdateButton.Enabled = True ' change Button text from "Edit" to "Update" editUpdateButton.Text = "&Update" Else ' when Button reads "Update" remove the old package ' data and add new data from TextBoxes SetPackage() list.RemoveAt(position) list.Insert(position, packageObject) ' display state in ComboBox viewPackagesComboBox.Text = packageObject.State ' when done, return to normal operating state informationGroupBox.Enabled = False ' disable GroupBox SetButtons(True) ' enable appropriate Buttons ' change Button text from "Update" to "Edit" editUpdateButton.Text = "&Edit" End If End Sub ' editUpdateButton_Click ' set package properties Private Sub SetPackage() packageObject.Address = addressTextBox.Text packageObject.City = cityTextBox.Text packageObject.State = _ Convert.ToString(stateComboBox.SelectedItem) packageObject.Zip = zipTextBox.Text End Sub ' SetPackage ' load package information into Form Private Sub LoadPackage() ' retrieve package from list packageObject = list.Item(position) ' display package data addressTextBox.Text = packageObject.Address cityTextBox.Text = packageObject.City stateComboBox.Text = packageObject.State zipTextBox.Text = packageObject.Zip arrivalTimeLabel.Text = _ packageObject.ArrivalTime.ToString() packageNumberLabel.Text = _ packageObject.PackageNumber.ToString() End Sub ' LoadPackage ' clear all the input controls on the Form Private Sub ClearControls() addressTextBox.Clear() cityTextBox.Clear() zipTextBox.Clear() stateComboBox.SelectedText = String.Empty arrivalTimeLabel.Text = String.Empty packageNumberLabel.Text = String.Empty End Sub ' ClearControls ' enable/disable Buttons Private Sub SetButtons(state As Boolean) removeButton.Enabled = state editUpdateButton.Enabled = state nextButton.Enabled = state backButton.Enabled = state ' disable navigation if not multiple packages If list.Count < 2 Then nextButton.Enabled = False backButton.Enabled = False End If ' if no items, disable Remove and Edit/Update Buttons If list.Count = 0 Then editUpdateButton.Enabled = False removeButton.Enabled = False End If End Sub ' SetButtons ' event raised when user selects a new state in ComboBox Private Sub viewPackagesComboBox_SelectedIndexChanged( sender As System.Object, e As System.EventArgs) _ Handles viewPackagesComboBox.SelectedIndexChanged Dim viewPackage As Package ' control variable package Dim state As String = _ Convert.ToString(viewPackagesComboBox.SelectedItem) packagesListBox.Items.Clear() ' clear ListBox Dim stateQuery = From p In list Where p.State = state Select p ' list all packages for current state in ListBox For Each viewPackage In stateQuery ' display the Package's id in the ListBox packagesListBox.Items.Add(viewPackage.PackageNumber) Next End Sub ' viewPackagesComboBox_SelectedIndexChanged ' handles ListBox's DoubleClick event Private Sub packagesListBox_DoubleClick(sender As Object, e As System.EventArgs) Handles packagesListBox.DoubleClick End Sub ' packagesListBox_DoubleClick End Class ' ShippingHubForm ' ************************************************************************** ' * (C) Copyright 1992-2013 by Deitel & Associates, Inc. and * ' * Pearson Education, Inc. All Rights Reserved. * ' * * ' * DISCLAIMER: The authors and publisher of this book have used their * ' * best efforts in preparing the book. These efforts include the * ' * development, research, and testing of the theories and programs * ' * to determine their effectiveness. The authors and publisher make * ' * no warranty of any kind, expressed or implied, with regard to these * ' * programs or to the documentation contained in these books. The authors * ' * and publisher shall not be liable in any event for incidental or * ' * consequential damages in connection with, or arising out of, the * ' * furnishing, performance, or use of these programs. * ' **************************************************************************
ShippingHubModified/ShippingHubModified/ShippingHubModified.vbproj
Debug AnyCPU 9.0.21022 2.0 {FE2C8518-E1AD-4C85-BE0E-8E043A800FCE} WinExe ShippingHubModified.My.MyApplication ShippingHubModified ShippingHubModified 512 WindowsForms v4.0 On Binary On On 3.5 true full true true bin\Debug\ ShippingHubModified.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355 pdbonly false true true bin\Release\ ShippingHubModified.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355 3.5 3.5 3.5 Form ShippingHub.vb Form True Application.myapp True True Resources.resx True Settings.settings True VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer ShippingHub.vb Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb
ShippingHubModified/ShippingHubModified/ShippingHubModified.vbproj.user
ShippingHubModified/ShippingHubModified.sln
Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Basic Express 2010 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ShippingHubModified", "ShippingHubModified\ShippingHubModified.vbproj", "{FE2C8518-E1AD-4C85-BE0E-8E043A800FCE}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {FE2C8518-E1AD-4C85-BE0E-8E043A800FCE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FE2C8518-E1AD-4C85-BE0E-8E043A800FCE}.Debug|Any CPU.Build.0 = Debug|Any CPU {FE2C8518-E1AD-4C85-BE0E-8E043A800FCE}.Release|Any CPU.ActiveCfg = Release|Any CPU {FE2C8518-E1AD-4C85-BE0E-8E043A800FCE}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal