Exemplo n.º 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.");
            }
        }
Exemplo n.º 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;
        }
Exemplo n.º 3
0
 private void butDelete_Click(object sender, EventArgs e)
 {
     if (IsNew)
     {
         DialogResult = DialogResult.Cancel;
         return;
     }
     if (!MsgBox.Show(this, true, "Delete this formulary medication?"))
     {
         return;
     }
     FormularyMeds.Delete(FormularyMedCur.FormularyMedNum);
     DialogResult = DialogResult.OK;
 }
Exemplo n.º 4
0
        private void butAdd_Click(object sender, EventArgs e)
        {
            FormFormularyMedEdit FormFME = new FormFormularyMedEdit();

            FormFME.FormularyMedCur = new FormularyMed();
            FormFME.FormularyMedCur.FormularyNum = FormularyCur.FormularyNum;
            FormFME.IsNew = true;
            FormFME.ShowDialog();
            if (FormFME.DialogResult != DialogResult.OK)
            {
                return;
            }
            FormularyMeds.Insert(FormFME.FormularyMedCur);
            FillGrid();
        }
Exemplo n.º 5
0
        private void butAdd_Click(object sender, EventArgs e)
        {
            FormFormularyEdit FormF = new FormFormularyEdit();

            FormF.FormularyCur = new Formulary();
            Formularies.Insert(FormF.FormularyCur);
            FormF.IsNew = true;
            FormF.ShowDialog();
            if (FormF.DialogResult != DialogResult.OK)
            {
                FormularyMeds.DeleteMedsForFormulary(FormF.FormularyCur.FormularyNum);
                Formularies.Delete(FormF.FormularyCur.FormularyNum);
                return;
            }
            FillList();
        }