private void btDeleteTelephone_Click(object sender, EventArgs e) { if (lvUserTelephone.SelectedItems.Count > 0) { var listViewItem = lvUserTelephone.SelectedItems[0]; DeleteUserData.DeleteTelephone(listViewItem.SubItems[3].Text.GetInt()); FillPhonesLv(); } else { MessageContainer.DisplayError("Select telephone to delete", "Error"); } }
// functionality to delete selected address private void btDeleteAddress_Click(object sender, EventArgs e) { if (lvUserAddress.SelectedItems.Count > 0) { var listViewItem = lvUserAddress.SelectedItems[0]; DeleteUserData.DeleteAddress(listViewItem.SubItems[3].Text.GetInt()); FillAddressLv(); } else { MessageContainer.DisplayError("Select address to delete", "Error"); } }