Esempio n. 1
0
    protected void btnSaveAppointment_Click(object sender, EventArgs e)
    {
        string patientId = ddlPatient.SelectedItem.Value.ToString();
        string doctorId  = (string)Session["user_id"];
        string date      = txtDate.Text;
        string time      = txtTime.Text;
        string dateTime  = date + " " + time;
        bool   success   = DBUtils.AttemptSaveAppointment(patientId, doctorId, dateTime);

        if (success)
        {
            Response.Redirect("~/Home/GeneralPractitionerHomePage.aspx");
        }
        else
        {
            lblInfo.Text      = MSG_ERROR_SAVING_APPOINTMENT;
            lblInfo.ForeColor = System.Drawing.Color.DarkRed;
        }
    }
Esempio n. 2
0
    private void AttemptMakeAppointment()
    {
        string patientId = ddlPatient.SelectedValue.ToString();
        string doctorId  = ddlDoctor.SelectedValue.ToString();
        string date      = ddlDate.SelectedValue.ToString();
        string time      = ddlTime.SelectedValue.ToString();
        string dateTime  = date + " " + time;
        bool   success   = DBUtils.AttemptSaveAppointment(patientId, doctorId, dateTime);

        if (success)
        {
            lblInfo.Text      = "Success";
            lblInfo.ForeColor = System.Drawing.Color.ForestGreen;
        }
        else
        {
            lblInfo.Text      = MSG_ERROR_MAKING_APPOINTMENT;
            lblInfo.ForeColor = System.Drawing.Color.DarkRed;
        }
    }