public void RemoveMedicine()
        {
            String       text   = "Do You Want To Remove " + ListSelectedDoctor.Value + " ?";
            DialogResult answer = System.Windows.Forms.MessageBox.Show(text, "", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (answer == DialogResult.Yes)
            {
                ((ResidentPatient)Hospital.Patients[PatientID]).History.Remove(ListSelectedMedicine.Key);
                HospitalDB.DeleteMedicine(ListSelectedMedicine.Key);
                MedicalHistoryList.Remove(ListSelectedMedicine);
            }
        }
Exemplo n.º 2
0
 void Test()
 {
     MedicalHistoryList.Clear();
     for (int i = 0; i < 7; i++)
     {
         CSTreatment item = new CSTreatment();
         item.npcName     = "LongLongName" + i.ToString();
         item.diseaseName = "dis" + i.ToString();
         item.treatName   = "fangan" + i.ToString();
         MedicalHistoryList.Add(item);
     }
 }
        public void AddMedicine()
        {
            Medicine medicine = new Medicine();

            medicine.Name         = MedicineName;
            medicine.StartingDate = MedicineStartDate;
            medicine.EndingDate   = MedicineEndDate;
            ((ResidentPatient)Hospital.Patients[PatientID]).History.Add(medicine.ID, medicine);
            Medicine tempMedicine = ((ResidentPatient)Hospital.Patients[PatientID]).History[medicine.ID];

            MedicalHistoryList.Add(new ComboBoxPairs(medicine.ID, medicine.Name + " - Starting Date: " + medicine.StartingDate.ToShortDateString() + " | " + medicine.EndingDate.ToShortDateString()));
            HospitalDB.InsertMedicine(medicine, Hospital.Patients[PatientID]);
            Home.ViewModel.CloseRootDialog();
        }