protected void btnsave_Click(object sender, EventArgs e) { if (fieldValidation()) { Hashtable theHT = HT(0); DataTable theDT = new DataTable(); if ((DataTable)ViewState["GridData"] == null) { theDT.Columns.Add("ptn_pk", typeof(Int32)); theDT.Columns.Add("VisitId", typeof(Int32)); theDT.Columns.Add("PurposeId", typeof(Int32)); theDT.Columns.Add("Purpose", typeof(string)); theDT.Columns.Add("Regimen", typeof(string)); theDT.Columns.Add("RegLastUsed", typeof(string)); } else { theDT = (DataTable)ViewState["GridData"]; } IPriorArtHivCare ARTHistoryMgr = (IPriorArtHivCare)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPriorArtHivCare, BusinessProcess.Clinical"); DataTable DT = ARTHistoryMgr.Save_Update_GreenCardForm(theHT, theDT); if (Convert.ToInt32(DT.Rows[0]["Visit_Id"]) > 0) { SaveCancel(); } } }
protected void GetGreenCardData() { DataSet theDSARTHistory = new DataSet(); IPriorArtHivCare ARTHistoryMgr = (IPriorArtHivCare)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPriorArtHivCare, BusinessProcess.Clinical"); theDSARTHistory = ARTHistoryMgr.GetGreenCardData(Convert.ToInt32(Session["PatientId"]), Convert.ToInt32(Session["PatientVisitId"]), Convert.ToInt32(Session["AppLocationId"])); if (Convert.ToInt32(Session["PatientVisitId"]) > 0) { txtVisitDate.Text = String.Format("{0:dd-MMM-yyyy}", theDSARTHistory.Tables[0].Rows[0]["VisitDate"]); txtTransferInDate.Text = String.Format("{0:dd-MMM-yyyy}", theDSARTHistory.Tables[0].Rows[0]["TransferInDate"]); ddlvisittype.SelectedValue = Convert.ToString(theDSARTHistory.Tables[0].Rows[0]["VisitTypeId"]); ddltransferfrom.SelectedValue = Convert.ToString(theDSARTHistory.Tables[0].Rows[0]["TransferInFrom"]); dddistrict.SelectedValue = Convert.ToString(theDSARTHistory.Tables[0].Rows[0]["TransferInDistrictId"]); ddfacility.SelectedValue = Convert.ToString(theDSARTHistory.Tables[0].Rows[0]["TransferInFacilityId"]); txtMFLCode.Text = theDSARTHistory.Tables[0].Rows[0]["TransferMFLCode"].ToString(); ddlCountryFrom.SelectedValue = Convert.ToString(theDSARTHistory.Tables[0].Rows[0]["TransferInCountryId"]); ddlbaseWHO.SelectedValue = Convert.ToString(theDSARTHistory.Tables[0].Rows[0]["BaseWHOStage"]); txtDateARTStarted.Text = String.Format("{0:dd-MMM-yyyy}", theDSARTHistory.Tables[0].Rows[0]["ARTStartDate"]); txtbaseCD4.Text = theDSARTHistory.Tables[0].Rows[0]["BaseCD4"].ToString(); if (Convert.ToInt32(theDSARTHistory.Tables[0].Rows[0]["BaseHepB"]) == 1) { rdoHepByes.Checked = true; } else if (Convert.ToInt32(theDSARTHistory.Tables[0].Rows[0]["BaseHepB"]) == 0) { rdoHepBNo.Checked = true; } if (Convert.ToInt32(theDSARTHistory.Tables[0].Rows[0]["BasePregnancy"]) == 1) { rdobasePrgencyYes.Checked = true; } else if (Convert.ToInt32(theDSARTHistory.Tables[0].Rows[0]["BasePregnancy"]) == 0) { rdobasePrgencyNo.Checked = true; } if (Convert.ToInt32(theDSARTHistory.Tables[0].Rows[0]["BaseBreastFeeding"]) == 1) { rdobasebrestFeedYes.Checked = true; } else if (Convert.ToInt32(theDSARTHistory.Tables[0].Rows[0]["BaseBreastFeeding"]) == 0) { rdobasebrestFeedNo.Checked = true; } if (Convert.ToInt32(theDSARTHistory.Tables[0].Rows[0]["BaseTBHIV"]) == 1) { rdobaseTBYes.Checked = true; } else if (Convert.ToInt32(theDSARTHistory.Tables[0].Rows[0]["BaseTBHIV"]) == 0) { rdobaseTBNo.Checked = true; } if (Convert.ToInt32(theDSARTHistory.Tables[0].Rows[0]["BaseDiscordant"]) == 1) { rdoDiscordantYes.Checked = true; } else if (Convert.ToInt32(theDSARTHistory.Tables[0].Rows[0]["BaseDiscordant"]) == 0) { rdoDiscordantNo.Checked = true; } if (Convert.ToInt32(theDSARTHistory.Tables[0].Rows[0]["PartnerDisclosure"]) == 1) { rdodiclosureyes.Checked = true; } else if (Convert.ToInt32(theDSARTHistory.Tables[0].Rows[0]["PartnerDisclosure"]) == 0) { rdodiclosureno.Checked = true; } if (Convert.ToInt32(theDSARTHistory.Tables[0].Rows[0]["INHCompletion"]) == 1) { Inhcompyes.Checked = true; } else if (Convert.ToInt32(theDSARTHistory.Tables[0].Rows[0]["INHCompletion"]) == 0) { InhcompNo.Checked = true; } txtbaseweight.Text = theDSARTHistory.Tables[0].Rows[0]["BaseWeight"].ToString(); txtbaseheight.Text = theDSARTHistory.Tables[0].Rows[0]["BaseHeight"].ToString(); txtbaseMUAC.Text = theDSARTHistory.Tables[0].Rows[0]["BaseMUAC"].ToString(); txtFirstARTRegimen.Text = theDSARTHistory.Tables[0].Rows[0]["ARTRegimen"].ToString(); txtBaseViral.Text = theDSARTHistory.Tables[0].Rows[0]["BaseViralLoad"].ToString(); txtbaseviraldate.Text = String.Format("{0:dd-MMM-yyyy}", theDSARTHistory.Tables[0].Rows[0]["BaseViralLoadDate"]); txttransferdate.Text = String.Format("{0:dd-MMM-yyyy}", theDSARTHistory.Tables[0].Rows[0]["TransferOutDate"]); //theHT.Add("BCG", txtDiphtheria.Text); txtMeasles.Text = theDSARTHistory.Tables[0].Rows[0]["Measles"].ToString(); txtIPV.Text = theDSARTHistory.Tables[0].Rows[0]["IPV"].ToString(); txtPenta.Text = theDSARTHistory.Tables[0].Rows[0]["Penta"].ToString(); txtPCV.Text = theDSARTHistory.Tables[0].Rows[0]["PCV"].ToString(); txtBCG.Text = theDSARTHistory.Tables[0].Rows[0]["BCG"].ToString(); txtHBV.Text = theDSARTHistory.Tables[0].Rows[0]["HBV"].ToString(); txtFlu.Text = theDSARTHistory.Tables[0].Rows[0]["Flu"].ToString(); txtHepatitis.Text = theDSARTHistory.Tables[0].Rows[0]["HepatitisB"].ToString(); txtTetanus.Text = theDSARTHistory.Tables[0].Rows[0]["Tetanus"].ToString(); txtPertussis.Text = theDSARTHistory.Tables[0].Rows[0]["Pertussis"].ToString(); txtHaemophilus.Text = theDSARTHistory.Tables[0].Rows[0]["Haemophilus"].ToString(); txtdeathdate.Text = String.Format("{0:dd-MMM-yyyy}", theDSARTHistory.Tables[0].Rows[0]["DeathDate"]); txtsexDisDate.Text = String.Format("{0:dd-MMM-yyyy}", theDSARTHistory.Tables[0].Rows[0]["PartnerDisclosureDate"]); partDisDate.Text = String.Format("{0:dd-MMM-yyyy}", theDSARTHistory.Tables[0].Rows[0]["AdolPartialDisclosureDate"]); txtFullDisDate.Text = String.Format("{0:dd-MMM-yyyy}", theDSARTHistory.Tables[0].Rows[0]["AdolFullDisclosureDate"]); txtINHStartDate.Text = String.Format("{0:dd-MMM-yyyy}", theDSARTHistory.Tables[0].Rows[0]["INHStartDate"]); txtINHCompDate.Text = String.Format("{0:dd-MMM-yyyy}", theDSARTHistory.Tables[0].Rows[0]["INHCompletionDate"]); GrdPriorART.Columns.Clear(); BindGrid(); GrdPriorART.DataSource = theDSARTHistory.Tables[2]; GrdPriorART.DataBind(); DataTable theDTGRV = (DataTable)GrdPriorART.DataSource; ViewState["GridData"] = theDTGRV; } }