![]() |
Example Application: |
|
Introduction |
This example application is used to explore the fundamental techniques of saving values in XML. This application is used by a company that rents various
types of properties to customers. The properties include apartments, single
family homes, and townhouses. The customers are commonly referred to as tenants.
Windows Controls: |
|
(Name) | Text | TextAlign | Width |
colAccountNumber | Account # | 65 | |
colFullName | Full Name | 120 | |
colMaritalStatus | Marital Status | 85 | |
colPhoneNumber | Phone # | Center | 85 |
![]() |
||||||||||||||||
|
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.IO; using System.Xml; namespace SolasPropertyRental4c { public partial class Tenants : Form { public Tenants() { InitializeComponent(); } void ShowTenants() { string strFilename = @"C:\Solas Property Rental\tenants.xml"; XmlDocument docTenants = new XmlDocument(); if (File.Exists(strFilename)) { lvwTenants.Items.Clear(); docTenants.Load(strFilename); XmlElement elmTenant = docTenants.DocumentElement; XmlNodeList lstTenants = elmTenant.ChildNodes; foreach (XmlNode node in lstTenants) { ListViewItem lviTenant = new ListViewItem(node.FirstChild.InnerText); // Account Number lviTenant.SubItems.Add(node.FirstChild.NextSibling.InnerText); // Full Name lviTenant.SubItems.Add(node.FirstChild.NextSibling.NextSibling.InnerText); // Phone Number lviTenant.SubItems.Add(node.FirstChild.NextSibling.NextSibling.NextSibling.InnerText); // Marital Status lvwTenants.Items.Add(lviTenant); } } } private void Tenants_Load(object sender, EventArgs e) { ShowTenants(); } } } |
![]() |
||||||||||||||||||||||||||||||||||||||||||||||||
|
(Name) | Text | TextAlign | Width |
colPropertyCode | Prop Code | 65 | |
colPropertyType | Property Type | 85 | |
colBedrooms | Bedrooms | Right | 65 |
colBathrooms | Bathrooms | Right | 65 |
colMonthlyRent | Monthly Rent | Right | 75 |
colStatus | Status | 65 |
![]() |
||||||||||||||||
|
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.IO; using System.Xml; namespace SolasPropertyRental4c { public partial class RentalProperties : Form { public RentalProperties() { InitializeComponent(); } void ShowProperties() { XmlDocument docProperties = new XmlDocument(); string strFilename = @"C:\Solas Property Rental\properties.xml"; if (File.Exists(strFilename)) { lvwProperties.Items.Clear(); docProperties.Load(strFilename); XmlElement elmProperty = docProperties.DocumentElement; XmlNodeList lstProperties = elmProperty.ChildNodes; foreach (XmlNode node in lstProperties) { ListViewItem lviProperty = new ListViewItem(node.FirstChild.InnerText); // Property Code lviProperty.SubItems.Add(node.FirstChild.NextSibling.InnerText); // Property Type lviProperty.SubItems.Add(node.FirstChild.NextSibling.NextSibling.InnerText); // Bedrooms lviProperty.SubItems.Add(node.FirstChild.NextSibling.NextSibling.NextSibling.InnerText); // Bathrooms lviProperty.SubItems.Add(node.FirstChild.NextSibling.NextSibling.NextSibling.NextSibling.InnerText); // Monthly Rent lviProperty.SubItems.Add(node.FirstChild.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText); // Status lvwProperties.Items.Add(lviProperty); } } } private void RentalProperties_Load(object sender, EventArgs e) { ShowProperties(); } } } |
![]() |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
(Name) | Text | TextAlign | Width |
colPropertyCode | Prop Code | 65 | |
colPropertyType | Property Type | 85 | |
colBedrooms | Bedrooms | Right | 65 |
colBathrooms | Bathrooms | Right | 65 |
colMonthlyRent | Monthly Rent | Right | 75 |
colStatus | Status | 65 |
![]() |
||||||||||||||||
|
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.IO; using System.Xml; namespace SolasPropertyRental4a { public partial class RentalProperties : Form { public RentalProperties() { InitializeComponent(); } void ShowProperties() { XmlDocument docProperties = new XmlDocument(); string strFilename = @"C:\Solas Property Rental\properties.xml"; if (File.Exists(strFilename)) { lvwProperties.Items.Clear(); docProperties.Load(strFilename); XmlElement elmProperty = docProperties.DocumentElement; XmlNodeList lstProperties = elmProperty.ChildNodes; foreach (XmlNode node in lstProperties) { ListViewItem lviProperty = new ListViewItem(node.FirstChild.InnerText); // Property Code lviProperty.SubItems.Add(node.FirstChild.NextSibling.InnerText); // Property Type lviProperty.SubItems.Add(node.FirstChild.NextSibling.NextSibling.InnerText); // Bedrooms lviProperty.SubItems.Add(node.FirstChild.NextSibling.NextSibling.NextSibling.InnerText); // Bathrooms lviProperty.SubItems.Add(node.FirstChild.NextSibling.NextSibling.NextSibling.NextSibling.InnerText); // Monthly Rent lviProperty.SubItems.Add(node.FirstChild.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText); // Status lvwProperties.Items.Add(lviProperty); } } } private void Properties_Load(object sender, EventArgs e) { ShowProperties(); } } } |
![]() |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.IO; using System.Xml; namespace SolasPropertyRental4c { public partial class RentalAllocation : Form { public RentalAllocation() { InitializeComponent(); } private void txtTenantAcntNber_Leave(object sender, EventArgs e) { string strFilename = @"C:\Solas Property Rental\tenants.xml"; XmlDocument docTenants = new XmlDocument(); if (File.Exists(strFilename)) { docTenants.Load(strFilename); XmlElement elmTenant = docTenants.DocumentElement; XmlNodeList lstTenants = elmTenant.ChildNodes; bool TenantFound = false; for (int i = 0; i < lstTenants.Count; i++) { XmlNode node = lstTenants[i]; if (node.FirstChild.InnerText == txtTenantAcntNber.Text) { TenantFound = true; txtTenantName.Text = node.FirstChild.NextSibling.InnerText; txtMaritalStatus.Text = node.FirstChild.NextSibling.NextSibling.InnerText; } } if (TenantFound == false) { MessageBox.Show("There is no tenant with that account number"); txtTenantAcntNber.Text = ""; } } else MessageBox.Show("There is no list of tenants to check."); } } } |
private void txtPropertyCode_Leave(object sender, EventArgs e) { string strFilename = @"C:\Solas Property Rental\properties.xml"; XmlDocument docProperties = new XmlDocument(); if (File.Exists(strFilename)) { docProperties.Load(strFilename); XmlElement elmProperty = docProperties.DocumentElement; XmlNodeList lstProperties = elmProperty.ChildNodes; bool PropertyFound = false; for (int i = 0; i < lstProperties.Count; i++) { XmlNode node = lstProperties[i]; if (node.FirstChild.InnerText == txtPropertyCode.Text) { PropertyFound = true; txtPropertyType.Text = node.FirstChild.NextSibling.InnerText; txtMonthlyRent.Text = node.FirstChild.NextSibling.NextSibling.NextSibling.NextSibling.InnerText; } } if (PropertyFound == false) { MessageBox.Show("There is no Property with that code"); txtPropertyType.Text = ""; } } else MessageBox.Show("There is no list of properties to check."); } |
(Name) | Text | TextAlign | Width |
colAllocationCode | Alloc Code | 65 | |
colDateAllocated | Date Allocated | Center | 85 |
colTenantAccount | Tenant # | Center | 65 |
colTenantName | Tenant Name | 100 | |
colPropertyCode | Prop Code | Center | 65 |
colPropertyType | Prop Type | 75 | |
colContractLength | Contract Length | 88 | |
colRentStartDate | Rent Start Date | Center | 88 |
colMonthlyRent | Monthly Rent | Right | 76 |
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.IO; using System.Xml; namespace SolasPropertyRental4c { public partial class RentalAllocations : Form { public RentalAllocations() { InitializeComponent(); } void ShowRentalAllocations() { string strFilename = @"C:\Solas Property Rental\contracts.xml"; XmlDocument docAllocations = new XmlDocument(); if (File.Exists(strFilename)) { lvwAllocations.Items.Clear(); docAllocations.Load(strFilename); XmlElement elmAllocation = docAllocations.DocumentElement; XmlNodeList lstAllocations = elmAllocation.ChildNodes; foreach (XmlNode node in lstAllocations) { ListViewItem lviAllocation = new ListViewItem(node.FirstChild.InnerText); // Allocation Code lviAllocation.SubItems.Add(node.FirstChild.NextSibling.InnerText); // Date Allocated lviAllocation.SubItems.Add(node.FirstChild.NextSibling.NextSibling.InnerText); // Tenant Account Number lviAllocation.SubItems.Add(node.FirstChild.NextSibling.NextSibling.NextSibling.InnerText); // Tenant Name lviAllocation.SubItems.Add(node.FirstChild.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText); // Property Code lviAllocation.SubItems.Add(node.FirstChild.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText); // Property Type lviAllocation.SubItems.Add(node.FirstChild.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText); // Contract Length lviAllocation.SubItems.Add(node.FirstChild.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText); // Rent Start Date lviAllocation.SubItems.Add(node.FirstChild.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText); // Monthly Rent lvwAllocations.Items.Add(lviAllocation); } } } private void RentalAllocations_Load(object sender, EventArgs e) { ShowRentalAllocations(); } } } |
![]() |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.IO; using System.Xml; namespace SolasPropertyRental4c { public partial class RentPayment : Form { public RentPayment() { InitializeComponent(); } private void txtAllocationCode_Leave(object sender, EventArgs e) { string strFilename = @"C:\Solas Property Rental\contracts.xml"; XmlDocument docAllocations = new XmlDocument(); if (File.Exists(strFilename)) { docAllocations.Load(strFilename); XmlElement elmAllocation = docAllocations.DocumentElement; XmlNodeList lstAllocations = elmAllocation.ChildNodes; bool ContractFound = false; for (int i = 0; i < lstAllocations.Count; i++) { XmlNode node = lstAllocations[i]; if (node.FirstChild.InnerText == txtAllocationCode.Text) { ContractFound = true; txtTenantAcntNber.Text = node.FirstChild.NextSibling.NextSibling.InnerText; txtTenantName.Text = node.FirstChild.NextSibling.NextSibling.NextSibling.InnerText; txtPropertyCode.Text = node.FirstChild.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText; txtPropertyType.Text = node.FirstChild.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText; txtAmountReceived.Text = node.FirstChild.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText; } } if (ContractFound == false) { MessageBox.Show("There is no rental contral with that number"); txtTenantAcntNber.Text = ""; } } else MessageBox.Show("There is no list of rental contracts to check."); } } } |
(Name) | Text | TextAlign | Width |
colReceiptNumber | Receipt # | Right | |
colDateReceived | Date Received | Center | 85 |
colAllocationCode | Alloc Code | Center | 65 |
colTenantAccount | Tenant # | Center | 65 |
colTenantName | Tenant Name | 100 | |
colPropertyCode | Prop Code | Center | 65 |
colPropertyType | Prop Type | 75 | |
colPaymentFor | Payment For | 88 | |
colAmountReceived | Amount | Right | 50 |
![]() |
||||||||||||||||
|
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.IO; using System.Xml; namespace SolasPropertyRental4c { public partial class RentPayments : Form { public RentPayments() { InitializeComponent(); } void ShowRentPayments() { string strFilename = @"C:\Solas Property Rental\payments.xml"; XmlDocument docPayments = new XmlDocument(); if (File.Exists(strFilename)) { lvwRentPayments.Items.Clear(); docPayments.Load(strFilename); XmlElement elmAllocation = docPayments.DocumentElement; XmlNodeList lstAllocations = elmAllocation.ChildNodes; foreach (XmlNode node in lstAllocations) { ListViewItem lviPayment = new ListViewItem(node.FirstChild.InnerText); // Receipt Number lviPayment.SubItems.Add(node.FirstChild.NextSibling.InnerText); // Date Received lviPayment.SubItems.Add(node.FirstChild.NextSibling.NextSibling.InnerText); // Allocation Code lviPayment.SubItems.Add(node.FirstChild.NextSibling.NextSibling.NextSibling.InnerText); // Tenant Account Number lviPayment.SubItems.Add(node.FirstChild.NextSibling.NextSibling.NextSibling.NextSibling.InnerText); // Tenant Name lviPayment.SubItems.Add(node.FirstChild.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText); // Property Code lviPayment.SubItems.Add(node.FirstChild.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText); // Property Type lviPayment.SubItems.Add(node.FirstChild.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText); // Payment For lviPayment.SubItems.Add(node.FirstChild.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText); // Amount lvwRentPayments.Items.Add(lviPayment); } } } private void RentPayments_Load(object sender, EventArgs e) { ShowRentPayments(); } } } |
![]() |
|||||||||||||||
|
private void btnRentPayment_Click(object sender, EventArgs e) { RentPayments frmPayment = new RentPayments(); frmPayment.Show(); } |
private void btnRentalAllocations_Click(object sender, EventArgs e) { RentalAllocations frmAllocations = new RentalAllocations(); frmAllocations.ShowDialog(); } |
private void btnTenants_Click(object sender, EventArgs e) { Tenants frmTenants = new Tenants(); frmTenants.ShowDialog(); } |
private void btnRentalProperties_Click(object sender, EventArgs e) { RentalProperties frmProperties = new RentalProperties(); frmProperties.ShowDialog(); } |
private void btnClose_Click(object sender, EventArgs e) { Close(); } |
To assist with programmatically creating a new element, the XmlDocument class provides the CreateElement() method that is overloaded with three versions. One of the versions uses the following syntax: public XmlElement CreateElement(string name); Using this method, to create a new element, call it and pass it the name of the element.
Consider the following XML file named videos.xml: <?xml version="1.0" encoding="utf-8" ?> <videos> <title>The Distinguished Gentleman</title> </videos> If you want the element to have a value, the XmlDocument class provides the CreateTextNode() method. This method returns an XmlText value. The syntax of this method is: public virtual XmlText CreateTextNode(string text); This method takes as argument the string that would constitute the value of the element. Before calling it, you should have used the XmlNode.AppendChild() method to create a node. Calling this method on the LastChild node of the one that called the AppendChild() would specify the value of the new node. |
|
private void btnNewAllocation_Click(object sender, EventArgs e) { string AllocationCode, TenantAccountNumber, TenantName, MaritalStatus, PropertyCode, PropertyType, ContractLength; DateTime DateAllocated, RentStartDate; double MonthlyRent; RentalAllocation editor = new RentalAllocation(); Directory.CreateDirectory(@"C:\Solas Property Rental"); string strFilename = @"C:\Solas Property Rental\contracts.xml"; if (editor.ShowDialog() == DialogResult.OK) { XmlDocument docAllocation = new XmlDocument(); if (!File.Exists(strFilename)) { docAllocation.LoadXml("<?xml version=\"1.0\" encoding=\"utf-8\"?>" + "<Allocations></Allocations>"); docAllocation.Save(strFilename); } docAllocation.Load(strFilename); XmlElement nodRoot = docAllocation.DocumentElement; AllocationCode = editor.txtAllocationCode.Text; DateAllocated = editor.dtpDateAllocated.Value; TenantAccountNumber = editor.txtTenantAcntNber.Text; TenantName = editor.txtTenantName.Text; MaritalStatus = editor.txtMaritalStatus.Text; PropertyCode = editor.txtPropertyCode.Text; PropertyType = editor.txtPropertyType.Text; MonthlyRent = double.Parse(editor.txtMonthlyRent.Text); ContractLength = editor.cbxContractLengths.Text; RentStartDate = editor.dtpRentStartDate.Value; XmlElement elmRoot = docAllocation.DocumentElement; XmlElement elmAllocation = docAllocation.CreateElement("RentalAllocation"); elmRoot.AppendChild(elmAllocation); elmRoot = docAllocation.DocumentElement; elmAllocation = docAllocation.CreateElement("AllocationCode"); XmlText txtAllocation = docAllocation.CreateTextNode(AllocationCode); elmRoot.LastChild.AppendChild(elmAllocation); elmRoot.LastChild.LastChild.AppendChild(txtAllocation); elmAllocation = docAllocation.CreateElement("DateAllocated"); txtAllocation = docAllocation.CreateTextNode(DateAllocated.ToString("d")); elmRoot.LastChild.AppendChild(elmAllocation); elmRoot.LastChild.LastChild.AppendChild(txtAllocation); elmAllocation = docAllocation.CreateElement("TenantAccountNumber"); txtAllocation = docAllocation.CreateTextNode(TenantAccountNumber); elmRoot.LastChild.AppendChild(elmAllocation); elmRoot.LastChild.LastChild.AppendChild(txtAllocation); elmAllocation = docAllocation.CreateElement("TenantName"); txtAllocation = docAllocation.CreateTextNode(TenantName); elmRoot.LastChild.AppendChild(elmAllocation); elmRoot.LastChild.LastChild.AppendChild(txtAllocation); elmAllocation = docAllocation.CreateElement("MaritalStatus"); txtAllocation = docAllocation.CreateTextNode(MaritalStatus); elmRoot.LastChild.AppendChild(elmAllocation); elmRoot.LastChild.LastChild.AppendChild(txtAllocation); elmAllocation = docAllocation.CreateElement("PropertyCode"); txtAllocation = docAllocation.CreateTextNode(PropertyCode); elmRoot.LastChild.AppendChild(elmAllocation); elmRoot.LastChild.LastChild.AppendChild(txtAllocation); elmAllocation = docAllocation.CreateElement("PropertyType"); txtAllocation = docAllocation.CreateTextNode(PropertyType); elmRoot.LastChild.AppendChild(elmAllocation); elmRoot.LastChild.LastChild.AppendChild(txtAllocation); elmAllocation = docAllocation.CreateElement("ContractLength"); txtAllocation = docAllocation.CreateTextNode(ContractLength); elmRoot.LastChild.AppendChild(elmAllocation); elmRoot.LastChild.LastChild.AppendChild(txtAllocation); elmAllocation = docAllocation.CreateElement("RentStartDate"); txtAllocation = docAllocation.CreateTextNode(RentStartDate.ToString("d")); elmRoot.LastChild.AppendChild(elmAllocation); elmRoot.LastChild.LastChild.AppendChild(txtAllocation); elmAllocation = docAllocation.CreateElement("MonthlyRent"); txtAllocation = docAllocation.CreateTextNode(MonthlyRent.ToString("F")); elmRoot.LastChild.AppendChild(elmAllocation); elmRoot.LastChild.LastChild.AppendChild(txtAllocation); docAllocation.Save(strFilename); ShowRentalAllocations(); } } |
private void btnClose_Click(object sender, EventArgs e) { Close(); } |
private void btnNewPayment_Click(object sender, EventArgs e) { int ReceiptNumber; string AllocationCode, TenantAccountNumber, TenantName, PaymentFor, PropertyCode, PropertyType; DateTime DateReceived; double AmountReceived; RentPayment editor = new RentPayment(); XmlDocument docPayment = new XmlDocument(); Directory.CreateDirectory(@"C:\Solas Property Rental"); string strFilename = @"C:\Solas Property Rental\payments.xml"; // If some payments were previously made if (File.Exists(strFilename)) { // Open the payments.xml file docPayment.Load(strFilename); // Locate the root element XmlElement elmAllocation = docPayment.DocumentElement; // Get a list of the child nodes XmlNodeList lstAllocations = elmAllocation.ChildNodes; // Get the last receipt number ReceiptNumber = int.Parse(lstAllocations[lstAllocations.Count - 1].FirstChild.InnerText) + 1; editor.txtReceiptNumber.Text = ReceiptNumber.ToString(); } else { // If no payment has ever been made, // create a new XML file for the payments docPayment.LoadXml("<?xml version=\"1.0\" encoding=\"utf-8\"?>" + "<RentPayments></RentPayments>"); // We will start the receipt numbers at 101 ReceiptNumber = 101; editor.txtReceiptNumber.Text = ReceiptNumber.ToString(); } // Display the Rent Payment dialog box if (editor.ShowDialog() == DialogResult.OK) { // If the user had clicked OK, // Prepare the elements of the XML file ReceiptNumber = int.Parse(editor.txtReceiptNumber.Text); DateReceived = editor.dtpDateReceived.Value; AllocationCode = editor.txtAllocationCode.Text; TenantAccountNumber = editor.txtTenantAcntNber.Text; TenantName = editor.txtTenantName.Text; PropertyCode = editor.txtPropertyCode.Text; PropertyType = editor.txtPropertyType.Text; PaymentFor = editor.cbxMonths.Text + " " + editor.txtYear.Text; AmountReceived = double.Parse(editor.txtAmountReceived.Text); // Get a reference to the root element XmlElement elmRoot = docPayment.DocumentElement; // Create an element named Payment XmlElement elmPayment = docPayment.CreateElement("Payment"); // Add the new element as the last node of the root element elmRoot.AppendChild(elmPayment); // Get a reference to the root element elmRoot = docPayment.DocumentElement; // Create an element elmPayment = docPayment.CreateElement("ReceiptNumber"); // Create the value of the new element XmlText txtPayment = docPayment.CreateTextNode(ReceiptNumber.ToString()); // Add the new element as a child of the Payment element elmRoot.LastChild.AppendChild(elmPayment); // Specify the value of the new element elmRoot.LastChild.LastChild.AppendChild(txtPayment); // Follow the same logic for the other elements elmPayment = docPayment.CreateElement("DateReceived"); txtPayment = docPayment.CreateTextNode(DateReceived.ToString("d")); elmRoot.LastChild.AppendChild(elmPayment); elmRoot.LastChild.LastChild.AppendChild(txtPayment); elmPayment = docPayment.CreateElement("AllocationCode"); XmlText txtAllocation = docPayment.CreateTextNode(AllocationCode); elmRoot.LastChild.AppendChild(elmPayment); elmRoot.LastChild.LastChild.AppendChild(txtAllocation); elmPayment = docPayment.CreateElement("TenantAccountNumber"); txtAllocation = docPayment.CreateTextNode(TenantAccountNumber); elmRoot.LastChild.AppendChild(elmPayment); elmRoot.LastChild.LastChild.AppendChild(txtAllocation); elmPayment = docPayment.CreateElement("TenantName"); txtAllocation = docPayment.CreateTextNode(TenantName); elmRoot.LastChild.AppendChild(elmPayment); elmRoot.LastChild.LastChild.AppendChild(txtAllocation); elmPayment = docPayment.CreateElement("PropertyCode"); txtAllocation = docPayment.CreateTextNode(PropertyCode); elmRoot.LastChild.AppendChild(elmPayment); elmRoot.LastChild.LastChild.AppendChild(txtAllocation); elmPayment = docPayment.CreateElement("PropertyType"); txtAllocation = docPayment.CreateTextNode(PropertyType); elmRoot.LastChild.AppendChild(elmPayment); elmRoot.LastChild.LastChild.AppendChild(txtAllocation); elmPayment = docPayment.CreateElement("PaymentFor"); txtAllocation = docPayment.CreateTextNode(PaymentFor); elmRoot.LastChild.AppendChild(elmPayment); elmRoot.LastChild.LastChild.AppendChild(txtAllocation); elmPayment = docPayment.CreateElement("AmountReceived"); txtAllocation = docPayment.CreateTextNode(AmountReceived.ToString("F")); elmRoot.LastChild.AppendChild(elmPayment); elmRoot.LastChild.LastChild.AppendChild(txtAllocation); docPayment.Save(strFilename); ShowRentPayments(); } } |
private void btnClose_Click(object sender, EventArgs e) { Close(); } |
Allocation 1 | Allocation 2 | Allocation 3 | Allocation 4 | |
Allocation Code | 4205-8274 | 5920-9417 | 2792-4075 | 7957-7294 |
Date Allocated | 8/12/2002 | 2/18/2004 | 3/24/2004 | 10/26/2007 |
Account # | 24-68-84 | 57-97-15 | 19-38-84 | 20-48-46 |
Prop Code | 726-454 | 625-936 | 371-801 | 727-768 |
Contract Length | 12 Months | 3 Months | 12 Months | 6 Months |
Start Date | 10/1/2002 | 4/1/2004 | 6/1/2004 | 2/1/2008 |
![]() |
![]() |
Date Received | Allocation Code | Payment For | Amount | ||
Month | Year | ||||
Payment 1 | 10/25/2002 | 4205-8274 | October | 2002 | 1150.50 |
Payment 2 | 11/28/2002 | 4205-8274 | November | 2002 | 1150.50 |
Payment 3 | 4/28/2004 | 5920-9417 | April | 2004 | 1750.00 |
Payment 4 | 7/5/2004 | 2792-4075 | June | 2004 | 1250.25 |
Payment 5 | 6/3/2004 | 5920-9417 | May | 2004 | 1750.00 |
Payment 6 | 7/30/2004 | 2792-4075 | July | 2004 | 1250.25 |
Payment 7 | 7/5/2004 | 5920-9417 | June | 2004 | 1750.00 |
Payment 8 | 12/30/2002 | 4205-8274 | December | 2002 | 1150.50 |
![]() |
![]() |
|
|
||
Home | Copyright © 2007-2013, FunctionX | |
|