/// <summary> /// Deletes the highlighted estate /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnDelete_Click(object sender, EventArgs e) { int indexToDelete = listBox1.SelectedIndex; Estate estate = estateManager.GetAt(indexToDelete); estateManager.DeleteAt(indexToDelete); dictionaryHandler.Delete(estate); }
/// <summary> /// button to delete a selected object in the viewlist, also gets deleted in the list in listmanager. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnDelete_Click(object sender, EventArgs e) { estateManager.DeleteAt(lvProperties.SelectedIndices[0]); fillList(); btnDelete.Enabled = false; btnChange.Enabled = false; test(); }
public bool DeleteEstate(Estate estate) { int index = SearchEstateById(estate.EstateId); if (index < 0) { return(false); } return(_estateManager.DeleteAt(index)); }
private void DeleteBtn_Click(object sender, EventArgs e) { try { if (listBox1.SelectedItems.Count == 1) { Em.DeleteAt(listBox1.SelectedIndex); Update(); } else { MessageBox.Show("Please select only one item!"); } } catch (Exception exc) { throw exc; } }
private void DeleteBtn_Click(object sender, EventArgs e) { estateManager.DeleteAt(objectsLView.SelectedIndices[0]); ClearFields(); ShowAllObjectsInListBox(); }
public void DeleteEstate(int id) { estates.DeleteAt(GetPosition(id)); }