private void btn_delete_Click(object sender, EventArgs e) { if (lv_timeTable.SelectedIndices.Count == 0) { MessageBox.Show("Оберіть пару для видалення!"); return; } StudingTheSubject pair = _pairs[lv_timeTable.SelectedIndices[0]]; try { _proxy.DeletePair(pair); } catch (Exception ex) { MessageBox.Show(ex.Message, "Повідомлення", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } LoadPairs(); return; }