protected void Button1_Click(object sender, EventArgs e)
        {
            AppointmentManagementSystem app = new AppointmentManagementSystem();
            int result = app.bookAppointment();

            Label1.Text = result.ToString();

            Appointment a = app.GetAppointment();

            appointmentLabel.Text = a.appointmentID.ToString();
            accountLabel.Text     = a.accountID.ToString();
            facilityLabel.Text    = a.facilityID.ToString();
            departmentLabel.Text  = a.departmentID.ToString();
            timeLabel.Text        = a.time;
            dateLabel.Text        = a.date;
            takenLabel.Text       = a.taken.ToString();
        }
Exemple #2
0
        protected void YesButton_Click(object sender, EventArgs e)
        {
            //get account id
            string  nric = Session["nric"].ToString();
            Account a    = new Account();

            a = AccountManagementSystem.getAccountViaNRIC(nric);

            int accountID = 1;

            if (a != null)
            {
                accountID = a.accountID;
            }
            int time;

            if (AMPMDropDownList.SelectedValue.ToString() == "PM")
            {
                time = (Convert.ToInt32(HourDropDownList.SelectedValue)) * 10000 + Convert.ToInt32(MinDropDownList.SelectedValue) * 100;
            }
            else
            {
                time = Convert.ToInt32(HourDropDownList.SelectedValue) * 10000 + Convert.ToInt32(MinDropDownList.SelectedValue) * 100;
            }

            //insert values into database and redirect to patientappointment page
            Appointment ap = new Appointment();

            ap.accountID    = accountID;
            ap.facilityID   = Convert.ToInt32(HospitalDropDownList.SelectedValue);
            ap.departmentID = Convert.ToInt32(DepartmentDropDownList.SelectedValue);
            ap.time         = time.ToString();
            ap.date         = DateTextBox.Text; //this was lblActualDate.Text. is this intentional?
            ap.comments     = "Referral - " + CommentTextBox.Text.ToString();
            int result = AppointmentManagementSystem.bookAppointment(ap);

            string id = Session["id"].ToString();

            result = AppointmentManagementSystem.deleteAppointment(id);

            if (result == 1)
            {
                Response.Write("<script type=\"text/javascript\">alert('Appointment Added!');location.href='DoctorAppointmentPage.aspx'</script>");
            }
        }