Home

XML-Based Applications:
Georgetown Cleaning Services

 

Introduction to Serialization

XML has become a platform of choice to create data-based applications. For example, if may employees are working on the same application they share, you can create a common form they would use to create their work orders and save them to a common repository. You can make this possible for almost any type of application. We will apply this concept to our Georgetown Cleaning Services, which is an application used by a dry cleaning store.

In this application, a form will be presented to the user who, after processing an order, will click the Save button. The order will be saved to a common file. Eventually, all orders would be saved there and a user will be able to review all orders from that common file.

Practical Learning Practical Learning: Introducing File-Based Databases

  1. Start a new Windows Application named GCS4
  2. Design the form as follows:
     
    Control Name Text Additional Properties
    GroupBox GroupBox   Order Identification  
    Label Label   Customer Name:  
    TextBox TextBox txtCustomerName    
    Label Label   Customer Phone:  
    TextBox TextBox txtCustomerPhone    
    Label Label   Date Left:  
    DateTimePicker DateTimePicker dtpDateLeft   Format: Custom
    Custom Format: dddd dd MMM yyyy
    Label Label   Time Left:  
    DateTimePicker DateTimePicker dtpTimeLeft   Format: Time
    Label Label   Date Expected:  
    DateTimePicker DateTimePicker dtpDateExpected   Format: Custom
    Custom Format: dddd dd MMM yyyy
    Label     Time Expected:  
    DateTimePicker DateTimePicker dtpTimeExpected   Format: Time
    GroupBox GroupBox   Order Processing  
    Label Label   Item Type  
    Label Label   Unit Price  
    Label Label   Qty  
    Label Label   Sub Total  
    Label Label   Shirts  
    TextBox TextBox txtShirtsUnitPrice 1.25 TextAlign: Right
    TextBox TextBox txtShirtsQuantity 0 TextAlign: Right
    TextBox TextBox txtShirtsSubTotal 0.00 TextAlign: Right
    Label Label   Pants  
    TextBox TextBox txtPantsUnitPrice 1.95 TextAlign: Right
    TextBox TextBox txtPantsQuantity   TextAlign: Right
    TextBox TextBox txtPantsSubTotal 0.00 TextAlign: Right
    ComboBox ComboBox cboItem1 None  
    TextBox TextBox txtItem1UnitPrice 0.00 TextAlign: Right
    TextBox TextBox txtItem1Quantity 0 TextAlign: Right
    TextBox TextBox txtItem1SubTotal 0.00 TextAlign: Right
    ComboBox ComboBox cboItem2 None  
    TextBox TextBox txtItem2UnitPrice 0.00 TextAlign: Right
    TextBox TextBox txtItem2Quantity 0 TextAlign: Right
    TextBox TextBox txtItem2SubTotal 0.00 TextAlign: Right
    ComboBox ComboBox cboItem3 None  
    TextBox TextBox txtItem3UnitPrice 0.00 TextAlign: Right
    TextBox TextBox txtItem3Quantity 0 TextAlign: Right
    TextBox TextBox txtItem3SubTotal 0.00 TextAlign: Right
    ComboBox ComboBox cboItem4 None  
    TextBox TextBox txtItem4UnitPrice 0.00 TextAlign: Right
    TextBox TextBox txtItem4Quantity 0 TextAlign: Right
    TextBox TextBox txtItem4SubTotal 0.00 TextAlign: Right
    GroupBox GroupBox   Order Summary  
    Label Label   Cleaning Total:  
    TextBox TextBox txtCleaningTotal 0.00 TextAlign: Right
    Label Label   Tax Rate:  
    TextBox TextBox txtTaxRate 5.75 TextAlign: Right
    Label Label   %  
    Label Label   Tax Amount:  
    TextBox TextBox txtTaxAmount 0.00 TextAlign: Right
    Label Label   Net Total:  
    TextBox TextBox txtNetPrice 0.00 TextAlign: Right
    Button Button btnClose Close  
    GroupBox     Maintenance  
    Button Button btnSave Save  
    Button Button btnReset Reset  
    Label Label   Receipt #:  
    TextBox TextBox txtReceiptNumber 1  
    Button Button btnOpen Open  
  3. Click each combo box. Access its Items property and fill it up as follows:
     
    Women Suit
    Dress
    Regular Skirt
    Skirt With Hook
    Men's Suit 2Pc
    Men's Suit 3Pc
    Sweaters
    Silk Shirt
    Tie
    Coat
    Jacket
    Swede
  4. Click OK and save All
  5. On the form, double-click the Time Left control and implement its ValueChanged event as follows:
     
    Private Sub dtpTimeLeft_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles dtpTimeLeft.ValueChanged
            Dim dateLeft As DateTime = dtpDateLeft.Value
            Dim timeLeft As DateTime = dtpTimeLeft.Value
    
            Dim time9AM As DateTime = New DateTime(timeLeft.Year, timeLeft.Month, timeLeft.Day, 9, 0, 0)
    
            ' If the customer leaves clothes before 9AM...
            If timeLeft <= time9AM Then
                ' ... then they should be ready the same day after 5PM
                dtpDateExpected.Value = dateLeft
                dtpTimeExpected.Value = New DateTime(dateLeft.Year, dateLeft.Month, dateLeft.Day, 17, 0, 0)
            Else
                ' If the clothese were left after 9AM, they will be availablethe following morning at 8AM
                dtpDateExpected.Value = New DateTime(dateLeft.Year, dateLeft.Month, dateLeft.Day + 1)
                dtpTimeExpected.Value = New DateTime(dateLeft.Year, dateLeft.Month, dateLeft.Day + 1, 8, 0, 0)
            End If
    End Sub
  6. Just under the above End Sub line, implement the following procedure:
     
    Private Sub CalculateTotal()
            Dim unitPriceShirts As Double, unitPricePants As Double, unitPriceItem1 As Double, _
          unitPriceItem2 As Double, unitPriceItem3 As Double, unitPriceItem4 As Double
            Dim subTotalShirts As Double, subTotalPants As Double, subTotalItem1 As Double, _
                subTotalItem2 As Double, subTotalItem3 As Double, subTotalItem4 As Double
    	 dim    qtyShirts as integer = 1, qtyPants as Integer = 1, qtyItem1 as Integer = 1, _
    		    qtyItem2 = 1, qtyItem3 = 1, qtyItem4 = 4
            Dim cleaningTotal As Double, taxRate As Double, taxAmount As Double, netPrice As Double
    
            ' Retrieve the unit price of this item
            ' Just in case the user types an invalid value, we are using a try...catch
            Try
                unitPriceShirts = CDbl(txtShirtsUnitPrice.Text)
            Catch fex As FormatException
                MsgBox("The value you entered for the price of shirts is not valid" & _
                              vbCrLf & "Please try again")
            End Try
    
            ' Retrieve the number of this item
            ' Just in case the user types an invalid value, we are using a try...catch
            Try
                qtyShirts = CInt(txtShirtsQuantity.Text)
            Catch fex As FormatException
                MsgBox("The value you entered for the number of shirts is not valid" & _
                              vbCrLf & "Please try again")
            End Try
    
            Try
                unitPricePants = CDbl(txtPantsUnitPrice.Text)
            Catch fex As FormatException
                MsgBox("The value you entered for the price of pants is not valid" & _
                              vbCrLf & "Please try again")
            End Try
    
            Try
                qtyPants = CInt(txtPantsQuantity.Text)
            Catch fex As FormatException
    		msgbox("The value you entered for the number of pants is not valid" & _
    			             vbCrLf & "Please try again")
            End Try
    
            Try
                unitPriceItem1 = CDbl(txtItem1UnitPrice.Text)
            Catch fex As FormatException
    		msgbox("The value you entered for the price is not valid" & _
    			             vbCrLf & "Please try again")
            End Try
    
            Try
                qtyItem1 = CInt(txtItem1Quantity.Text)
            Catch fex As FormatException
                MsgBox("The value you entered is not valid" & _
                              vbCrLf & "Please try again")
            End Try
    
            Try
                unitPriceItem2 = CDbl(txtItem2UnitPrice.Text)
            Catch fex As FormatException
    		msgbox("The value you entered for the price is not valid" & _
    			             vbCrLf & "Please try again")
            End Try
    
            Try
                qtyItem2 = CInt(txtItem2Quantity.Text)
            Catch fex As FormatException
    		msgbox("The value you entered is not valid" & _
    			             vbCrLf & "Please try again")
            End Try
    
            Try
                unitPriceItem3 = CDbl(txtItem3UnitPrice.Text)
            Catch fex As FormatException
    		msgbox("The value you entered for the price is not valid" & _
    			             vbCrLf & "Please try again")
            End Try
    
            Try
                qtyItem3 = CInt(txtItem3Quantity.Text)
            Catch fex As FormatException
    		msgbox("The value you entered is not valid" & _
    			             vbCrLf & "Please try again")
            End Try
    
            Try
                unitPriceItem4 = CDbl(txtItem4UnitPrice.Text)
            Catch fex As FormatException
                MsgBox("The value you entered for the price is not valid" & _
                              vbCrLf & "Please try again")
            End Try
    
            Try
                qtyItem4 = CInt(txtItem4Quantity.Text)
            Catch fex As FormatException
    		msgbox("The value you entered is not valid" & _
    			             vbCrLf & "Please try again")
            End Try
    
            ' Calculate the sub-total for this item
            subTotalShirts = qtyShirts * unitPriceShirts
            subTotalPants = qtyPants * unitPricePants
            subTotalItem1 = qtyItem1 * unitPriceItem1
            subTotalItem2 = qtyItem2 * unitPriceItem2
            subTotalItem3 = qtyItem3 * unitPriceItem3
            subTotalItem4 = qtyItem4 * unitPriceItem4
    
            ' Calculate the total based on sub-totals
    	cleaningTotal = subTotalShirts + subTotalPants + subTotalItem1 + _
    				 subTotalItem2 + subTotalItem3 + subTotalItem4
    
            taxRate = CDbl(txtTaxRate.Text)
            ' Calculate the amount owed for the taxes
            taxAmount = cleaningTotal * taxRate / 100
            ' Add the tax amount to the total order
            netPrice = cleaningTotal + taxAmount
    
            ' Display the sub-total in the corresponding text box
            txtShirtsSubTotal.Text = subTotalShirts.ToString("F")
            txtPantsSubTotal.Text = subTotalPants.ToString("F")
            txtItem1SubTotal.Text = subTotalItem1.ToString("F")
            txtItem2SubTotal.Text = subTotalItem2.ToString("F")
            txtItem3SubTotal.Text = subTotalItem3.ToString("F")
            txtItem4SubTotal.Text = subTotalItem4.ToString("F")
    
            txtCleaningTotal.Text = cleaningTotal.ToString("F")
            txtTaxAmount.Text = taxAmount.ToString("F")
            txtNetPrice.Text = netPrice.ToString("F")
        End Sub
  7. In the Class Name combo box, select txtShirtsQuantity
  8. In the Method Name combo box, select Leave and implement the event as follows:
     
    Private Sub txtShirtsQuantity_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtShirtsQuantity.Leave
            CalculateTotal()
    End Sub
  9. In the Class Name combo box, select txtPantsQuantity
  10. In the Method Name combo box, select Leave and implement the event as follows:
     
    Private Sub txtPantsQuantity_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtPantsQuantity.Leave
            CalculateTotal()
    End Sub
  11. In the Class Name combo box, select txtItem1Quantity
  12. In the Method Name combo box, select Leave and implement the event as follows:
     
    Private Sub txtItem1Quantity_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtItem1Quantity.Leave
            If cboItem1.Text <> "None" Then
                CalculateTotal()
            Else
                MsgBox("Make sure you select an item in the combo box")
            End If
    End Sub
  13. In the Class Name combo box, select txtItem2Quantity
  14. In the Method Name combo box, select Leave and implement the event as follows:
    Private Sub txtItem2Quantity_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtItem2Quantity.Leave
            If cboItem2.Text <> "None" Then
                CalculateTotal()
            Else
                MsgBox("Make sure you select an item in the combo box")
            End If
        End Sub
  15. In the Class Name combo box, select txtItem3Quantity
  16. In the Method Name combo box, select Leave and implement the event as follows:
     
    Private Sub txtItem3Quantity_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtItem3Quantity.Leave
            If cboItem3.Text <> "None" Then
                CalculateTotal()
            Else
                MsgBox("Make sure you select an item in the combo box")
            End If
    End Sub
  17. In the Class Name combo box, select txtItem4Quantity
  18. In the Method Name combo box, select Leave and implement the event as follows:
     
    Private Sub txtItem4Quantity_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtItem4Quantity.Leave
            If cboItem4.Text <> "None" Then
                CalculateTotal()
            Else
                MsgBox("Make sure you select an item in the combo box")
            End If
    End Sub
  19. In the Class Name combo box, select txtTaxRate
  20. In the Method Name combo box, select Leave and implement the event as follows:
     
    Private Sub txtTaxRate_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtTaxRate.Leave
            CalculateTotal()
    End Sub
  21. In the Class Name combo box, select txtTaxRate
  22. In the Method Name combo box, select Click and implement its Click event as follows:
     
    Private Sub btnClose_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnClose.Click
            End
    End Sub
  23. Return to the form.
    Double-click the Reset button and implement its event as follows:
     
    Private Sub btnReset_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnReset.Click
            ' Reset the controls
            Me.txtCustomerName.Text = ""
            Me.txtCustomerPhone.Text = ""
            Me.txtShirtsUnitPrice.Text = "1.25"
            Me.txtShirtsQuantity.Text = "0"
            Me.txtShirtsSubTotal.Text = "0.00"
            Me.txtPantsUnitPrice.Text = "1.95"
            Me.txtPantsQuantity.Text = "0"
            Me.txtPantsSubTotal.Text = "0.00"
            Me.cboItem1.Text = "None"
            Me.txtItem1UnitPrice.Text = "0.00"
            Me.txtItem1Quantity.Text = "0"
            Me.txtItem1SubTotal.Text = "0.00"
            Me.cboItem2.Text = "None"
            Me.txtItem2UnitPrice.Text = "0.00"
            Me.txtItem2Quantity.Text = "0"
            Me.txtItem2SubTotal.Text = "0.00"
            Me.cboItem3.Text = "None"
            Me.txtItem3UnitPrice.Text = "0.00"
            Me.txtItem3Quantity.Text = "0"
            Me.txtItem3SubTotal.Text = "0.00"
            Me.cboItem4.Text = "None"
            Me.txtItem4UnitPrice.Text = "0.00"
            Me.txtItem4Quantity.Text = "0"
            Me.txtItem4SubTotal.Text = "0.00"
            Me.txtCleaningTotal.Text = "0.00"
            Me.txtTaxRate.Text = "5.75"
            Me.txtTaxAmount.Text = "0.00"
            Me.txtNetPrice.Text = "0.00"
            Me.txtCustomerName.Focus()
    End Sub
  24. In the top section of the file, above the first line of code, type:
     
    Imports System.IO
    Imports System.xml
    Imports System.Globalization
  25. In the Class Name combo box, select btnSave
  26. In the Method Name combo box, select Click and implement the event as follows:
     
    Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
            ' This is the name of the file that holds or will hold the cleaning orders
            Dim strFilename As String = "CleaningOrders.xml"
            Dim xmlDoc As XmlDocument = New XmlDocument
    
            ' Find out if the file exists already
            ' If it doesn't, then create it
            If Not File.Exists(strFilename) Then
                xmlDoc.LoadXml("<?xml version=""1.0"" encoding=""utf-8""?>" & _
                               "<CleaningOrders></CleaningOrders>")
                xmlDoc.Save(strFilename)
            End If
    
            ' Open the XML file
            xmlDoc.Load(strFilename)
            ' Locate the CleaningOrder element that holds an individual entry
            Dim lstOrders As XmlNodeList = xmlDoc.GetElementsByTagName("CleaningOrder")
    
            ' If a cleaning order exists already, then increment its number
            ' Warning: this code assumes that the cleaning orders are not deleted
            If lstOrders.Count > 0 Then count = lstOrders.Count + 1
    
            '  Create a cleaning order element
            Dim elmXML As XmlElement = xmlDoc.CreateElement("CleaningOrder")
            ' Add a receipt number as an attribute of the order
            elmXML.SetAttribute("ReceiptNumber", CStr(count))
            '  Create the child elements of a cleaning order
            Dim strNewCleaning As String = "<CustomerName>" & Me.txtCustomerName.Text & _
             "</CustomerName>" & _
              "<CustomerPhone>" & Me.txtCustomerPhone.Text & "</CustomerPhone>" & _
              "<DateLeft>" & _
              dtpDateLeft.Value.ToString("D", DateTimeFormatInfo.InvariantInfo) & _
              "</DateLeft>" & _
              "<TimeLeft>" & _
              dtpTimeLeft.Value.ToString("t", DateTimeFormatInfo.InvariantInfo) & _
              "</TimeLeft>" & _
              "<DateExpected>" & _
              dtpDateExpected.Value.ToString("D", DateTimeFormatInfo.InvariantInfo) & _
              "</DateExpected>" & _
              "<TimeExpected>" & _
              dtpTimeExpected.Value.ToString("t", DateTimeFormatInfo.InvariantInfo) & _
              "</TimeExpected>" & _
              "<ShirtsUnitPrice>" & txtShirtsUnitPrice.Text & "</ShirtsUnitPrice>" & _
              "<ShirtsQuantity>" & txtShirtsUnitPrice.Text & "</ShirtsQuantity>" & _
              "<ShirtsSubTotal>" & txtShirtsSubTotal.Text & "</ShirtsSubTotal>" & _
              "<PantsUnitPrice>" & txtShirtsUnitPrice.Text & "</PantsUnitPrice>" & _
              "<PantsQuantity>" & txtPantsQuantity.Text & "</PantsQuantity>" & _
              "<PantsSubTotal>" & txtPantsSubTotal.Text & "</PantsSubTotal>" & _
              "<Item1>" & cboItem1.Text & "</Item1>" & _
              "<Item1UnitPrice>" & txtItem1UnitPrice.Text + "</Item1UnitPrice>" & _
              "<Item1Quantity>" & txtItem1Quantity.Text + "</Item1Quantity>" & _
              "<Item1SubTotal>" & txtItem1SubTotal.Text + "</Item1SubTotal>" & _
              "<Item2>" & cboItem2.Text & "</Item2>" & _
              "<Item2UnitPrice>" & txtItem2UnitPrice.Text & "</Item2UnitPrice>" & _
              "<Item2Quantity>" & txtItem2Quantity.Text & "</Item2Quantity>" & _
              "<Item2SubTotal>" & txtItem2SubTotal.Text & "</Item2SubTotal>" & _
              "<Item3>" & cboItem3.Text & "</Item3>" & _
              "<Item3UnitPrice>" & txtItem3UnitPrice.Text & "</Item3UnitPrice>" & _
              "<Item3Quantity>" & txtItem3Quantity.Text & "</Item3Quantity>" & _
              "<Item3SubTotal>" & txtItem3SubTotal.Text & "</Item3SubTotal>" & _
              "<Item4>" & cboItem4.Text & "</Item4>" & _
              "<Item4UnitPrice>" & txtItem4UnitPrice.Text + "</Item4UnitPrice>" & _
              "<Item4Quantity>" & txtItem4Quantity.Text & "</Item4Quantity>" & _
              "<Item4SubTotal>" & txtItem4SubTotal.Text & "</Item4SubTotal>" & _
              "<CleaningTotal>" & txtCleaningTotal.Text & "</CleaningTotal>" & _
              "<TaxRate>" & txtTaxRate.Text & "</TaxRate>" & _
              "<TaxAmount>" & txtTaxAmount.Text & "</TaxAmount>" & _
              "<NetPrice>" & txtNetPrice.Text & "</NetPrice>"
    
            elmXML.InnerXml = strNewCleaning
            '  Add the new cleaning order to the file
            xmlDoc.DocumentElement.AppendChild(elmXML)
    
            '  Save the file
            xmlDoc.Save(strFilename)
            '  In case the user will add a new cleaning order,
            '  increment the receipt number
            count = count + 1
    
            '  Reset the form in case the user wants 
            ' to add a new cleaning order
            btnReset_Click(sender, e)
    End Sub
  27. Execute the application
  28. Process a few orders and save each
     
  29. Close the forms and return to your programming environment
  30. In the Class Name combo box, select btnOpen
  31. In the Method Name combo box, select Click and implement its Click events as follows:
     
    Private Sub btnOpen_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnOpen.Click
            Dim strFilename As String = "CleaningOrders.xml"
            Dim xmlDoc As XmlDocument = New XmlDocument
    
            ' If the XML file cannot be found, let the user know and give up
            If Not File.Exists(strFilename) Then
                MsgBox("No cleaning order exists or the file cannot be found")
                Exit Sub
            End If
    
            ' In case the file exists, open it
            xmlDoc.Load(strFilename)
    
            ' Get a list of the elements whose values are CleaningOrder
            Dim lstOrders As XmlNodeList = xmlDoc.GetElementsByTagName("CleaningOrder")
    
            ' Check each cleaning order
            Dim i As Integer
            For i = 0 To lstOrders.Count - 1 Step 1
                ' If you find a cleaning order with the receipt number
                If lstOrders.ItemOf(i).Attributes.ItemOf("ReceiptNumber").Value = txtReceiptNumber.Text Then
                    ' Once you find that cleaning order, get the value of each node and display
                    ' them in the form
                    txtCustomerName.Text = lstOrders.ItemOf(i).Item("CustomerName").InnerText
                    txtCustomerPhone.Text = lstOrders.ItemOf(i).Item("CustomerPhone").InnerText
                    Me.dtpDateLeft.Value = Convert.ToDateTime(lstOrders.ItemOf(i).Item("DateLeft").InnerText)
                    Me.dtpTimeLeft.Value = Convert.ToDateTime(lstOrders.ItemOf(i).Item("TimeLeft").InnerText)
                    Me.dtpDateExpected.Value = Convert.ToDateTime(lstOrders.ItemOf(i).Item("DateExpected").InnerText)
                    Me.dtpTimeExpected.Value = Convert.ToDateTime(lstOrders.ItemOf(i).Item("TimeExpected").InnerText)
                    Me.txtShirtsUnitPrice.Text = lstOrders.ItemOf(i).Item("ShirtsUnitPrice").InnerText
                    Me.txtShirtsQuantity.Text = lstOrders.ItemOf(i).Item("ShirtsQuantity").InnerText
                    Me.txtShirtsSubTotal.Text = lstOrders.ItemOf(i).Item("ShirtsSubTotal").InnerText
                    Me.txtPantsUnitPrice.Text = lstOrders.ItemOf(i).Item("PantsUnitPrice").InnerText
                    Me.txtPantsQuantity.Text = lstOrders.ItemOf(i).Item("PantsQuantity").InnerText
                    Me.txtPantsSubTotal.Text = lstOrders.ItemOf(i).Item("PantsSubTotal").InnerText
                    Me.cboItem1.Text = lstOrders.ItemOf(i).Item("Item1").InnerText
                    Me.txtItem1UnitPrice.Text = lstOrders.ItemOf(i).Item("Item1UnitPrice").InnerText
                    Me.txtItem1Quantity.Text = lstOrders.ItemOf(i).Item("Item1Quantity").InnerText
                    Me.txtItem1SubTotal.Text = lstOrders.ItemOf(i).Item("Item1SubTotal").InnerText
                    Me.cboItem2.Text = lstOrders.ItemOf(i).Item("Item2").InnerText
                    Me.txtItem2UnitPrice.Text = lstOrders.ItemOf(i).Item("Item2UnitPrice").InnerText
                    Me.txtItem2Quantity.Text = lstOrders.ItemOf(i).Item("Item2Quantity").InnerText
                    Me.txtItem2SubTotal.Text = lstOrders.ItemOf(i).Item("Item2SubTotal").InnerText
                    Me.cboItem3.Text = lstOrders.ItemOf(i).Item("Item3").InnerText
                    Me.txtItem3UnitPrice.Text = lstOrders.ItemOf(i).Item("Item3UnitPrice").InnerText
                    Me.txtItem3Quantity.Text = lstOrders.ItemOf(i).Item("Item3Quantity").InnerText
                    Me.txtItem3SubTotal.Text = lstOrders.ItemOf(i).Item("Item3SubTotal").InnerText
                    Me.cboItem4.Text = lstOrders.ItemOf(i).Item("Item4").InnerText
                    Me.txtItem4UnitPrice.Text = lstOrders.ItemOf(i).Item("Item4UnitPrice").InnerText
                    Me.txtItem4Quantity.Text = lstOrders.ItemOf(i).Item("Item4Quantity").InnerText
                    Me.txtItem4SubTotal.Text = lstOrders.ItemOf(i).Item("Item4SubTotal").InnerText
                    Me.txtCleaningTotal.Text = lstOrders.ItemOf(i).Item("CleaningTotal").InnerText
                    Me.txtTaxRate.Text = lstOrders.ItemOf(i).Item("TaxRate").InnerText
                    Me.txtTaxAmount.Text = lstOrders.ItemOf(i).Item("TaxAmount").InnerText
                    Me.txtNetPrice.Text = lstOrders.ItemOf(i).Item("NetPrice").InnerText
                End If
            Next
    End Sub		
  32. Execute the application
  33. Enter a number such as 1 or 2 in the Receipt # text box and click Open
 
 

Home Copyright © 2004-2011 FunctionX