예제 #1
0
 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
 }
예제 #2
0
 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
 }
예제 #3
0
 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;
 }
예제 #4
0
 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();
 }