public void LoadListCustomerTypeFromDB() { List <CustomerType> customerType = new List <CustomerType>(); customerType.Clear(); customerType.AddRange(CustomerType.GetCustomerType()); ListCustomerType.Clear(); foreach (var item in customerType) { ListCustomerType.Add(item); } }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { HotelManager.gui.RegulationUC.ListCustomerType.Clear(); List <CustomerType> customerTypes = new List <CustomerType>(); customerTypes.Clear(); customerTypes.AddRange(CustomerType.GetCustomerType()); foreach (var item in customerTypes) { HotelManager.gui.RegulationUC.ListCustomerType.Add(item); } CollectionViewSource.GetDefaultView(HotelManager.gui.RegulationUC.ListCustomerType).Refresh(); }
private void Window_Loaded(object sender, RoutedEventArgs e) { cbColumnCustomerType.ItemsSource = CustomerType.GetCustomerType(); cbColumnCustomerType.DisplayMemberPath = "Type"; cbColumnCustomerType.SelectedValuePath = "Type"; }