private void BeginRebindCustomer() { Globals.IsBusy = true; int?siteId = null; if (ucSitePicker.SiteId > 0) { siteId = ucSitePicker.SiteId; } DataServiceHelper.ListCustomerAsync(Globals.UserLogin.UserOrganisationId, null, txtFirstName.Text.Trim(), txtLastName.Text.Trim(), siteId, chkHasContract.IsChecked == true, uiDateFrom.SelectedDate, uiDateTo.SelectedDate, chkShowInactive.IsChecked == true, ListCustomerCompleted); }
private void CustomerButton_Click(object sender, RoutedEventArgs e) { HyperlinkButton button = sender as HyperlinkButton; bool isNewCustomer = false; if (button != null) { if (button.Tag == null) { isNewCustomer = true; } else { int customerId = Convert.ToInt32(button.Tag); if (customerId > 0) { ucCustomerDetails.BoookingId = null; DataServiceHelper.ListCustomerAsync(Globals.UserLogin.UserOrganisationId, customerId, null, null, null, false, null, null, true, ListCustomerCompleted); } else { isNewCustomer = true; } } } if (isNewCustomer) { Booking booking = button.DataContext as Booking; if (booking != null) { Customer newCustomer = new Customer(); newCustomer.IsChanged = true; newCustomer.OrganisationId = Globals.UserLogin.UserOrganisationId; newCustomer.ContactInformation = new ContactInformation(); newCustomer.ContactInformation.IsChanged = true; newCustomer.ContactInformation.ContactTypeId = (int)ContactType.Customer; ucCustomerDetails.BoookingId = booking.BookingId; ucCustomerDetails.DataContext = newCustomer; ucCustomerDetails.ucCntactInfoPanel.DataContext = newCustomer.ContactInformation; ucCustomerDetails.ucCntactInfoPanel.btnSaveContact.Visibility = Visibility.Collapsed; uiPopupCustomer.ShowDialog(); } } }
void ucSitePicker_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e) { //RebindBookingPaymentData(); DataServiceHelper.ListCustomerAsync(Globals.UserLogin.UserOrganisationId, null, null, null, ucSitePicker.SiteId, true, null, null, false, ListCustomerCompleted); }