private void FillList() { Letters.Refresh(); listLetters.Items.Clear(); for (int i = 0; i < Letters.List.Length; i++) { listLetters.Items.Add(Letters.List[i].Description); } //no items are initially selected }
private void FillList() { Letters.RefreshCache(); _listLetters = Letters.GetDeepCopy(); listLetters.Items.Clear(); for (int i = 0; i < _listLetters.Count; i++) { listLetters.Items.Add(_listLetters[i].Description); } //no items are initially selected }
private void butOK_Click(object sender, System.EventArgs e) { LetterCur.Description = textDescription.Text; LetterCur.BodyText = textBody.Text; if (IsNew) { Letters.Insert(LetterCur); } else { Letters.Update(LetterCur); } DialogResult = DialogResult.OK; }
private void butDelete_Click(object sender, System.EventArgs e) { if (listLetters.SelectedIndex == -1) { MessageBox.Show(Lan.g(this, "Please select an item first.")); return; } if (MessageBox.Show(Lan.g(this, "Delete letter permanently for all patients?"), "", MessageBoxButtons.OKCancel) != DialogResult.OK) { return; } Letters.Delete(Letters.List[listLetters.SelectedIndex]); FillList(); }