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