예제 #1
0
 private void button_amdDrug_Click(object sender, EventArgs e)
 {
     if (input_validation_amdDrug())
     {
         String statusMsg = "";
         bool   isSuccess;
         if (selectedSubDrug == null || selectedSubDrug.getValue().Split(new String[] { "||" }, System.StringSplitOptions.None)[1].Equals("0"))
         {
             isSuccess = drugMgr.updateDrugRecord(selectedDrug.getValue(), textBox_amdDrug_drugName.Text.Trim(), decimal.Parse(textBox_amdDrug_minDoseVal.Text.Trim()), int.Parse(((PermissibleValueObj)(comboBox_amdDrug_minDoseUnit.SelectedItem)).getValue()), decimal.Parse(textBox_amdDrug_maxDoseVal.Text.Trim()), int.Parse(((PermissibleValueObj)(comboBox_amdDrug_maxDoseUnit.SelectedItem)).getValue()), int.Parse(((PermissibleValueObj)(comboBox_amdDrug_pri_type.SelectedItem)).getValue()), int.Parse(((PermissibleValueObj)(comboBox_amdDrug_sec_type.SelectedItem)).getValue()), checkBox_amdDrug_q1.Checked, checkBox_amdDrug_q2.Checked, checkBox_amdDrug_q3.Checked, checkBox_amdDrug_q4.Checked, checkBox_amdDrug_w1.Checked, checkBox_amdDrug_w2.Checked, checkBox_amdDrug_w3.Checked, checkBox_amdDrug_w4.Checked, checkBox_amdDrug_w5.Checked, checkBox_amdDrug_w6.Checked, int.Parse(((PermissibleValueObj)(comboBox_amdDrug_preg_contra.SelectedItem)).getValue()), int.Parse(((PermissibleValueObj)(comboBox_amdDrug_g6pd_contra.SelectedItem)).getValue()), checkBox_amdDrug_deleteItem.Checked, ref statusMsg);
             if (isSuccess)
             {
                 MessageBox.Show(statusMsg, "", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 tabPage2_Enter(sender, e);
             }
             else
             {
                 MessageBox.Show(statusMsg, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
         else if (selectedSubDrug.getValue().Split(new String[] { "||" }, System.StringSplitOptions.None)[1].Equals("0") == false)
         {
             isSuccess = drugMgr.updateSubDrugRecord(selectedSubDrug.getValue(), textBox_amdDrug_subDrugName.Text.Trim(), checkBox_amdDrug_deleteItem.Checked, ref statusMsg);
             if (isSuccess)
             {
                 MessageBox.Show(statusMsg, "", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 tabPage2_Enter(sender, e);
             }
             else
             {
                 MessageBox.Show(statusMsg, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
     }
 }
예제 #2
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);
            }
        }
예제 #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;
                }
            }
        }