Exemple #1
0
        private void button_addFromDSP_Click(object sender, EventArgs e)
        {
            //DGV 0=BUTTON, 1=DRUG_ID, 2=DRUG_NAME, 3=DOSAGE, 4=UNIT
            PermissibleValueObjWithDelFlag subDrug = DSP.getSelectedSubDrug();
            DrugObj drug = DSP.getSelectedDrug();

            if (subDrug == null || subDrug.getValue().Split(new String[] { "||" }, StringSplitOptions.None)[1] == "0")
            {
                addDrugToDGV(drug);
            }
            else
            {
                addDrugToDGV(subDrug);
            }
        }
Exemple #2
0
        public void DSPselectedDrugChanged(DrugObj drug)
        {
            int selectedTabIdx = tabControl1.SelectedIndex;

            if (selectedTabIdx == 0)
            {
                selectedDrug    = drug;
                selectedSubDrug = null;
                textBox_addDrug_selectedDrugName.Text     = drug.getName();
                textBox_addDrug_selectedDrugName.ReadOnly = true;
            }
            else if (selectedTabIdx == 1)
            {
                selectedDrug    = drug;
                selectedSubDrug = null;
                textBox_amdDrug_drugName.ReadOnly         = false;
                textBox_amdDrug_subDrugName.ReadOnly      = true;
                textBox_amdDrug_minDoseVal.ReadOnly       = false;
                comboBox_amdDrug_minDoseUnit.Enabled      = true;
                textBox_amdDrug_maxDoseVal.ReadOnly       = false;
                comboBox_amdDrug_maxDoseUnit.Enabled      = true;
                comboBox_amdDrug_pri_type.Enabled         = true;
                comboBox_amdDrug_sec_type.Enabled         = true;
                groupBox_amdDrug4q5w.Enabled              = true;
                groupBox_amdDrug_contraindication.Enabled = true;
                textBox_amdDrug_drugName.Text             = drug.getName();
                textBox_amdDrug_subDrugName.Clear();
                textBox_amdDrug_minDoseVal.Text = drug.MinDoseVal.ToString();
                Utilities.SelectItemByValue(comboBox_amdDrug_minDoseUnit, drug.MinDoseUnit.ToString());
                textBox_amdDrug_maxDoseVal.Text = drug.MaxDoseVal.ToString();
                Utilities.SelectItemByValue(comboBox_amdDrug_maxDoseUnit, drug.MaxDoseUnit.ToString());
                Utilities.SelectItemByValue(comboBox_amdDrug_pri_type, drug.PriType.ToString());
                Utilities.SelectItemByValue(comboBox_amdDrug_sec_type, drug.SecType.ToString());
                checkBox_amdDrug_q1.Checked = drug.Q1;
                checkBox_amdDrug_q2.Checked = drug.Q2;
                checkBox_amdDrug_q3.Checked = drug.Q3;
                checkBox_amdDrug_q4.Checked = drug.Q4;
                checkBox_amdDrug_w1.Checked = drug.W1;
                checkBox_amdDrug_w2.Checked = drug.W2;
                checkBox_amdDrug_w3.Checked = drug.W3;
                checkBox_amdDrug_w4.Checked = drug.W4;
                checkBox_amdDrug_w5.Checked = drug.W5;
                checkBox_amdDrug_w6.Checked = drug.W6;
                Utilities.SelectItemByValue(comboBox_amdDrug_preg_contra, drug.PregContra.ToString());
                Utilities.SelectItemByValue(comboBox_amdDrug_g6pd_contra, drug.G6pdContra.ToString());
                checkBox_amdDrug_deleteItem.Checked = drug.Deleted;
            }
        }
Exemple #3
0
        public void DSPselectedSubDrugChanged(PermissibleValueObjWithDelFlag subDrug)
        {
            int selectedTabIdx = tabControl1.SelectedIndex;

            if (selectedTabIdx == 1)
            {
                selectedSubDrug = subDrug;
                textBox_amdDrug_subDrugName.Text = subDrug.getName();
                if (textBox_amdDrug_subDrugName.Text.Length > 0 && textBox_amdDrug_subDrugName.Text != "-")
                {
                    textBox_amdDrug_drugName.ReadOnly         = true;
                    textBox_amdDrug_subDrugName.ReadOnly      = false;
                    textBox_amdDrug_minDoseVal.ReadOnly       = true;
                    comboBox_amdDrug_minDoseUnit.Enabled      = false;
                    textBox_amdDrug_maxDoseVal.ReadOnly       = true;
                    comboBox_amdDrug_maxDoseUnit.Enabled      = false;
                    comboBox_amdDrug_pri_type.Enabled         = false;
                    comboBox_amdDrug_sec_type.Enabled         = false;
                    groupBox_amdDrug4q5w.Enabled              = false;
                    groupBox_amdDrug_contraindication.Enabled = false;
                }
                else
                {
                    textBox_amdDrug_drugName.ReadOnly         = false;
                    textBox_amdDrug_subDrugName.ReadOnly      = true;
                    textBox_amdDrug_minDoseVal.ReadOnly       = false;
                    comboBox_amdDrug_minDoseUnit.Enabled      = true;
                    textBox_amdDrug_maxDoseVal.ReadOnly       = false;
                    comboBox_amdDrug_maxDoseUnit.Enabled      = true;
                    comboBox_amdDrug_pri_type.Enabled         = true;
                    comboBox_amdDrug_sec_type.Enabled         = true;
                    groupBox_amdDrug4q5w.Enabled              = true;
                    groupBox_amdDrug_contraindication.Enabled = true;
                }
                if (selectedSubDrug != null && selectedSubDrug.getValue().Split(new String[] { "||" }, System.StringSplitOptions.None)[1].Equals("0"))
                {
                    checkBox_amdDrug_deleteItem.Checked = selectedDrug.Deleted;
                }
                else
                {
                    checkBox_amdDrug_deleteItem.Checked = subDrug.Deleted;
                }
            }
        }