Beispiel #1
0
        public void UpdateList()
        {
            List <TradePointCustomer> entList = TradePointCustomersController.GetInstance().GetTradesPointCustomers();

            entList.Sort((x, y) => x.Name.CompareTo(y.Name));
            collection = new ObservableCollection <TradePointCustomer>(entList);

            CustomersList.ItemsSource = collection;
            CustomersList.Items.Refresh();
            CustomersList.UpdateLayout();
        }
        private void ApplyChangesBy(TradePointCustomer tradePointCustomer)
        {
            tradePointCustomer.Name        = textBoxes[0].Text;
            tradePointCustomer.Description = textBoxes[1].Text;

            if (tradePointCustomer.Id < 0)
            {
                TradePointCustomersController.GetInstance().AddTradePointCustomer(tradePointCustomer);
            }
            else
            {
                TradePointCustomersController.GetInstance().EditTradePointCustomer(tradePointCustomer);
            }
        }
Beispiel #3
0
 private void DeleteButton_Click(object sender, RoutedEventArgs e)
 {
     TradePointCustomersController.GetInstance().DeleteTradePointCustomer(GetTradePointCustomerByButton(sender as Button));
     UpdateList();
 }