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();
     }
 }
예제 #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);
        }
예제 #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();
 }
예제 #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;
 }
예제 #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();
 }