public hireDoctor(Doctors parent, int currentDoctorId) { InitializeComponent(); parentForm = parent; currentDoctorIndex = parentForm.parent.doctorList.FindIndex(x => x.idNumber == currentDoctorId); this.textBoxFName.Text = parentForm.parent.doctorList[currentDoctorIndex].firstName; this.textBoxLName.Text = parentForm.parent.doctorList[currentDoctorIndex].lastName; this.textBoxAge.Text = parentForm.parent.doctorList[currentDoctorIndex].age.ToString(); this.comboBoxGender.SelectedIndex = parentForm.parent.doctorList[currentDoctorIndex].sex == "male" ? 0 : 1; this.textBoxCountry.Text = parentForm.parent.doctorList[currentDoctorIndex].contacts.country; this.textBoxCity.Text = parentForm.parent.doctorList[currentDoctorIndex].contacts.city; this.textBoxStreet.Text = parentForm.parent.doctorList[currentDoctorIndex].contacts.street; this.textBoxHouseNum.Text = parentForm.parent.doctorList[currentDoctorIndex].contacts.houseNumber.ToString(); this.textBoxFlatNum.Text = parentForm.parent.doctorList[currentDoctorIndex].contacts.flatNumber.ToString(); this.textBoxPhoneNum.Text = parentForm.parent.doctorList[currentDoctorIndex].contacts.phoneNumber.ToString(); }
private void button1_Click(object sender, EventArgs e) { if (this.MdiChildren.Length != 0) { foreach (Form child in this.MdiChildren) { child.Close(); } } doctorsMenu = new Doctors(this); doctorsMenu.Show(); doctorsMenu.Left = 0; doctorsMenu.Top = 0; doctorsMenu.Size = this.ClientRectangle.Size; doctorsMenu.WindowState = FormWindowState.Maximized; }
public hireDoctor(Doctors parent) { InitializeComponent(); parentForm = parent; currentDoctorIndex = -1; }