//-----------------------------------------------------------Delete Record----------------------------------------------------------------------------//
        private void deleteRecordBtn_Click(object sender, EventArgs e)
        {
            PatientHandler patientHandler = new PatientHandler();

            viewControlPanel.Hide();
            addRecordPanel.Hide();
            updateRecordPanel.Hide();
            deleteRecordPanel.Show();
            closeAllTextBox(fullNameDeleteTextBox, nricDeleteTextBox, emailDeleteTextBox, phoneDeleteTextBox, addressDeleteRichTextBox, ageDeleteTextBox, bedsideIdDeleteTextBox, choosePatientIDDeleteComboBox, genderDeleteComboBox);
            patientHandler.FetchId(choosePatientIDDeleteComboBox);
        }
        private void updatePatientButton_Click(object sender, EventArgs e)
        {
            DBConnector dbC = new DBConnector();

            dbC.connect();
            PatientHandler patientHandler = new PatientHandler();
            Patient        oldPatientData = new Patient();

            if (choosePatientIDUpdateComboBox.SelectedIndex == 0)
            {
                MessageBox.Show("Please select valid ID");
                return;
            }
            if (nricUpdateTextBox.Enabled == false)
            {
                MessageBox.Show("Please press 'Enter' to generate data first");
                return;
            }
            else
            {
                oldPatientData = patientHandler.getSpecificPatient(dbC.getConn(), int.Parse(choosePatientIDUpdateComboBox.SelectedItem.ToString()));
            }

            if ((oldPatientData.IdentityCard.ToString() != nricUpdateTextBox.Text) || (oldPatientData.FullName != fullNameUpdateTextBox.Text) || (oldPatientData.Email != emailUpdateTextBox.Text) || (oldPatientData.Gender != genderUpdatecomboBox.SelectedItem.ToString()) || (oldPatientData.Phone.ToString() != phoneUpdateTextBox.Text) || (oldPatientData.Address != addressUpdateTextBox.Text) || (oldPatientData.Age.ToString() != ageUpdateTextBox.Text) || (oldPatientData.BedsideId.ToString() != bedsideIdUpdateTextBox.Text))
            {
                Patient newPatientData = new Patient();
                newPatientData.Id           = int.Parse(choosePatientIDUpdateComboBox.SelectedItem.ToString());
                newPatientData.IdentityCard = long.Parse(nricUpdateTextBox.Text);
                newPatientData.FullName     = fullNameUpdateTextBox.Text;
                newPatientData.Email        = emailUpdateTextBox.Text;
                newPatientData.Gender       = genderUpdatecomboBox.SelectedItem.ToString();
                newPatientData.Phone        = int.Parse(phoneUpdateTextBox.Text);
                newPatientData.Address      = addressUpdateTextBox.Text;
                newPatientData.Age          = int.Parse(ageUpdateTextBox.Text);
                newPatientData.BedsideId    = int.Parse(bedsideIdUpdateTextBox.Text);

                int updateResult = patientHandler.updatePatientData(dbC.getConn(), newPatientData);

                if (updateResult == 1)
                {
                    MessageBox.Show("Update Successfully");
                    closeAllTextBox(fullNameUpdateTextBox, nricUpdateTextBox, emailUpdateTextBox, phoneTextBox, addressUpdateTextBox, ageUpdateTextBox, bedsideIdUpdateTextBox, choosePatientIDUpdateComboBox, genderUpdatecomboBox);
                    patientHandler.FetchId(choosePatientIDUpdateComboBox);
                }
                else
                {
                    MessageBox.Show("Update Failed");
                }
            }
            else
            {
                MessageBox.Show("Nothing is changes");
            }
        }
        private void deletePatientRecordBtn_Click(object sender, EventArgs e)
        {
            DBConnector dbC = new DBConnector();

            dbC.connect();
            PatientHandler patientHandler = new PatientHandler();
            Patient        oldPatientData = new Patient();

            if (choosePatientIDDeleteComboBox.SelectedIndex == 0)
            {
                MessageBox.Show("Please select valid ID");
                return;
            }
            if (string.IsNullOrEmpty(nricDeleteTextBox.Text))
            {
                MessageBox.Show("Please press 'Enter' to generate data first");
                return;
            }
            else
            {
                oldPatientData = patientHandler.getSpecificPatient(dbC.getConn(), int.Parse(choosePatientIDDeleteComboBox.SelectedItem.ToString()));
            }

            int deleteResult = patientHandler.deletePatientData(dbC.getConn(), oldPatientData.Id);

            if (deleteResult == 1)
            {
                MessageBox.Show("Delete Record Successfully");
                closeAllTextBox(fullNameDeleteTextBox, nricDeleteTextBox, emailDeleteTextBox, phoneDeleteTextBox, addressDeleteRichTextBox, ageDeleteTextBox, bedsideIdDeleteTextBox, choosePatientIDDeleteComboBox, genderDeleteComboBox);
                patientHandler.FetchId(choosePatientIDDeleteComboBox);
            }
            else
            {
                MessageBox.Show("Delete Failed");
            }
        }