private void buttonStartTicket_Click(object sender, RoutedEventArgs e) { char? middleInitial; string firstName, lastName; ParseName(textBoxCustomerName.Text, out firstName, out middleInitial, out lastName); if (SelectedCustomer == null) { PhoneNumber phoneNumber = PhoneNumber.Add(phoneNumberEditControl.Text, null); Person person = Person.Add(firstName, middleInitial, lastName, textBoxStreetAddress.Text, textBoxStreetAddress2.Text, GetZipCode(), phoneNumber.Id, 0, 0, 0, 0, 0, null); SelectedCustomer = Customer.Add(person.Id, null); } else { Person person = Person.Get(SelectedCustomer.PersonId); person.SetAddressLine1(textBoxStreetAddress.Text); person.SetAddressLine2(textBoxStreetAddress2.Text); person.SetFirstName(firstName); person.SetLastName(lastName); person.SetMiddleInitial(middleInitial); person.SetZipCodeId(GetZipCode()); person.Update(); } if (ActiveTicket != null) { ActiveTicket.SetCustomerId(SelectedCustomer.Id); ActiveTicket.Update(); } // Closes the dialog window, so the carryout ticket can be created Window.GetWindow(this).Close(); }
/// <summary> /// Add a new entry to the PhoneNumber table /// </summary> public static PhoneNumber Add(string phoneNumber, string description) { PhoneNumber newPhoneNumber = PhoneNumber.Add(phoneNumber, description); PhoneNumbers.Add(newPhoneNumber.Id, newPhoneNumber); return(newPhoneNumber); }
public void AddPhoneNumber(string phoneNumber) { PhoneNumber.Add(phoneNumber); }