private void bntAddnew_Click(object sender, RoutedEventArgs e) { _cusAddOrUpdate = new CustomerAddOrUpdateDialog(_unitofwork, null); _cusAddOrUpdate.ShowDialog(); allcus = _unitofwork.CustomerRepository.Get(x => x.Deleted.Equals(0)).ToList(); lvDataCustomer.ItemsSource = allcus; lvDataCustomer.UnselectAll(); lvDataCustomer.Items.Refresh(); }
private void bntUpdate_Click(object sender, RoutedEventArgs e) { if (lvDataCustomer.SelectedItem == null) { MessageBox.Show("Custoer must be selected to update! Choose again!"); return; } _cusAddOrUpdate = new CustomerAddOrUpdateDialog(_unitofwork, ctm); _cusAddOrUpdate.ShowDialog(); lvDataCustomer.UnselectAll(); lvDataCustomer.Items.Refresh(); }