private void btnSave_Click(object sender, System.EventArgs e)
 {
     if (IsValidData())
     {
         // TODO: Add code that creates a new retail customer
         RetailCustomer retailCustomer = new RetailCustomer(
             txtFirstName.Text, txtLastName.Text, txtEmail.Text, txtHomePhone.Text);
         customer = retailCustomer;
         this.Close();
     }
 }
Esempio n. 2
0
 private static RetailCustomer ReadRetail(XmlReader xmlIn)
 {
     RetailCustomer customer = new RetailCustomer();
     customer.FirstName =
         xmlIn.ReadElementContentAsString();
     customer.LastName =
         xmlIn.ReadElementContentAsString();
     customer.Email =
         xmlIn.ReadElementContentAsString();
     customer.HomePhone =
         xmlIn.ReadElementContentAsString();
     return customer;
 }
Esempio n. 3
0
        private static RetailCustomer ReadRetail(XmlReader xmlIn)
        {
            RetailCustomer customer = new RetailCustomer();

            customer.FirstName =
                xmlIn.ReadElementContentAsString();
            customer.LastName =
                xmlIn.ReadElementContentAsString();
            customer.Email =
                xmlIn.ReadElementContentAsString();
            customer.HomePhone =
                xmlIn.ReadElementContentAsString();
            return(customer);
        }
Esempio n. 4
0
 private static void WriteRetail(RetailCustomer customer,
                                 XmlWriter xmlOut)
 {
     xmlOut.WriteStartElement("Customer");
     xmlOut.WriteElementString("Type", "Retail");
     xmlOut.WriteElementString("FirstName",
                               customer.FirstName);
     xmlOut.WriteElementString("LastName",
                               customer.LastName);
     xmlOut.WriteElementString("Email",
                               customer.Email);
     xmlOut.WriteElementString("HomePhone",
                               customer.HomePhone);
     xmlOut.WriteEndElement();
 }
Esempio n. 5
0
 private static void WriteRetail(RetailCustomer customer,
     XmlWriter xmlOut)
 {
     xmlOut.WriteStartElement("Customer");
     xmlOut.WriteElementString("Type", "Retail");
     xmlOut.WriteElementString("FirstName",
         customer.FirstName);
     xmlOut.WriteElementString("LastName",
         customer.LastName);
     xmlOut.WriteElementString("Email",
         customer.Email);
     xmlOut.WriteElementString("HomePhone",
         customer.HomePhone);
     xmlOut.WriteEndElement();
 }