コード例 #1
0
 private void butEditMissing_Click(object sender, EventArgs e)
 {
     if (listMissing.SelectedIndices.Count == 0)
     {
         MsgBox.Show(this, "Please select one or more items in the list first.");
         return;
     }
     if (listMissing.SelectedIndices.Count == 1)
     {
         FormCanadianExtract FormC = new FormCanadianExtract();
         FormC.Cur = MissingList[listMissing.SelectedIndices[0]];              //we really do want to edit the item is the list.
         FormC.ShowDialog();
         if (FormC.DialogResult != DialogResult.OK)
         {
             return;
         }
     }
     else             //multiple
     {
         FormCanadianExtract FormC = new FormCanadianExtract();
         FormC.Cur     = MissingList[listMissing.SelectedIndices[0]].Copy();
         FormC.IsMulti = true;
         FormC.ShowDialog();
         if (FormC.DialogResult != DialogResult.OK)
         {
             return;
         }
         for (int i = 0; i < listMissing.SelectedIndices.Count; i++)
         {
             MissingList[listMissing.SelectedIndices[i]].DateExtraction = FormC.Cur.DateExtraction;
         }
     }
     FillMissing();
 }
コード例 #2
0
        private void listMissing_DoubleClick(object sender, EventArgs e)
        {
            if (listMissing.SelectedIndices.Count == 0)
            {
                return;
            }
            FormCanadianExtract FormC = new FormCanadianExtract();

            FormC.Cur = MissingList[listMissing.SelectedIndices[0]];          //we really do want to edit the item is the list.
            FormC.ShowDialog();
            if (FormC.DialogResult != DialogResult.OK)
            {
                return;
            }
            FillMissing();
        }
コード例 #3
0
        private void butAddMissing_Click(object sender, EventArgs e)
        {
            FormCanadianExtract FormC = new FormCanadianExtract();

            FormC.Cur = new CanadianExtract();
            FormC.ShowDialog();
            if (FormC.DialogResult != DialogResult.OK)
            {
                return;
            }
            //make sure tooth number has not already been added
            for (int i = 0; i < MissingList.Count; i++)
            {
                if (MissingList[i].ToothNum == FormC.Cur.ToothNum)
                {
                    MsgBox.Show(this, "Tooth has already been added previously.");
                    return;
                }
            }
            MissingList.Add(FormC.Cur);
            FillMissing();
        }