Ejemplo n.º 1
0
        private void extractBtn_Click(object sender, EventArgs e)
        {
            CardSearchingControl cardSearchingControl1 = (CardSearchingControl)Controls.Find("cardSearchingControl1", true)[0];
            CardsList            cardsList             = (CardsList)cardSearchingControl1.Controls.Find("cardsList1", true)[0];
            ListBox       listBox1 = (ListBox)cardsList.Controls.Find("listBox1", true)[0];
            NumericUpDown chamberN = (NumericUpDown)Controls.Find("chamberN", true)[0];

            MedicalCard medicalCard = (MedicalCard)listBox1.SelectedItem;

            if (medicalCard.extract == null)
            {
                registerExtractForm.UpdateForm(medicalCard);
                registerExtractForm.ShowDialog();
            }
            else
            {
                MessageBox.Show("Пацієнт вже виписаний");
            }
        }
Ejemplo n.º 2
0
        private void setChamberBtn_Click(object sender, EventArgs e)
        {
            CardSearchingControl cardSearchingControl1 = (CardSearchingControl)Controls.Find("cardSearchingControl1", true)[0];
            CardsList            cardsList             = (CardsList)cardSearchingControl1.Controls.Find("cardsList1", true)[0];
            ListBox       listBox1 = (ListBox)cardsList.Controls.Find("listBox1", true)[0];
            NumericUpDown chamberN = (NumericUpDown)Controls.Find("chamberN", true)[0];

            MedicalCard medicalCard = (MedicalCard)listBox1.SelectedItem;

            Chamber chamber_g = Program.clinicalHospital.GetChamber((int)chamberN.Value);
            Chamber chamber   = null;

            if (chamber_g != null)
            {
                chamber = new Chamber(chamber_g.number, chamber_g.numberTel, DateTime.Now);
                medicalCard.SetChamber(chamber);
                MessageBox.Show("Пацієнт був переведений");
            }
            else
            {
                MessageBox.Show("Пацієнт не переведений! Спробуйте ще раз");
            }
        }