private void btnInsert_Click(object sender, EventArgs e) { string polyclinicName = cbxPoliclinic.Text; string doctorName = cbxDoctor.Text; if (cbxPoliclinic.SelectedIndex != -1 && cbxDoctor.SelectedIndex != -1 && cbxAction.SelectedIndex != -1 && txtPrice.Text != "") { Polyclinic policlinic = PolyclinicManager.Get(polyclinicName); Doctor doctor = DoctorManager.Get(doctorName); PatientManager.AddAction(patient, policlinic, doctor, nupOrder.Value, cbxAction.Text, nupQuantity.Value, txtPrice.Text); MessageBox.Show("Action successfully added!", "Success!", MessageBoxButtons.OK, MessageBoxIcon.Information); refreshActions(); } }