protected void btnYes_Click(object sender, EventArgs e)
        {
            Account a = new Account();

            a = (Account)Session["Account"];

            int accountID = 2;

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

            string id = lbl_id.Text;

            int result = AppointmentManagementSystem.pickAppointment(id, accountID);

            if (result == 1)
            {
                Response.Write("<script type=\"text/javascript\">alert('Appointment Added!');location.href='DoctorAppointmentPage.aspx'</script>");
            }
            else
            {
                Response.Write("<script type=\"text/javascript\">alert('Appointment Not Added!');location.href='DoctorAppointmentPage.aspx'</script>");
            }
        }
Exemple #2
0
        protected void btnYes_Click(object sender, EventArgs e)
        {
            string id = lbl_id.Text;

            int result = AppointmentManagementSystem.deleteAppointment(id);


            if (result == 1)
            {
                Response.Write("<script type=\"text/javascript\">alert('Appointment Cancelled!');location.href='PatientAppointmentPage.aspx'</script>");
            }
            else
            {
                Response.Write("<script type=\"text/javascript\">alert('Appointment Not Cancelled!');location.href='PatientAppointmentPage.aspx'</script>");
            }
        }
        private void bindAppointments()
        {
            Account a = new Account();

            a = (Account)Session["Account"];

            int accountID = 2;

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

            grdPickAppointment.DataSource = AppointmentManagementSystem.getRequestPool(accountID, lblActualFrom.Text, lblActualTo.Text);
            grdPickAppointment.DataBind();
        }
        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 #5
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>");
            }
        }
Exemple #6
0
        private void bindAppointments(int c)
        {
            Account a = new Account();

            a = (Account)Session["Account"];

            int accountID = 1;

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

            if (c == 1)
            {
                grdAppointmentHistory.DataSource = AppointmentManagementSystem.getAppointmentHistory(accountID);
                grdAppointmentHistory.DataBind();
            }
            else
            {
                grdUpcomingAppointment.DataSource = AppointmentManagementSystem.getUpcomingAppointments(accountID);
                grdUpcomingAppointment.DataBind();
            }
        }