private void btnSave_Click(object sender, System.EventArgs e) { if (IsValidData()) { // TODO: Add code that creates a new wholesale customer WholesaleCustomer wholesaleCustomer = new WholesaleCustomer( txtFirstName.Text, txtLastName.Text, txtEmail.Text, txtCompany.Text); customer = wholesaleCustomer; this.Close(); } }
private static WholesaleCustomer ReadWholesale(XmlReader xmlIn) { WholesaleCustomer customer = new WholesaleCustomer(); customer.FirstName = xmlIn.ReadElementContentAsString(); customer.LastName = xmlIn.ReadElementContentAsString(); customer.Email = xmlIn.ReadElementContentAsString(); customer.Company = xmlIn.ReadElementContentAsString(); return(customer); }
private static void WriteWholesale(WholesaleCustomer customer, XmlWriter xmlOut) { xmlOut.WriteStartElement("Customer"); xmlOut.WriteElementString("Type", "Wholesale"); xmlOut.WriteElementString("FirstName", customer.FirstName); xmlOut.WriteElementString("LastName", customer.LastName); xmlOut.WriteElementString("Email", customer.Email); xmlOut.WriteElementString("Company", customer.Company); xmlOut.WriteEndElement(); }
private static WholesaleCustomer ReadWholesale(XmlReader xmlIn) { WholesaleCustomer customer = new WholesaleCustomer(); customer.FirstName = xmlIn.ReadElementContentAsString(); customer.LastName = xmlIn.ReadElementContentAsString(); customer.Email = xmlIn.ReadElementContentAsString(); customer.Company = xmlIn.ReadElementContentAsString(); return customer; }