예제 #1
0
        private void upd_dr_button_Click(object sender, EventArgs e)
        {
            if (nameTextBox.Text == "" || usernameTextBox.Text == "" || passwordTextBox.Text == "" || ((!maleRadioButton.Checked) && (!femaleRadioButton.Checked)))
            {
                MessageBox.Show("Please, insert at least the doctor name, username, password, gender, age, department and salary.");
            }
            else
            {
                int r = controllerObj.A_UpdateDoctor(Convert.ToInt32(drsComboBox.SelectedValue),
                                                     nameTextBox.Text.ToString(),
                                                     usernameTextBox.Text.ToString(),
                                                     passwordTextBox.Text.ToString(),
                                                     maleRadioButton.Checked ? "M" : "F",
                                                     (int)ageNumericUpDown.Value,
                                                     mobileNumTextBox.Text.ToString(),
                                                     addressTextBox.Text.ToString(),
                                                     (int)depComboBox.SelectedValue,
                                                     "" + (int)shiftStartNumericUpDown.Value + " " + (string)AMPMcomboBox1.SelectedValue,
                                                     "" + (int)shiftEndNumericUpDown.Value + " " + (string)AMPMcomboBox2.SelectedValue,
                                                     (int)salaryNumericUpDown.Value);

                if (r > 0)
                {
                    MessageBox.Show("Doctor updated successfully.");
                    DataTable dt1 = controllerObj.SelectDoctorIDsNames();
                    drsComboBox.DataSource    = dt1;
                    drsComboBox.DisplayMember = "Name";
                    drsComboBox.ValueMember   = "DID";
                }
                else
                {
                    MessageBox.Show("Error in updating doctor.");
                }
            }
        }
예제 #2
0
        private void upd_info_button_Click(object sender, EventArgs e)
        {
            if (nameTextBox.Text == "" || usernameTextBox.Text == "" || passwordTextBox.Text == "" || ((!maleRadioButton.Checked) && (!femaleRadioButton.Checked)))
            {
                MessageBox.Show("Please, insert at least the name, username, password, gender and age.");
            }
            else
            {
                int r = controllerObj.A_UpdateDoctor((int)_did,
                                                     nameTextBox.Text.ToString(),
                                                     usernameTextBox.Text.ToString(),
                                                     passwordTextBox.Text.ToString(),
                                                     maleRadioButton.Checked ? "M" : "F",
                                                     (int)ageNumericUpDown.Value,
                                                     mobileNumTextBox.Text.ToString(),
                                                     addressTextBox.Text.ToString(),
                                                     -1,
                                                     "" + (int)shiftStartNumericUpDown.Value + " " + (string)AMPMcomboBox1.SelectedValue,
                                                     "" + (int)shiftEndNumericUpDown.Value + " " + (string)AMPMcomboBox2.SelectedValue,
                                                     -1);

                if (r > 0)
                {
                    MessageBox.Show("Information updated successfully.");
                }
                else
                {
                    MessageBox.Show("Error in updating information.");
                }
            }
        }