Example #1
0
        private void CustomersGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            CustomerWraper selectedCustomer = (CustomerWraper)CustomersDataGrid.SelectedItem;

            if (selectedCustomer != null)
            {
                textBoxFirstname.Text = selectedCustomer.FirstName;
                textBoxSurname.Text   = selectedCustomer.Surname;
                textBoxTelephone.Text = selectedCustomer.Telephone;
                textBoxEmail.Text     = selectedCustomer.Email;
            }
        }
Example #2
0
        private void buttonUpdate_Click(object sender, RoutedEventArgs e)
        {
            CustomerWraper customer = (CustomerWraper)CustomersDataGrid.SelectedItem;

            customer.FirstName = textBoxFirstname.Text;
            customer.Surname   = textBoxSurname.Text;
            customer.Telephone = textBoxTelephone.Text;
            customer.Email     = textBoxEmail.Text;

            CustomerServiceClient client = new CustomerServiceClient();
            String sessionId             = (String)App.Current.Properties[App.sessionPropertyName];

            client.Save(sessionId, customer);
        }
Example #3
0
        private void buttonAdd_Click(object sender, RoutedEventArgs e)
        {
            CustomerWraper customer = new CustomerWraper();

            customer.FirstName = textBoxFirstname.Text;
            customer.Surname   = textBoxSurname.Text;
            customer.Telephone = textBoxTelephone.Text;
            customer.Email     = textBoxEmail.Text;

            CustomerServiceClient client  = new CustomerServiceClient();
            String sessionId              = (String)App.Current.Properties[App.sessionPropertyName];
            int    savedCustomersQuantity = client.Save(sessionId, customer);

            if (savedCustomersQuantity == 1)
            {
                CustomersDataGrid.ItemsSource = client.FindAll(sessionId);
            }
        }
Example #4
0
 public CustomerComboBoxWraper(CustomerWraper customer)
 {
     this.customer = customer;
 }