예제 #1
0
        private void btnCheckAppID_Click(object sender, EventArgs e)
        {
            if (txtAppID.Text.Trim() == "")
            {
                MessageBox.Show("Please Enter Appointment ID !", "Confirmation",
                                MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtAppID.Focus();
                return;
            }

            if (Appointment.isExists(txtAppID.Text.Trim()) == "canceled")//Appointment already canceled
            {
                MessageBox.Show("Appointment already canceled !", "Confirmation",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
                txtAppID.Focus();
                return;
            }
            if (Appointment.isExists(txtAppID.Text.Trim()) == "non")// Appointment not found
            {
                MessageBox.Show("Appointment not found !!!\nPlease re-check your Appointment ID", "Confirmation",
                                MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtAppID.Focus();
                return;
            }

            Appointment aAppointment = new Appointment();

            aAppointment.getAppointmentDetails(txtAppID.Text.Trim());

            Centre aCentre = new Centre();

            aCentre.getCentreDetails(aAppointment.getCentreID());
            txtCounty.Text     = aCentre.getCounty();
            txtCentreName.Text = aCentre.getCentreName();

            dtpAppDate.Text = aAppointment.getAppDate();
            txtTime.Text    = aAppointment.getAppTime();
            txtRegNo.Text   = aAppointment.getRegNo();

            grbAppDetails.Visible = true;
            btnCheckAppID.Visible = false;
            btnNext.Focus();
            btnClear.Visible = true;
        }
        private void grdCentre_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            DataGridViewRow row = this.grdCentre.Rows[e.RowIndex];

            int    centre_id = Convert.ToInt32(row.Cells[0].Value);
            Centre aCentre   = new Centre();

            aCentre.getCentreDetails(Convert.ToInt32(grdCentre.Rows[grdCentre.CurrentCell.RowIndex].Cells[0].Value));

            txtCentreId.Text = aCentre.getCentreID().ToString();
            txtName.Text     = aCentre.getCentreName().ToString();
            txtAdd1.Text     = aCentre.getAdd1().ToString();
            txtAdd2.Text     = aCentre.getAdd2().ToString();
            txtTelNo.Text    = aCentre.getTelNo().ToString();
            txtEmail.Text    = aCentre.getEmail().ToString();
            txtCounty.Text   = aCentre.getCounty().ToString();

            grbCentreDetails.Visible = true;
            btnDeRegCentre.Visible   = true;
        }
예제 #3
0
        //Register + Centre details validation
        private void btnRegCentre_Click(object sender, EventArgs e)
        {
            if (txtName.Text.Trim() == "" || txtAdd1.Text.Trim() == "" || txtAdd2.Text.Trim() == "" || txtTelNo.Text.Trim() == "" || txtEmail.Text.Trim() == "" || cboCounty.Text == "")
            {
                MessageBox.Show("All fields must be filled !!!", "Confirmation",
                                MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (!Util.isNumeric(txtTelNo.Text.Trim()))
            {
                MessageBox.Show("Phone Number must be numeric only !\nPlease Re-enter", "Confirmation",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (!Util.isValidEmail(txtEmail.Text.Trim()))
            {
                MessageBox.Show("Email address you entered is invalid !\nPlease Re-enter", "Confirmation",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            else
            {
                //instantiate Centre Object
                char   status  = 'A';
                Centre aCentre = new Centre(Convert.ToInt32(txtCentreId.Text.Trim()), txtName.Text.ToUpper().Trim(), txtAdd1.Text.ToUpper().Trim(), txtAdd2.Text.ToUpper().Trim(), txtTelNo.Text.Trim(), txtEmail.Text.ToLower().Trim(), cboCounty.SelectedItem.ToString().ToUpper().Trim(), status);
                //call regCentre method
                aCentre.regCentre();

                //Display confirmation message
                MessageBox.Show("Test Centre is now registered" + "\nThank you !", "Confirmation",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);

                // Clear registration form
                clearForm();
            }
        }
예제 #4
0
 private void frmNewCentre_Load(object sender, EventArgs e)
 {
     loadCounties();
     cboCounty.DropDownStyle = ComboBoxStyle.DropDownList;
     txtCentreId.Text        = Centre.nextCentreID().ToString("0000");
 }