private void DeleteBtn_Click(object sender, EventArgs e) { try { if (lblID.Text != "") { if (MessageBox.Show("Are you sure you want to delete this product? \n This item will be deleted immediately,You can't undo this action!", "Winkel", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { sellerService.DeleteProduct(new Contracts.Request.Product.DeleteProductRequest(Id)); clear(); dataGridView.DataSource = sellerService.AllProductList(new Contracts.Request.Product.AllProductRequest(seller.SellerID)); ShowAutoClosingMessageBoxInfo("Delete successfull", "Successfull"); } } else { lblUyarı.Text = "Please, select a record!"; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }