private void bntAdd_Click(object sender, RoutedEventArgs e) { _ingreAddOrUpdate = new IngredientAddOrUpdateDialog(_unitofwork, null); _ingreAddOrUpdate.ShowDialog(); lvIngredient.ItemsSource = _unitofwork.IngredientRepository.Get(x => x.Deleted.Equals(0)).ToList(); lvIngredient.UnselectAll(); lvIngredient.Items.Refresh(); }
private void bntEdit_Click(object sender, RoutedEventArgs e) { _ingre = lvIngredient.SelectedItem as Ingredient; if (lvIngredient.SelectedItem == null) { MessageBox.Show("Ingredient must be selected to update! Choose again!"); return; } _ingreAddOrUpdate = new IngredientAddOrUpdateDialog(_unitofwork, _ingre); _ingreAddOrUpdate.ShowDialog(); lvProduct.UnselectAll(); lvProduct.Items.Refresh(); lvDetails.UnselectAll(); lvDetails.Items.Refresh(); lvIngredient.UnselectAll(); lvIngredient.Items.Refresh(); }