private void btnDelete_ItemClick(object sender, ItemClickEventArgs e) { try { if (LinesView.FocusedRowHandle >= 0) { TransactionLines l = lines.Get(long.Parse(LinesView.GetRowCellValue(LinesView.FocusedRowHandle, LinesView.Columns[0]).ToString())); lines.Delete(l); LinesView.DeleteRow(LinesView.FocusedRowHandle); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnDelete_ItemClick(object sender, ItemClickEventArgs e) { try { if (LinesView.RowCount > 0 && LinesView.FocusedRowHandle > 0) { BOMIngredientsProducts BOMIngr = ingred.Get( long.Parse(LinesView.GetRowCellValue(LinesView.FocusedRowHandle, LinesView.Columns[0]).ToString().Substring(3))); ingred.Delete(BOMIngr); LinesView.DeleteRow(LinesView.FocusedRowHandle); GetTotalCost(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }