/// <summary> /// Llama a método Delete de StockDAL y le pasa un id para eliminar un Stock en la base /// </summary> /// <param name="id">int</param> public void Delete(int id) { try { stockDAL.Delete(id); } catch (Exception ex) { throw ex; } }
private void btnDelete_Click(object sender, EventArgs e) { if (MessageBox.Show("Seçili olan veriyi silmek istediğinizden eminmisiniz?", "Uyarı", MessageBoxButtons.YesNo) == DialogResult.Yes) { //stock.Delete(context, c => c.StockCode == gridView1.GetFocusedRowCellValue(colStockCode).ToString()); string selected = gridView1.GetFocusedRowCellValue(colStockCode).ToString(); stock.Delete(context, c => c.StockCode == selected); stock.Save(context); GetAll(); } }