public inlistNewPatient(Patients parent, int currentPatientId) { InitializeComponent(); parentForm = parent; currentPatientIndex = parentForm.parent.patientList.FindIndex(x => x.idNumber == currentPatientId); this.textBoxFName.Text = parentForm.parent.patientList[currentPatientIndex].firstName; this.textBoxLName.Text = parentForm.parent.patientList[currentPatientIndex].lastName; this.textBoxAge.Text = parentForm.parent.patientList[currentPatientIndex].age.ToString(); this.comboBoxGender.SelectedIndex = parentForm.parent.patientList[currentPatientIndex].sex == "male" ? 0 : 1; this.textBoxCountry.Text = parentForm.parent.patientList[currentPatientIndex].contacts.country; this.textBoxCity.Text = parentForm.parent.patientList[currentPatientIndex].contacts.city; this.textBoxStreet.Text = parentForm.parent.patientList[currentPatientIndex].contacts.street; this.textBoxHouseNum.Text = parentForm.parent.patientList[currentPatientIndex].contacts.houseNumber.ToString(); this.textBoxFlatNum.Text = parentForm.parent.patientList[currentPatientIndex].contacts.flatNumber.ToString(); this.textBoxPhoneNum.Text = parentForm.parent.patientList[currentPatientIndex].contacts.phoneNumber.ToString(); int illnessHistoryIndex = parentForm.parent.illnessHistoryList.FindIndex(x => x.patientID == currentPatientId); this.dateTimePicker1.Value = parentForm.parent.illnessHistoryList[illnessHistoryIndex].startingDate; this.textBoxDesease.Text = parentForm.parent.illnessHistoryList[illnessHistoryIndex].deseaseName; this.textBoxSymphtoms.Text = parentForm.parent.illnessHistoryList[illnessHistoryIndex].sympthoms; this.textBoxDrugList.Text = parentForm.parent.illnessHistoryList[illnessHistoryIndex].drugs; this.textBoxStatus.Text = parentForm.parent.illnessHistoryList[illnessHistoryIndex].curingStatus; this.dateTimePicker2.Value = parentForm.parent.illnessHistoryList[illnessHistoryIndex].approxEndingDate; }
private void toolStripMenuItem2_Click(object sender, EventArgs e) { if (this.MdiChildren.Length != 0) { foreach (Form child in this.MdiChildren) { child.Close(); } } patientsMenu = new Patients(this); patientsMenu.Show(); patientsMenu.Left = 0; patientsMenu.Top = 0; patientsMenu.Size = this.ClientRectangle.Size; patientsMenu.WindowState = FormWindowState.Maximized; }
public inlistNewPatient(Patients parent) { InitializeComponent(); parentForm = parent; currentPatientIndex = -1; }