protected void btnDelete_Click(object sender, EventArgs e)
    {
        if (Session["TherapistId"] == null)
        {
            UserAlert.Text      = "Select a Therapist";
            UserAlert.ForeColor = System.Drawing.Color.Red;
            return;
        }
        else if ((Session["TherapistId"] != null) && (Session["DeleteTherapist"] == null))
        {
            UserAlert.Text             = "Click Delete again to confirm.";
            UserAlert.ForeColor        = System.Drawing.Color.Red;
            Session["DeleteTherapist"] = "1";
        }
        else
        {
            TherapistTableManager therapistTableManager = new TherapistTableManager();

            if (therapistTableManager.DeleteTherapist(new MassageTherapists(Session["TherapistId"].ToString())))
            {
                TherapistList1.Refresh();
                Session["DeleteTherapist"] = null;
                UserAlert.Text             = "";
            }
            else
            {
                UserAlert.Text = "This therapist is assocated with previous appointments.";
            }
        }
    }
    protected void btnSaveEditTherapist_Click(object sender, EventArgs e)
    {
        TherapistTableManager therapistTableManager = new TherapistTableManager();

        DatabaseObjects.MassageTherapists therapist = null;

        if (Session[CommonDefinitions.CommonDefinitions.THERAPIST_ID] == null)
        {
            therapist = new DatabaseObjects.MassageTherapists(Guid.Empty);
        }
        else
        {
            therapist = new DatabaseObjects.MassageTherapists(Guid.Parse(Session[CommonDefinitions.CommonDefinitions.THERAPIST_ID].ToString()));
        }

        therapist.Name     = txtBoxTherapistName.Text;
        therapist.Password = txtBoxTherapistPassword.Text;

        therapistTableManager.UpdateTherapist(therapist);

        Session[CommonDefinitions.CommonDefinitions.THERAPIST_ID] = null;

        if (TherapistUpdated != null)
        {
            TherapistUpdated(this, e);
        }
    }
    public void FindTherapist(MassageTherapists person)
    {
        TherapistTableManager therapistTableManager = new TherapistTableManager();
        MassageTherapists     therapist             = null;

        MyTherapistEncryption.SecurityController dataEncryption = new SecurityController();

        therapist = therapistTableManager.FindTherapist(person);

        if (therapist != null)
        {
            txtBoxTherapistName.Text     = therapist.Name;
            txtBoxTherapistPassword.Text = therapist.Name;
        }

        if (TherapistFound != null)
        {
            TherapistFound(this, null);
        }
    }
Esempio n. 4
0
    protected void btnPatientCare_Click(object sender, EventArgs e)
    {
        DateTime result = DateTime.MinValue;
        TherapistTableManager therapistTableManager = new TherapistTableManager();

        if (txtBoxUserName.Text.Equals("MyTherapist"))
        {
            MassageTherapists therapist     = new MassageTherapists(txtBoxUserName.Text, txtBoxPassword.Text);
            MassageTherapists massagePerson = therapistTableManager.FindTherapist(therapist);

            if (massagePerson != null)
            {
                Response.Redirect("~/UserManagement/Therapists.aspx");
            }
            else
            {
                lblInformationText.Text      = "Invalid Logon";
                lblInformationText.ForeColor = System.Drawing.Color.Red;
            }
        }
        else
        {
            MassageTherapists therapist     = new MassageTherapists(txtBoxUserName.Text, txtBoxPassword.Text);
            MassageTherapists massagePerson = therapistTableManager.FindTherapist(therapist);

            if (massagePerson != null)
            {
                Session[CommonDefinitions.CommonDefinitions.THERAPIST_NAME] = massagePerson.Name;
                Session[txtBoxUserName.Text.ToUpper()] = massagePerson.Id;
                Response.Redirect("~/PatientCare/PatientCare.aspx");
            }
            else
            {
                lblInformationText.Text      = "Invalid Logon";
                lblInformationText.ForeColor = System.Drawing.Color.Red;
            }
        }
    }