public ActionResult AddNew(string doctor_ID, string doctor_name, string doctor_dept,
                                   string doctor_position, float salary, int age, string sex, int is_arranged)
        {
            DoctorService d   = new DoctorService();
            var           res = d.AddNewDoctor(doctor_ID, doctor_name, doctor_dept, doctor_position, salary, age, sex, is_arranged);

            return(Json(res));
        }
Ejemplo n.º 2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            var diplomaNumber = int.Parse(tbDiplomaNumber.Text);
            var name          = tbName.Text;
            var surname       = tbSurname.Text;
            var phone         = tbPhone.Text;
            var address       = tbAddress.Text;

            try {
                DoctorService.AddNewDoctor(diplomaNumber, name, surname, phone, address);

                MessageBox.Show(this, @"New doctor record created.", @"Success", MessageBoxButtons.OK, MessageBoxIcon.Information);

                DialogResult = DialogResult.OK;
            } catch (Exception exception) {
                MessageBox.Show(this, $@"Error occured while creating a new doctor record.\n{exception.Message}", @"Error",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }