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();
     }
 }
Example #2
0
        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);
        }
Example #3
0
 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();
 }
Example #4
0
 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;
 }
Example #5
0
 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();
 }