private void ButtonDelete_Click(object sender, System.Windows.RoutedEventArgs e) { MessageBoxResult result = MessageBox.Show("Realmente deseas eliminar a este Proveedor?", "Confirmación", MessageBoxButton.YesNo, MessageBoxImage.Question); if (result == MessageBoxResult.Yes) { presenter.DeleteProduct(); } }
public void DeleteProduct_RemovesProductFromDb() { StoreTestProduct(); var productsTotal = TestDbContext.Instance.Products.Count(); Assert.AreEqual(1, productsTotal); _viewMock.ProductId = _testProduct.Id; _presenter.DeleteProduct(); productsTotal = TestDbContext.Instance.Products.Count(); Assert.AreEqual(0, productsTotal); }
override public void HandleDelete() { try { DialogResult result = MessageBox.Show("Bạn có chắc muốn xóa mặt hàng này không?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (result == System.Windows.Forms.DialogResult.Yes) { StringBuilder errMsg = _presenter.DeleteProduct(); if (errMsg.Length != 0) { ShowErrorMessageBox(errMsg.ToString()); } else { _presenter.ClearAll(); } } } catch (Exception exc) { AppLogger.logError(exc); } }