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 Forms 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: System::Void dtpTimeLeft_ValueChanged(System::Object *  sender, System::EventArgs *  e)
    {
    	 DateTime dateLeft = this->dtpDateLeft->Value;
    	 DateTime timeLeft = this->dtpTimeLeft->Value;
    
    	 DateTime time9AM   = DateTime(timeLeft.Year, timeLeft.Month, timeLeft.Day, 9, 0, 0);
    
    	 // If the customer leaves clothes before 9AM...
    	 if( timeLeft <= time9AM )
    	 {
    		 // ... then they should be ready the same day after 5PM
    		 this->dtpDateExpected->Value = dateLeft;
    this->dtpTimeExpected->Value = 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
    	 this->dtpDateExpected->Value = DateTime(dateLeft.Year, dateLeft.Month, dateLeft.Day + 1); 
     this->dtpTimeExpected->Value = DateTime(dateLeft.Year, dateLeft.Month, dateLeft.Day + 1, 8, 0, 0);
    	 }
    }
  6. In the Class View, expand GCS4 followed by GCS4, followed by Form1
  7. Right-click Form1 -> Add -> Add Function...
  8. set the Return Type to void
  9. Set the Function Name to CalculateTotal
  10. Set the Access to private and press Enter
  11. Implement the function as follows:
     
    void CalculateTotal(void)
    {
    	 double unitPriceShirts, unitPricePants, unitPriceItem1,
    		    unitPriceItem2, unitPriceItem3, unitPriceItem4;
    	 double subTotalShirts, subTotalPants, subTotalItem1,
    		    subTotalItem2, subTotalItem3, subTotalItem4;
    	 int    qtyShirts = 1, qtyPants = 1, qtyItem1 = 1,
    		    qtyItem2 = 1, qtyItem3 = 1, qtyItem4 = 4;
    	 double cleaningTotal, taxRate, taxAmount, netPrice;
    
    	 // Retrieve the unit price of this item
    // Just in case the user types an invalid value, we are using a try...catch
    	 try {
    		 unitPriceShirts = this->txtShirtsUnitPrice->Text->ToDouble(0);
    	 }
    	 catch(FormatException *)
    	 {
    MessageBox::Show(S"The value you entered for the price of shirts is not valid"
    			              S"\nPlease try again");
    	 }
    
    	 // Retrieve the number of this item
     // Just in case the user types an invalid value, we are using a try...catch
    	 try {
    		 qtyShirts  = this->txtShirtsQuantity->Text->ToInt16(0);
    	 }
    	 catch(FormatException *)
    	 {
     MessageBox::Show(S"The value you entered for the number of shirts is not valid"
    			              S"\nPlease try again");
    	 }
    	try {
    		unitPricePants = this->txtPantsUnitPrice->Text->ToDouble(0);
    	}
    	catch(FormatException *)
    	{
    MessageBox::Show(S"The value you entered for the price of pants is not valid"
    			             S"\nPlease try again");
    	}
    
    	try {
    		qtyPants  = this->txtPantsQuantity->Text->ToInt16(0);
    	}
    	catch(FormatException *)
    	{
    MessageBox::Show(S"The value you entered for the number of pants is not valid"
    			             S"\nPlease try again");
    	}
    
    	try {
    		unitPriceItem1 = this->txtItem1UnitPrice->Text->ToDouble(0);
    	}
    	catch(FormatException *)
    	{
    	MessageBox::Show(S"The value you entered for the price is not valid"
    			             S"\nPlease try again");
    	}
    	try {
    		qtyItem1  = this->txtItem1Quantity->Text->ToInt16(0);
    	}
    	catch(FormatException *)
    	{
    		MessageBox::Show(S"The value you entered is not valid"
    			             S"\nPlease try again");
    	}
    
    	try {
    		unitPriceItem2 = this->txtItem2UnitPrice->Text->ToDouble(0);
    	}
    	catch(FormatException *)
    	{
    	MessageBox::Show(S"The value you entered for the price is not valid"
    			             S"\nPlease try again");
    	}
    	try {
    		qtyItem2  = this->txtItem2Quantity->Text->ToInt16(0);
    	}
    	catch(FormatException *)
    	{
    		MessageBox::Show(S"The value you entered is not valid"
    			             S"\nPlease try again");
    	}
    
    	try {
    		unitPriceItem3 = this->txtItem3UnitPrice->Text->ToDouble(0);
    	}
    	catch(FormatException *)
    	{
    	MessageBox::Show(S"The value you entered for the price is not valid"
    			             S"\nPlease try again");
    	}
    	try {
    		qtyItem3  = this->txtItem3Quantity->Text->ToInt16(0);
    	}
    	catch(FormatException *)
    	{
    		MessageBox::Show(S"The value you entered is not valid"
    			             S"\nPlease try again");
    	}
    
    	try {
    		unitPriceItem4 = this->txtItem4UnitPrice->Text->ToDouble(0);
    	}
    	catch(FormatException *)
    	{
    	MessageBox::Show(S"The value you entered for the price is not valid"
    			             S"\nPlease try again");
    	}
    	try {
    		qtyItem4  = this->txtItem4Quantity->Text->ToInt16(0);
    	}
    	catch(FormatException *)
    	{
    		MessageBox::Show(S"The value you entered is not valid"
    			             S"\nPlease try again");
    	}
    
    	 // 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 = this->txtTaxRate->Text->ToDouble(0);
    	// 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
    	 this->txtShirtsSubTotal->Text = subTotalShirts.ToString(S"F");
    	this->txtPantsSubTotal->Text = subTotalPants.ToString("F");
    	this->txtItem1SubTotal->Text = subTotalItem1.ToString("F");
    	this->txtItem2SubTotal->Text = subTotalItem2.ToString("F");
    	this->txtItem3SubTotal->Text = subTotalItem3.ToString("F");
    	this->txtItem4SubTotal->Text = subTotalItem4.ToString("F");
    
    	this->txtCleaningTotal->Text = cleaningTotal.ToString(S"F");
    	this->txtTaxAmount->Text = taxAmount.ToString(S"F");
    	this->txtNetPrice->Text = netPrice.ToString(S"F");
    }
  12. Return to the form and click the quantity text box that corresponds to the Shirts
  13. In the Properties window, click the Events button and double-click the Leave field
  14. Implement the event as follows:
     
    System::Void txtShirtsQuantity_Leave(System::Object *  sender, System::EventArgs *  e)
    {
    	 CalculateTotal();
    }
  15. Return to the form and click the quantity text box that corresponds to the Pants
  16. In the Events section of the Properties window, double-click the Leave field and implement the event as follows:
     
    System::Void txtPantsQuantity_Leave(System::Object *  sender, System::EventArgs *  e)
    {
    	 CalculateTotal();
    }
  17. Return to the form and click the quantity text box that corresponds to the first combo box
  18. In the Events section of the Properties window, double-click the Leave field, and implement the event as follows:
     
    System::Void txtItem1Quantity_Leave(System::Object *  sender, System::EventArgs *  e)
    {
    	 if( !this->cboItem1->Text->Equals(S"None") )
    		 CalculateTotal();
    	 else
    		 MessageBox::Show(S"Make sure you select an item in the combo box");
    }
  19. Return to the form and click the quantity text box that corresponds to the second combo box
  20. In the Events section of the Properties window, double-click the Leave field and implement the event as follows:
     
    System::Void txtItem2Quantity_Leave(System::Object *  sender, System::EventArgs *  e)
    {
    	 if( !this->cboItem2->Text->Equals(S"None") )
    		 CalculateTotal();
    	 else
    		 MessageBox::Show(S"Make sure you select an item in the combo box");
    }
  21. Return to the form and click the quantity text box that corresponds to the third combo box
  22. In the Events section of the Properties window, double-click the Leave field and implement the event as follows:
     
    System::Void txtItem3Quantity_Leave(System::Object *  sender, System::EventArgs *  e)
    {
    	 if( !this->cboItem3->Text->Equals(S"None") )
    		 CalculateTotal();
    	 else
    		 MessageBox::Show(S"Make sure you select an item in the combo box");
    }
  23. Return to the form and click the quantity text box that corresponds to the fourth combo box
  24. In the Events section of the Properties window, double-click the Leave field, and implement the event as follows:
     
    System::Void txtItem4Quantity_Leave(System::Object *  sender, System::EventArgs *  e)
    {
    	 if( !this->cboItem4->Text->Equals(S"None") )
    		 CalculateTotal();
    	 else
    		 MessageBox::Show(S"Make sure you select an item in the combo box");
    }
  25. Return to the form and click the Tax Rate text box
  26. In the Events section of the Properties window, double-click the Leave field and implement the event as follows:
     
    System::Void txtTaxRate_Leave(System::Object *  sender, System::EventArgs *  e)
    {
    	 CalculateTotal();
    }
  27. Double-click the Close button and implement its Click event as follows:
     
    System::Void btnClose_Click(System::Object *  sender, System::EventArgs *  e)
    {
    	 Close();
    }
  28. Return to the form.
    Double-click the Reset button and implement its event as follows:
     
    System::Void btnReset_Click(System::Object *  sender, System::EventArgs *  e)
    {
    	 // Reset the controls
    	this->txtCustomerName->Text = S"";
    	this->txtCustomerPhone->Text = S"";
    	this->txtShirtsUnitPrice->Text = S"1.25";
    	this->txtShirtsQuantity->Text = S"0";
    	this->txtShirtsSubTotal->Text = S"0.00";
    	this->txtPantsUnitPrice->Text = S"1.95";
    	this->txtPantsQuantity->Text = S"0";
    	this->txtPantsSubTotal->Text = S"0.00";
    	this->cboItem1->Text = S"None";
    	this->txtItem1UnitPrice->Text = S"0.00";
    	this->txtItem1Quantity->Text = S"0";
    	this->txtItem1SubTotal->Text = S"0.00";
    	this->cboItem2->Text = S"None";
    	this->txtItem2UnitPrice->Text = S"0.00";
    	this->txtItem2Quantity->Text = S"0";
    	this->txtItem2SubTotal->Text = S"0.00";
    	this->cboItem3->Text = S"None";
    	this->txtItem3UnitPrice->Text = S"0.00";
    	this->txtItem3Quantity->Text = S"0";
    	this->txtItem3SubTotal->Text = S"0.00";
    	this->cboItem4->Text = S"None";
    	this->txtItem4UnitPrice->Text = S"0.00";
    	this->txtItem4Quantity->Text = S"0";
    	this->txtItem4SubTotal->Text = S"0.00";
    	this->txtCleaningTotal->Text = S"0.00";
    	this->txtTaxRate->Text = S"5.75";
    	this->txtTaxAmount->Text = S"0.00";
    	this->txtNetPrice->Text = S"0.00";
    	this->txtCustomerName->Focus();
    }
  29. In the top section of the file, under the other using namespace lines, type:
     
    using namespace System::Globalization;
  30. Return to the form and double-click the Save button
  31. Implement the event as follows:
     
    System::Void btnSave_Click(System::Object *  sender, System::EventArgs *  e)
    {
    	 // This is the name of the file that holds or will hold the cleaning orders
    	 String *strFilename = S"CleaningOrders.xml";
    	 XmlDocument *xmlDoc = new XmlDocument;
    
    	 // Find out if the file exists already
    	 // If it doesn't, then create it
    	 if( !File::Exists(strFilename) )
    	 {
    		 xmlDoc->LoadXml(S"<?xml version=\"1.0\" encoding=\"utf-8\"?>"
    				 S"<CleaningOrders></CleaningOrders>");
    		 xmlDoc->Save(strFilename);
    	 }
    
    	 // Open the XML file
    	 xmlDoc->Load(strFilename);
    
    	 // The count variable will allow us to either create 
    	 // a receipt number or increment the current receipt number
    	 static int count = 1;
    	 // Locate the CleaningOrder element that holds an individual entry
    	 XmlNodeList *lstOrders = xmlDoc->GetElementsByTagName(S"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 )
    		 count = lstOrders->Count + 1;
    
    	 // Create a cleaning order element
    	 XmlElement *elmXML = xmlDoc->CreateElement("CleaningOrder");
    	 // Add a receipt number as an attribute of the order
    	 elmXML->SetAttribute(S"ReceiptNumber", count.ToString());
    	 // Create the child elements of a cleaning order
    	 String *strNewCleaning = String::Concat(
    	S"<CustomerName>", this->txtCustomerName->Text, S"</CustomerName>",
    	 S"<CustomerPhone>", this->txtCustomerPhone->Text, S"</CustomerPhone>",
    		 S"<DateLeft>",
     this->dtpDateLeft->Value.ToString(S"D", DateTimeFormatInfo::InvariantInfo),
    		 S"</DateLeft>",
    		 S"<TimeLeft>",
     this->dtpTimeLeft->Value.ToString(S"t", DateTimeFormatInfo::InvariantInfo),
    		 S"</TimeLeft>",
    		 S"<DateExpected>",
     this->dtpDateExpected->Value.ToString(S"D", DateTimeFormatInfo::InvariantInfo),
    		 S"</DateExpected>",
    		 S"<TimeExpected>",
     this->dtpTimeExpected->Value.ToString(S"t", DateTimeFormatInfo::InvariantInfo),
    		 S"</TimeExpected>",
     S"<ShirtsUnitPrice>", this->txtShirtsUnitPrice->Text, S"</ShirtsUnitPrice>",
     S"<ShirtsQuantity>", this->txtShirtsUnitPrice->Text, S"</ShirtsQuantity>",
     S"<ShirtsSubTotal>", this->txtShirtsSubTotal->Text, S"</ShirtsSubTotal>",
     S"<PantsUnitPrice>", this->txtShirtsUnitPrice->Text, S"</PantsUnitPrice>",
     S"<PantsQuantity>", this->txtPantsQuantity->Text, S"</PantsQuantity>",
    	 S"<PantsSubTotal>", this->txtPantsSubTotal->Text, S"</PantsSubTotal>",
    		 S"<Item1>", this->cboItem1->Text, S"</Item1>",
     S"<Item1UnitPrice>", this->txtItem1UnitPrice->Text, S"</Item1UnitPrice>",
     S"<Item1Quantity>", this->txtItem1Quantity->Text, S"</Item1Quantity>",
    	 S"<Item1SubTotal>", this->txtItem1SubTotal->Text, S"</Item1SubTotal>",
    		 S"<Item2>", this->cboItem2->Text, S"</Item2>",
    	 S"<Item2UnitPrice>", this->txtItem2UnitPrice->Text, S"</Item2UnitPrice>",
    	 S"<Item2Quantity>", this->txtItem2Quantity->Text, S"</Item2Quantity>",
    	 S"<Item2SubTotal>", this->txtItem2SubTotal->Text, S"</Item2SubTotal>",
    		 S"<Item3>", this->cboItem3->Text, S"</Item3>",
    	 S"<Item3UnitPrice>", this->txtItem3UnitPrice->Text, S"</Item3UnitPrice>",
    	 S"<Item3Quantity>", this->txtItem3Quantity->Text, S"</Item3Quantity>",
    	 S"<Item3SubTotal>", this->txtItem3SubTotal->Text, S"</Item3SubTotal>",
    		 S"<Item4>", this->cboItem4->Text, S"</Item4>",
    	 S"<Item4UnitPrice>", this->txtItem4UnitPrice->Text, S"</Item4UnitPrice>",
    	 S"<Item4Quantity>", this->txtItem4Quantity->Text, S"</Item4Quantity>",
    	 S"<Item4SubTotal>", this->txtItem4SubTotal->Text, S"</Item4SubTotal>",
    	 S"<CleaningTotal>", this->txtCleaningTotal->Text, S"</CleaningTotal>",
    		 S"<TaxRate>", this->txtTaxRate->Text, S"</TaxRate>",
    		 S"<TaxAmount>", this->txtTaxAmount->Text, S"</TaxAmount>",
    		 S"<NetPrice>", this->txtNetPrice->Text, S"</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++;
    
    	 // Reset the form in case the user wants 
    	 // to add a new cleaning order
    	 this->btnReset_Click(sender, e);
    }
  32. Return to the form.
    Execute the application
  33. Process a few orders and save each
     
  34. Close the forms and return to your programming environment
  35. On the form, double-click the Open button and implement its Click events as follows:
     
    System::Void btnOpen_Click(System::Object *  sender, System::EventArgs *  e)
    {
    	 String *strFilename = S"CleaningOrders.xml";
    	 XmlDocument *xmlDoc = new XmlDocument;
    
    	 // If the XML file cannot be found, let the user know and give up
    	 if( !File::Exists(strFilename) )
    		 {
    			 MessageBox::Show(S"No cleaning order exists or the file cannot be found");
    			 return;
    		 }
    
    	 // In case the file exists, open it
    	 xmlDoc->Load(strFilename);
    
    	 // Get a list of the elements whose values are CleaningOrder
    	 XmlNodeList *lstOrders = xmlDoc->GetElementsByTagName(S"CleaningOrder");
    
    	 // Check each cleaning order
    	 for(int i = 0; i < lstOrders->Count; i++)
    	 {
    		 // If you find a cleaning order with the receipt number
    if( lstOrders->ItemOf[i]->Attributes->ItemOf[S"ReceiptNumber"]->Value->Equals(this->txtReceiptNumber->Text) )
    		 {
    			 // Once you find that cleaning order, get the value of each node and display
    			 // them in the form
    		 this->txtCustomerName->Text = lstOrders->ItemOf[i]->Item[S"CustomerName"]->InnerText;
    	this->txtCustomerPhone->Text = lstOrders->ItemOf[i]->Item[S"CustomerPhone"]->InnerText;
    	this->dtpDateLeft->Value = Convert::ToDateTime(lstOrders->ItemOf[i]->Item[S"DateLeft"]->InnerText);
    	this->dtpTimeLeft->Value = Convert::ToDateTime(lstOrders->ItemOf[i]->Item[S"TimeLeft"]->InnerText);
    this->dtpDateExpected->Value = Convert::ToDateTime(lstOrders->ItemOf[i]->Item[S"DateExpected"]->InnerText);
    this->dtpTimeExpected->Value = Convert::ToDateTime(lstOrders->ItemOf[i]->Item[S"TimeExpected"]->InnerText);(S"t");
    	this->txtShirtsUnitPrice->Text = lstOrders->ItemOf[i]->Item[S"ShirtsUnitPrice"]->InnerText;
    	this->txtShirtsQuantity->Text = lstOrders->ItemOf[i]->Item[S"ShirtsQuantity"]->InnerText;
    	this->txtShirtsSubTotal->Text = lstOrders->ItemOf[i]->Item[S"ShirtsSubTotal"]->InnerText;
    	this->txtPantsUnitPrice->Text = lstOrders->ItemOf[i]->Item[S"PantsUnitPrice"]->InnerText;
    	this->txtPantsQuantity->Text = lstOrders->ItemOf[i]->Item[S"PantsQuantity"]->InnerText;
    	this->txtPantsSubTotal->Text = lstOrders->ItemOf[i]->Item[S"PantsSubTotal"]->InnerText;
    	this->cboItem1->Text = lstOrders->ItemOf[i]->Item[S"Item1"]->InnerText;
    	this->txtItem1UnitPrice->Text = lstOrders->ItemOf[i]->Item[S"Item1UnitPrice"]->InnerText;
    	this->txtItem1Quantity->Text = lstOrders->ItemOf[i]->Item[S"Item1Quantity"]->InnerText;
    	this->txtItem1SubTotal->Text = lstOrders->ItemOf[i]->Item[S"Item1SubTotal"]->InnerText;
    	this->cboItem2->Text = lstOrders->ItemOf[i]->Item[S"Item2"]->InnerText;
    	this->txtItem2UnitPrice->Text = lstOrders->ItemOf[i]->Item[S"Item2UnitPrice"]->InnerText;
    	this->txtItem2Quantity->Text = lstOrders->ItemOf[i]->Item[S"Item2Quantity"]->InnerText;
    	this->txtItem2SubTotal->Text = lstOrders->ItemOf[i]->Item[S"Item2SubTotal"]->InnerText;
    	this->cboItem3->Text = lstOrders->ItemOf[i]->Item[S"Item3"]->InnerText;
    	this->txtItem3UnitPrice->Text = lstOrders->ItemOf[i]->Item[S"Item3UnitPrice"]->InnerText;
    	this->txtItem3Quantity->Text = lstOrders->ItemOf[i]->Item[S"Item3Quantity"]->InnerText;
    	this->txtItem3SubTotal->Text = lstOrders->ItemOf[i]->Item[S"Item3SubTotal"]->InnerText;
    	this->cboItem4->Text = lstOrders->ItemOf[i]->Item[S"Item4"]->InnerText;
    	this->txtItem4UnitPrice->Text = lstOrders->ItemOf[i]->Item[S"Item4UnitPrice"]->InnerText;
    	this->txtItem4Quantity->Text = lstOrders->ItemOf[i]->Item[S"Item4Quantity"]->InnerText;
    	this->txtItem4SubTotal->Text = lstOrders->ItemOf[i]->Item[S"Item4SubTotal"]->InnerText;
    	this->txtCleaningTotal->Text = lstOrders->ItemOf[i]->Item[S"CleaningTotal"]->InnerText;
    	this->txtTaxRate->Text = lstOrders->ItemOf[i]->Item[S"TaxRate"]->InnerText;
    	this->txtTaxAmount->Text = lstOrders->ItemOf[i]->Item[S"TaxAmount"]->InnerText;
    	this->txtNetPrice->Text = lstOrders->ItemOf[i]->Item[S"NetPrice"]->InnerText;
    		 }
    	 }
    		 }
  36. Execute the application
  37. Enter a number such as 1 or 2 in the Receipt # text box and click Open
 

Home Copyright © 2004-2012, FunctionX