Example #1
0
        private void butFormulary_Click(object sender, EventArgs e)
        {
            FormFormularies FormF = new FormFormularies();

            FormF.IsSelectionMode = true;
            FormF.ShowDialog();
            Cursor = Cursors.WaitCursor;
            if (FormF.DialogResult != DialogResult.OK)
            {
                Cursor = Cursors.Default;
                return;
            }
            List <FormularyMed> ListMeds = FormularyMeds.GetMedsForFormulary(FormF.SelectedFormularyNum);
            bool medIsInFormulary        = false;

            for (int i = 0; i < ListMeds.Count; i++)
            {
                if (ListMeds[i].MedicationNum == MedicationPatCur.MedicationNum)
                {
                    medIsInFormulary = true;
                }
            }
            Cursor = Cursors.Default;
            if (medIsInFormulary)
            {
                MsgBox.Show(this, "This medication is in the selected formulary.");
            }
            else
            {
                MsgBox.Show(this, "This medication is not in the selected forumulary.");
            }
        }
Example #2
0
        private void FillGrid()
        {
            Cursor   = Cursors.WaitCursor;
            ListMeds = FormularyMeds.GetMedsForFormulary(FormularyCur.FormularyNum);
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col = new ODGridColumn("Name", 150);

            gridMain.Columns.Add(col);
            //col=new ODGridColumn("Notes",250);
            //gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            ODGridRow  row;
            Medication medication;

            for (int i = 0; i < ListMeds.Count; i++)
            {
                medication = Medications.GetMedication(ListMeds[i].MedicationNum);
                row        = new ODGridRow();
                row.Cells.Add(medication.MedName.ToString());
                //row.Cells.Add(Medications.GetMedication(medication.GenericNum).Notes.ToString());
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
            Cursor = Cursors.Default;
        }