private void buttonAdd_Click(object sender, EventArgs e) { Methods.saveFormProperties(); dCategoria obj = new dCategoria(0, true); obj.ShowDialog(); Methods.updateListView(listView, columns, tables, conditions); }
private void buttonEdit_Click(object sender, EventArgs e) { if (listView.SelectedItems.Count == 1) { Methods.saveFormProperties(); dCategoria obj = new dCategoria(Convert.ToInt32(listView.SelectedItems[0].Text), true); obj.ShowDialog(); Methods.updateListView(listView, columns, tables, conditions); } else { MessageBox.Show("Tem de selecionar um item primeiro."); } }