/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonSave_Click(object sender, System.EventArgs e) { if (this.IsValidData()) { this.customer = new Customer(textBoxFirstName.Text, textBoxLastName.Text, textBoxEmail.Text); this.Close(); } }
private static Customer Read(XmlReader xmlIn) { Customer customer = new Customer(); customer.FirstName = xmlIn.ReadElementContentAsString(); customer.LastName = xmlIn.ReadElementContentAsString(); customer.Email = xmlIn.ReadElementContentAsString(); return customer; }
private static void Write(Customer customer, XmlWriter xmlOut) { xmlOut.WriteStartElement("Customer"); xmlOut.WriteElementString("Type", ""); xmlOut.WriteElementString("FirstName", customer.FirstName); xmlOut.WriteElementString("LastName", customer.LastName); xmlOut.WriteElementString("Email", customer.Email); xmlOut.WriteEndElement(); }
public void Remove(Customer customer) { this.customers.Remove(customer); this.Changed(this); }
public void Add(Customer customer) { this.customers.Add(customer); this.Changed(this); }
/// <summary> /// /// </summary> public FormAddCustomer() { InitializeComponent(); this.customer = null; }