public void LoadExistingData() { DataSet theDSExistingForm = new DataSet(); theDSExistingForm = PwPManager.GetPwPFormData(Convert.ToInt32(Session["PatientId"]), Convert.ToInt32(Session["PatientVisitId"])); if (theDSExistingForm.Tables[0].Rows.Count > 0) { radbtnSexualActiveness.SelectedValue = theDSExistingForm.Tables[0].Rows[0]["SexuallyActiveLast6Months"].ToString(); rcbSexualOrientation.SelectedValue = theDSExistingForm.Tables[0].Rows[0]["SexualOrientation"].ToString(); radbtnDisclosedstatusToSexualPartner.SelectedValue = theDSExistingForm.Tables[0].Rows[0]["DisclosedStatusToSexualPartner"].ToString(); rcbPartnerHIVStatus.SelectedValue = theDSExistingForm.Tables[0].Rows[0]["HIVstatusOfsexualPartner"].ToString(); radbtnGivenPWPMessages.SelectedValue = theDSExistingForm.Tables[0].Rows[0]["PwPMessagesGiven"].ToString(); radbtnSaferSexImportanceExplained.SelectedValue = theDSExistingForm.Tables[0].Rows[0]["ImpOfSafeSexExplained"].ToString(); radbtnLMP.SelectedValue = theDSExistingForm.Tables[0].Rows[0]["LMPAssessed"].ToString(); DDLReasonLMP.SelectedValue = theDSExistingForm.Tables[0].Rows[0]["ReasonLMPNotAssessed"].ToString(); radbtnPDTDone.SelectedValue = theDSExistingForm.Tables[0].Rows[0]["PregnancyTestDone"].ToString(); rblClientPregnant.SelectedValue = theDSExistingForm.Tables[0].Rows[0]["clientPregnant"].ToString(); radbtnPMTCTOffered.SelectedValue = theDSExistingForm.Tables[0].Rows[0]["referredToPMTCT"].ToString(); radbtnIntentionOfPregnancy.SelectedValue = theDSExistingForm.Tables[0].Rows[0]["IntendToBePregnantBeforeNextVisit"].ToString(); radbtnDiscussedFertilityOptions.SelectedValue = theDSExistingForm.Tables[0].Rows[0]["DiscussedFertilityOptions"].ToString(); radbtnDiscussedDualContraception.SelectedValue = theDSExistingForm.Tables[0].Rows[0]["discussedDualContraception"].ToString(); radbtnCondomsIssued.SelectedValue = theDSExistingForm.Tables[0].Rows[0]["condomsIssued"].ToString(); txtCondomNotIssued.Text = theDSExistingForm.Tables[0].Rows[0]["ReasonCondomNoIssued"].ToString(); radbtnSTIScreened.SelectedValue = theDSExistingForm.Tables[0].Rows[0]["ScreenedForSTI"].ToString(); txtSTITreatmentPlan.Text = theDSExistingForm.Tables[0].Rows[0]["STITreatment"].ToString(); txtOtherSTITreatment.Text = theDSExistingForm.Tables[0].Rows[0]["OtherSTITreatment"].ToString(); radbtnOnFP.SelectedValue = theDSExistingForm.Tables[0].Rows[0]["OnFPMethod"].ToString(); rcbFPMethod.SelectedValue = theDSExistingForm.Tables[0].Rows[0]["SpecifyFPMethod"].ToString(); ddlReferredFP.SelectedValue = theDSExistingForm.Tables[0].Rows[0]["referredForFP"].ToString(); radbtnCervicalCancerScreened.SelectedValue = theDSExistingForm.Tables[0].Rows[0]["screenedForCervicalCancer"].ToString(); rcbCervicalCancerScreeningResults.SelectedValue = theDSExistingForm.Tables[0].Rows[0]["CacervixScreeningResults"].ToString(); radbtnReferredForCervicalCancerScreening.SelectedValue = theDSExistingForm.Tables[0].Rows[0]["referredForCaScreening"].ToString(); radbtnHPVOffered.SelectedValue = theDSExistingForm.Tables[0].Rows[0]["HPVOffered"].ToString(); rcbOfferedHPVVaccine.SelectedValue = theDSExistingForm.Tables[0].Rows[0]["HPVVaccineOffered"].ToString(); rblWardAdmission.SelectedValue = theDSExistingForm.Tables[0].Rows[0]["WardAdmission"].ToString(); txtReferToSpecialistClinic.Text = theDSExistingForm.Tables[0].Rows[0]["specifySpecialistClinic"].ToString(); txtSpecifyOtherRefferedTo.Text = theDSExistingForm.Tables[0].Rows[0]["specifyOtherReferredTo"].ToString(); txtOtherCounselling.Text = theDSExistingForm.Tables[0].Rows[0]["OtherCounselling"].ToString(); if (theDSExistingForm.Tables[0].Rows[0]["TCA"].ToString() == "1") { this.UserControlKNH_NextAppointment1.rdoTCAYes.Checked = true; //TCA = "1"; } else if (theDSExistingForm.Tables[0].Rows[0]["TCA"].ToString() == "0") { this.UserControlKNH_NextAppointment1.rdoTCANo.Checked = true; //TCA = "0"; } else { this.UserControlKNH_NextAppointment1.rdoTCAYes.Checked = false; this.UserControlKNH_NextAppointment1.rdoTCANo.Checked = false; } //if (((DateTime)theDSExistingForm.Tables[0].Rows[0]["LMPDate"]).ToString("dd-MMM-yyyy") != "01-Jan-1900") //{ // txtLMPDate.Value = ((DateTime)theDSExistingForm.Tables[0].Rows[0]["LMPDate"]).ToString("dd-MMM-yyyy"); //} //else //{ // txtLMPDate.Value = ""; //} txtLMPDate.Value = String.Format("{0:dd-MMM-yyyy}", theDSExistingForm.Tables[0].Rows[0]["LMPDate"]); //if (((DateTime)theDSExistingForm.Tables[0].Rows[0]["EDD"]).ToString("dd-MMM-yyyy") != "01-Jan-1900") //{ // txtEDD.Text = ((DateTime)theDSExistingForm.Tables[0].Rows[0]["EDD"]).ToString("dd-MMM-yyyy"); //} //else //{ // txtEDD.Text = ""; //} txtEDD.Text = String.Format("{0:dd-MMM-yyyy}", theDSExistingForm.Tables[0].Rows[0]["EDD"]); //if (((DateTime)theDSExistingForm.Tables[0].Rows[0]["HPVVaccinedate"]).ToString("dd-MMM-yyyy") != "01-Jan-1900") //{ // dtHPVDoseDate.Value = ((DateTime)theDSExistingForm.Tables[0].Rows[0]["HPVVaccinedate"]).ToString("dd-MMM-yyyy"); //} //else //{ // dtHPVDoseDate.Value = ""; //} dtHPVDoseDate.Value = String.Format("{0:dd-MMM-yyyy}", theDSExistingForm.Tables[0].Rows[0]["HPVVaccinedate"]); //chkUrethralDischarge.SelectedValue = theDSExistingForm.Tables[0].Rows[0]["UrethralDischarge"].ToString(); //chkVaginalDischarge.SelectedValue = theDSExistingForm.Tables[0].Rows[0]["VaginalDischarge"].ToString(); //chkGenitalUlceration.SelectedValue = theDSExistingForm.Tables[0].Rows[0]["GenitalUlceration"].ToString(); if (theDSExistingForm.Tables[0].Rows[0]["UrethralDischarge"].ToString() == "1") { chkUrethralDischarge.Checked = true; //UrethraDischarge = "1"; } else { chkUrethralDischarge.Checked = false; //UrethraDischarge = "0"; } if (theDSExistingForm.Tables[0].Rows[0]["VaginalDischarge"].ToString() == "1") { chkVaginalDischarge.Checked = true; //VaginalDischarge = "1"; } else { chkVaginalDischarge.Checked = false; //VaginalDischarge = "0"; } if (theDSExistingForm.Tables[0].Rows[0]["GenitalUlceration"].ToString() == "1") { chkGenitalUlceration.Checked = true; //genitalUlceration = "1"; } else { chkGenitalUlceration.Checked = false; //genitalUlceration = "0"; } string script = string.Empty; if (theDSExistingForm.Tables[1].Rows.Count > 0) { for (int i = 0; i < theDSExistingForm.Tables[1].Rows.Count; i++) { ListItem currentCheckBox = cblHighRisk.Items.FindByValue(theDSExistingForm.Tables[1].Rows[i]["ValueID"].ToString()); if (currentCheckBox != null) { currentCheckBox.Selected = true; } } } if (theDSExistingForm.Tables[2].Rows.Count > 0) { for (int i = 0; i < theDSExistingForm.Tables[2].Rows.Count; i++) { ListItem currentCheckBox = cblTransitionPreparation.Items.FindByValue(theDSExistingForm.Tables[2].Rows[i]["ValueID"].ToString()); if (currentCheckBox != null) { currentCheckBox.Selected = true; } } } if (theDSExistingForm.Tables[3].Rows.Count > 0) { for (int i = 0; i < theDSExistingForm.Tables[3].Rows.Count; i++) { ListItem currentCheckBox = cblReferredTo.Items.FindByValue(theDSExistingForm.Tables[3].Rows[i]["ValueID"].ToString()); if (currentCheckBox != null) { currentCheckBox.Selected = true; if (currentCheckBox.Text.ToLower() == "other specialist clinic") { ScriptManager.RegisterStartupScript(this, this.GetType(), "ReferToSpecialistClinic", "ShowHide('divReferToSpecialistClinic','show');", true); } else if (currentCheckBox.Text.ToLower() == "other (specify)") { ScriptManager.RegisterStartupScript(this, this.GetType(), "ReferToOther", "ShowHide('divReferToOther','show');", true); } } } } if (theDSExistingForm.Tables[4].Rows.Count > 0) { for (int i = 0; i < theDSExistingForm.Tables[4].Rows.Count; i++) { ListItem currentCheckBox = cblCounselling.Items.FindByValue(theDSExistingForm.Tables[4].Rows[i]["ValueID"].ToString()); if (currentCheckBox != null) { currentCheckBox.Selected = true; } } } } }