private void searchButton_Click(object sender, EventArgs e) { TextBox nameTB = (TextBox)Controls.Find("nameTB", true)[0]; TextBox surnameTB = (TextBox)Controls.Find("surnameTB", true)[0]; TextBox patronymicTB = (TextBox)Controls.Find("patronymicTB", true)[0]; result = ClinicalHospital.GetCardsByPIB(Program.clinicalHospital.medicalCards, nameTB.Text, surnameTB.Text, patronymicTB.Text); DateTimePicker dateTimePicker1 = (DateTimePicker)Controls.Find("dateTimePicker1", true)[0]; CheckBox checkBox1 = (CheckBox)Controls.Find("checkBox1", true)[0]; if (checkBox1.Checked) { result = ClinicalHospital.GetCardsByDate(result, dateTimePicker1.Value, checkBox1.Checked); } ComboBox extractedCB = (ComboBox)Controls.Find("extractedCB", true)[0]; if (!extractedCB.SelectedItem.Equals("")) { if (extractedCB.SelectedItem.Equals("Виписані")) { result = ClinicalHospital.GetCardsExtracted(result); } if (extractedCB.SelectedItem.Equals("Не виписані")) { result = ClinicalHospital.GetCardsNotExtracted(result); } } CheckBox checkBoxAge = (CheckBox)Controls.Find("checkBoxAge", true)[0]; NumericUpDown ageFrom = (NumericUpDown)Controls.Find("ageFrom", true)[0]; NumericUpDown ageTo = (NumericUpDown)Controls.Find("ageTo", true)[0]; if (checkBoxAge.Checked) { result = ClinicalHospital.GetCardsByAge(result, (int)ageFrom.Value, (int)ageTo.Value, checkBoxAge.Checked); } CardsList cardsList = (CardsList)Controls.Find("cardsList1", true)[0]; cardsList.UpdateControl(result); }
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("Пацієнт вже виписаний"); } }
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("Пацієнт не переведений! Спробуйте ще раз"); } }