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();
        }
Пример #2
0
        /// <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);
        }
Пример #3
0
 public void AddPhoneNumber(string phoneNumber)
 {
     PhoneNumber.Add(phoneNumber);
 }