public void fillDropDown() { theDSXML.ReadXml(MapPath("..\\..\\XMLFiles\\AllMasters.con")); theDVCodeID = new DataView(theDSXML.Tables["Mst_Code"]); theDVCodeID.RowFilter = "Name='ARV Therapy Plan'"; theDV = new DataView(theDSXML.Tables["Mst_Decode"]); //theDV.RowFilter = "CodeID=146"; theDV.RowFilter = "CodeID=" + ((DataTable)theDVCodeID.ToTable()).Rows[0]["CodeID"].ToString(); theDT = (DataTable)theUtils.CreateTableFromDataView(theDV); theDT.DefaultView.ToTable(true, "Name"); BindManager.BindCombo(ddlTreatmentplan, theDT, "Name", "ID"); ddlTreatmentplan.Attributes.Add("OnChange", "getSelectedtableValue('divEligiblethrough','" + ddlTreatmentplan.ClientID + "','Start new treatment (naive patient)','DIVTreatmentplan');getSelectedtableValue('divARTchangecode','" + ddlTreatmentplan.ClientID + "','Change regimen','DIVTreatmentplan');getSelectedtableValue('divReasonforswitchto2ndlineregimen','" + ddlTreatmentplan.ClientID + "','Switch to second line','DIVTreatmentplan');getSelectedtableValue('divARTstopcode','" + ddlTreatmentplan.ClientID + "','Stop treatment','DIVTreatmentplan')"); //ddlTreatmentplan.Attributes.Add("OnChange", "getSelectedtableValue('divEligiblethrough','" + ddlTreatmentplan.ClientID + "','Start ART','DIVTreatmentplan');getSelectedtableValue('divARTchangecode','" + ddlTreatmentplan.ClientID + "','Substitute regimen','DIVTreatmentplan');getSelectedtableValue('divReasonforswitchto2ndlineregimen','" + ddlTreatmentplan.ClientID + "','Switch to second lin','DIVTreatmentplan');getSelectedtableValue('divARTstopcode','" + ddlTreatmentplan.ClientID + "','Stop treatment','DIVTreatmentplan')"); //ARTTreatmentPlan theDVCodeID = new DataView(theDSXML.Tables["Mst_Code"]); theDVCodeID.RowFilter = "Name='2ndLineRegimenSwitch'"; theDV = new DataView(theDSXML.Tables["Mst_Decode"]); theDV.RowFilter = "CodeID=" + ((DataTable)theDVCodeID.ToTable()).Rows[0]["CodeID"].ToString(); theDT = (DataTable)theUtils.CreateTableFromDataView(theDV); BindManager.BindCombo(ddlReasonforswitchto2ndlineregimen, theDT, "Name", "ID"); theDVCodeID = new DataView(theDSXML.Tables["Mst_Code"]); theDVCodeID.RowFilter = "Name='ARTEligibility'"; theDV = new DataView(theDSXML.Tables["Mst_Decode"]); theDV.RowFilter = "CodeID=" + ((DataTable)theDVCodeID.ToTable()).Rows[0]["CodeID"].ToString(); theDT = (DataTable)theUtils.CreateTableFromDataView(theDV); BindManager.BindCheckedList(chklistEligiblethrough, theDT, "Name", "ID"); theDVCodeID = new DataView(theDSXML.Tables["Mst_Code"]); theDVCodeID.RowFilter = "Name='ARTchangecode'"; theDV = new DataView(theDSXML.Tables["Mst_Decode"]); theDV.RowFilter = "CodeID=" + ((DataTable)theDVCodeID.ToTable()).Rows[0]["CodeID"].ToString(); theDT = (DataTable)theUtils.CreateTableFromDataView(theDV); BindManager.BindCheckedList(chklistARTchangecode, theDT, "Name", "ID"); theDVCodeID = new DataView(theDSXML.Tables["Mst_Code"]); theDVCodeID.RowFilter = "Name='ARTstopcode'"; theDV = new DataView(theDSXML.Tables["Mst_Decode"]); theDV.RowFilter = "CodeID=" + ((DataTable)theDVCodeID.ToTable()).Rows[0]["CodeID"].ToString(); theDT = (DataTable)theUtils.CreateTableFromDataView(theDV); BindManager.BindCheckedList(chklistARTstopcode, theDT, "Name", "ID"); chklistARTchangecode.Attributes.Add("OnClick", "CheckBoxHideUnhide('" + chklistARTchangecode.ClientID + "','divSpecifyotherARTchangereason','Other')"); chklistEligiblethrough.Attributes.Add("OnClick", "CheckBoxHideUnhide('" + chklistEligiblethrough.ClientID + "','divOtherEligibility','Other')"); chklistARTstopcode.Attributes.Add("OnClick", "CheckBoxHideUnhide('" + chklistARTstopcode.ClientID + "','divARTstopcodeother','Other patient decisi')"); //BindDropdown(ddlTreatmentplan, "ARTTreatmentPlan"); //BindChkboxlstControl(chklistEligiblethrough, "ARTEligibility"); //BindChkboxlstControl(chklistARTchangecode, "ARTchangecode"); //BindChkboxlstControl(chklistARTstopcode, "ARTstopcode"); //BindDropdown(ddlReasonforswitchto2ndlineregimen, "2ndLineRegimenSwitch"); }
private void Bind_Select_Lists() { theDSXML.ReadXml(MapPath("..\\..\\XMLFiles\\AllMasters.con")); theDVCodeID = new DataView(theDSXML.Tables["Mst_Code"]); theDVCodeID.RowFilter = "Name='WeightForAge'"; theDV = new DataView(theDSXML.Tables["Mst_Decode"]); theDV.RowFilter = "CodeID=" + ((DataTable)theDVCodeID.ToTable()).Rows[0]["CodeID"].ToString(); theDT = (DataTable)theUtils.CreateTableFromDataView(theDV); BindManager.BindCombo(ddlweightforage, theDT, "Name", "ID"); theDVCodeID = new DataView(theDSXML.Tables["Mst_Code"]); theDVCodeID.RowFilter = "Name='WeightForAge'"; theDV = new DataView(theDSXML.Tables["Mst_Decode"]); theDV.RowFilter = "CodeID=" + ((DataTable)theDVCodeID.ToTable()).Rows[0]["CodeID"].ToString(); theDT = (DataTable)theUtils.CreateTableFromDataView(theDV); BindManager.BindCombo(ddlweightforheight, theDT, "Name", "ID"); theDVCodeID = new DataView(theDSXML.Tables["Mst_Code"]); theDVCodeID.RowFilter = "Name='RefferedToFUpF'"; theDV = new DataView(theDSXML.Tables["Mst_Decode"]); theDV.RowFilter = "CodeID=" + ((DataTable)theDVCodeID.ToTable()).Rows[0]["CodeID"].ToString(); theDV.Sort = "SRNo asc, Name"; theDT = (DataTable)theUtils.CreateTableFromDataView(theDV); BindManager.BindCheckedList(cblReferredTo, theDT, "Name", "ID"); }
private void Init_Form() { txtcountryno.Attributes.Add("onkeyup", "chkPostiveInteger('" + txtcountryno.ClientID + "')"); txtcountryno.Attributes.Add("onblur", "chkPostiveInteger('" + txtcountryno.ClientID + "')"); txtLPTF.Attributes.Add("onkeyup", "chkPostiveInteger('" + txtLPTF.ClientID + "')"); txtLPTF.Attributes.Add("onblur", "chkPostiveInteger('" + txtLPTF.ClientID + "')"); txtSatelliteID.Attributes.Add("onkeyup", "chkPostiveInteger('" + txtSatelliteID.ClientID + "')"); txtSatelliteID.Attributes.Add("onblur", "chkPostiveInteger('" + txtSatelliteID.ClientID + "')"); txtNationalId.Attributes.Add("onKeyup", "chkNumeric('" + txtNationalId.ClientID + "')"); txtfacilityname.Text = ""; // txtcountryno.Text = ""; txtLPTF.Text = ""; txtSatelliteID.Text = ""; txtGrace.Text = ""; txtPEPFAR_Fund.Text = ""; cmbCurrency.SelectedValue = "0"; if (Session["SystemId"].ToString() == "2") { paperless.Visible = false; } BindFunctions BindManager = new BindFunctions(); IQCareUtils theUtils = new IQCareUtils(); DataSet theDSXML = new DataSet(); theDSXML.ReadXml(MapPath("..\\XMLFiles\\AllMasters.con")); DataView theDV = new DataView(); DataTable theDT = new DataTable(); /*******/ theDV = new DataView(theDSXML.Tables["Mst_District"]); theDV.RowFilter = "DeleteFlag=0 and SystemID= " + Session["SystemId"] + ""; if (theDV.Table != null) { theDT = (DataTable)theUtils.CreateTableFromDataView(theDV); BindManager.BindCombo(ddldistrict, theDT, "Name", "ID"); theDV.Dispose(); theDT.Clear(); } theDV = new DataView(theDSXML.Tables["Mst_Province"]); theDV.RowFilter = "Deleteflag=0 and SystemID=" + Session["SystemId"] + ""; if (theDV.Table != null) { theDT = (DataTable)theUtils.CreateTableFromDataView(theDV); BindManager.BindCombo(ddlprovince, theDT, "Name", "ID"); theDV.Dispose(); theDT.Clear(); } ///////////////////////////////////////////////// IFacilitySetup FacilityManager = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration"); DataSet theDSFacility = FacilityManager.GetModuleName(); DataTable DT = theDSFacility.Tables[0]; BindManager.BindCheckedList(cblPMTCT, DT, "displayname", "moduleid"); }
private void fill_dropdowns() { try { Iuser CmbManager; CmbManager = (Iuser)ObjectFactory.CreateInstance("BusinessProcess.Administration.BUser,BusinessProcess.Administration"); DataSet theDS = CmbManager.FillDropDowns(); CmbManager = null; //// User Groups List BindFunctions GblCls = new BindFunctions(); GblCls.BindCheckedList(lstUsergroup, theDS.Tables[0], "groupname", "groupid"); //// EmployeeList IQCareUtils theUtils = new IQCareUtils(); DataTable dt = new DataTable(); DataSet theXMLDS = new DataSet(); theXMLDS.ReadXml(Server.MapPath("..\\XMLFiles\\AllMasters.con")); DataView theDV = new DataView(theXMLDS.Tables["Mst_Employee"]); theDV.RowFilter = "DeleteFlag=0"; if (theDV.Table != null) { dt = theUtils.CreateTableFromDataView(theDV); } GblCls.BindCombo(ddEmployee, dt, "EmployeeName", "EmployeeId"); } catch (Exception err) { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["MessageText"] = err.Message.ToString(); IQCareMsgBox.Show("#C1", theBuilder, this); } }
public void BindChkboxlstControl(CheckBoxList chklst, string fieldname) { DataTable thedeCodeDT = new DataTable(); IQCareUtils iQCareUtils = new IQCareUtils(); BindFunctions BindManager = new BindFunctions(); DataSet theDSXML = new DataSet(); theDSXML.ReadXml(MapPath("..\\..\\XMLFiles\\AllMasters.con")); DataView theCodeDV = new DataView(theDSXML.Tables["MST_CODE"]); theCodeDV.RowFilter = "DeleteFlag=0 and Name='" + fieldname + "'"; DataTable theCodeDT = (DataTable)iQCareUtils.CreateTableFromDataView(theCodeDV); DataView theDV = new DataView(theDSXML.Tables["MST_DECODE"]); if (theCodeDT.Rows.Count > 0) { theDV.RowFilter = "DeleteFlag=0 and SystemID IN(0," + Convert.ToString(Session["SystemId"]) + ") and CodeID=" + theCodeDT.Rows[0]["CodeId"]; thedeCodeDT = (DataTable)iQCareUtils.CreateTableFromDataView(theDV); } if (thedeCodeDT.Rows.Count > 0) { BindManager.BindCheckedList(chklst, thedeCodeDT, "Name", "ID"); } }
public void fillDropDown() { theDSXML.ReadXml(MapPath("..\\..\\XMLFiles\\AllMasters.con")); theDVCodeID = new DataView(theDSXML.Tables["Mst_Code"]); theDVCodeID.RowFilter = "Name='NigeriaARVTreamentPlan'"; theDV = new DataView(theDSXML.Tables["Mst_Decode"]); if (theDVCodeID.Table.Rows.Count > 0) { theDV.RowFilter = "CodeID=" + ((DataTable)theDVCodeID.ToTable()).Rows[0]["CodeID"].ToString(); theDT = (DataTable)theUtils.CreateTableFromDataView(theDV); theDT.DefaultView.ToTable(true, "Name"); BindManager.BindCombo(ddlTreatmentplan, theDT, "Name", "ID"); } ddlTreatmentplan.Attributes.Add("OnChange", "getSelectedtableValue('divARTchangecode','" + ddlTreatmentplan.ClientID + "','Change Treatment','DIVTreatmentplan');"); //ddlTreatmentplan.Attributes.Add("OnChange", "getSelectedtableValue('divEligiblethrough','" + ddlTreatmentplan.ClientID + "','Start ART','DIVTreatmentplan');getSelectedtableValue('divARTchangecode','" + ddlTreatmentplan.ClientID + "','Substitute regimen','DIVTreatmentplan');getSelectedtableValue('divReasonforswitchto2ndlineregimen','" + ddlTreatmentplan.ClientID + "','Switch to second lin','DIVTreatmentplan');getSelectedtableValue('divARTstopcode','" + ddlTreatmentplan.ClientID + "','Stop treatment','DIVTreatmentplan')"); //ARTTreatmentPlan if (theDVCodeID.Table.Rows.Count > 0) { theDVCodeID = new DataView(theDSXML.Tables["Mst_Code"]); theDVCodeID.RowFilter = "Name='NigeriaARVTreamentChangeReason'"; theDV = new DataView(theDSXML.Tables["Mst_Decode"]); theDV.RowFilter = "CodeID=" + ((DataTable)theDVCodeID.ToTable()).Rows[0]["CodeID"].ToString(); theDT = (DataTable)theUtils.CreateTableFromDataView(theDV); BindManager.BindCheckedList(chklistARTchangecode, theDT, "Name", "ID"); } chklistARTchangecode.Attributes.Add("OnClick", "CheckBoxHideUnhide('" + chklistARTchangecode.ClientID + "','divSpecifyotherARTchangereason','Other(Specify)')"); }
private void BindModuleList() { BindFunctions BindManager = new BindFunctions(); IFacilitySetup FacilityManager = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration"); DataSet theDSFacility = FacilityManager.GetModuleName(); DataTable DT = theDSFacility.Tables[0]; BindManager.BindCheckedList(cblModuleName, DT, "modulename", "moduleid"); }
protected void FillDropDownFeatures() { ICustomFields CustomFields; try { DataTable theDTModule = (DataTable)Session["AppModule"]; string theModList = ""; foreach (DataRow theDR in theDTModule.Rows) { if (theModList == "") { theModList = theDR["ModuleId"].ToString(); } else { theModList = theModList + "," + theDR["ModuleId"].ToString(); } } if (theModList == "1,2") { theModList = "0"; } else if (theModList == "1") { theModList = "1"; } else { theModList = "2"; } //string[] mvalues = theModList.Split(new char[] { ',' }); CustomFields = (ICustomFields)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomFields, BusinessProcess.Administration"); DataSet theDS = CustomFields.GetFeatures(Convert.ToInt32(Session["SystemId"]), theModList); BindFunctions BindManager = new BindFunctions(); BindManager.BindCheckedList(Chkformname, theDS.Tables[0], "FeatureName", "FeatureID"); } catch (Exception err) { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["MessageText"] = err.Message.ToString(); IQCareMsgBox.Show("#C1", theBuilder, this); return; } finally { CustomFields = null; } }
private void BindControls() { BindFunctions theBindManager = new BindFunctions(); IQCareUtils theUtils = new IQCareUtils(); DataSet theDSXML = new DataSet(); DataTable theDT = new DataTable(); theDSXML.ReadXml(Server.MapPath("..\\XMLFiles\\AllMasters.con")); if (theDSXML.Tables["Mst_Employee"] != null) { theDV = new DataView(theDSXML.Tables["Mst_Employee"]); theDV.RowFilter = "DeleteFlag=0"; if (theDV.Table != null) { theDT = (DataTable)theUtils.CreateTableFromDataView(theDV); if (Convert.ToInt32(Session["AppUserEmployeeId"]) > 0) { theDV = new DataView(theDT); theDV.RowFilter = "EmployeeId =" + Session["AppUserEmployeeId"].ToString(); if (theDV.Count > 0) { theDT = theUtils.CreateTableFromDataView(theDV); } } theBindManager.BindCombo(ddlaborderedbyname, theDT, "EmployeeName", "EmployeeId"); theDV.Dispose(); theDT.Clear(); } theDSXML.Clear(); theDSXML.ReadXml(Server.MapPath("..\\XMLFiles\\LabMasters.con")); theDV = new DataView(theDSXML.Tables["LabTestOrder"]); theDV.RowFilter = "DeleteFlag=0"; if (theDV.Table != null) { theDV.Sort = "SubTestName asc"; DataTable theLabDt = theDV.ToTable(); theBindManager.BindCheckedList(chkOrderLabTests, theLabDt, "SubTestName", "SubTestId"); theDV.Dispose(); theDT.Clear(); } } if (Convert.ToInt32(ViewState["LabID"]) > 0) { BindDropdownOrderBy(DTtestDate.Rows[0]["OrderedbyName"].ToString()); ddlaborderedbyname.SelectedValue = DTtestDate.Rows[0]["OrderedbyName"].ToString(); txtlaborderedbydate.Text = String.Format("{0:dd-MMM-yyyy}", Convert.ToDateTime(DTtestDate.Rows[0]["OrderedbyDate"])); BindChklistLabs(); } }
private void BindControls() { BindFunctions theBindManager = new BindFunctions(); IQCareUtils theUtils = new IQCareUtils(); theDV = new DataView((DataTable)Session["DrugTable"]); DataTable DTSelected = (DataTable)Session["SelectedData"]; if (Convert.ToInt32(Session["DrugType"]) > 0) { if (Convert.ToInt32(Session["DrugType"]) == 100) { theDV.RowFilter = "DrugTypeId NOT IN (37,36,31) and Generic=0"; } else { //theDV.RowFilter = "DrugTypeId = " + Session["DrugType"].ToString(); theDV.RowFilter = "DrugTypeId = " + Session["DrugType"].ToString() + " and Generic=0 "; } theDV.Sort = "DrugName Asc"; } else { //theDV.RowFilter = "DrugTypeId <> 37 "; theDV.RowFilter = "DrugTypeId <> 37 and DrugId <> 1 and Generic=0 "; } DataTable theDT = theUtils.CreateTableFromDataView(theDV); //if (theDT != null) //{ // DataView theDV1 = new DataView(theDT); // theDV1.RowFilter = "DrugId <> 203"; // theDV1.Sort = "DrugName Asc"; // theDT = theUtils.CreateTableFromDataView(theDV1); //} if (theDT.Rows.Count > 0) { theBindManager.BindCheckedList(chkPharmacyselect, theDT, "DrugName", "DrugId"); theDV.Dispose(); theDT.Clear(); } if (DTSelected != null && DTSelected.Rows.Count > 0) { foreach (DataRow dr1 in DTSelected.Rows) { foreach (ListItem item in this.chkPharmacyselect.Items) //foreach (DataRow dr in theDT.Rows) { //string drugName = dr["DrugName"].ToString(); if (Convert.ToInt32(dr1["DrugId"]) == Convert.ToInt32(item.Value)) { //theDT.Rows.Remove(dr); item.Selected = true; break; } } } } }
protected void Page_Load(object sender, EventArgs e) { int PatientId = 0; int visitPK = 0; int locationId = 0; int userId = 0; if (!IsPostBack) { if (Session["AppLocation"] == null || Session.Count == 0 || Session["AppUserID"].ToString() == "") { Response.Redirect("~/frmlogin.aspx", true); } if (!object.Equals(Session["PatientId"], null)) { PatientId = Convert.ToInt32(Session["PatientId"]); if (PatientId == 0) { Response.Redirect("~/ClinicalForms/frmPatient_Home.aspx", true); } this.hidPID.Value = PatientId.ToString(); } if (!object.Equals(Session["PatientVisitId"], null)) { if (!object.Equals(Request.QueryString["add"], null)) { if (Request.QueryString["add"].ToString() == "0") { visitPK = 0; Session["PatientVisitId"] = "0"; } } else { visitPK = Convert.ToInt32(Session["PatientVisitId"]); } } else { if (!object.Equals(Request.QueryString["add"], null)) { if (Request.QueryString["add"].ToString() == "0") { visitPK = 0; } } } this.hidVId.Value = visitPK.ToString(); if (!object.Equals(Session["AppLocationId"], null)) { locationId = Convert.ToInt32(Session["AppLocationId"]); } if (!object.Equals(Session["AppUserId"], null)) { userId = Convert.ToInt32(Session["AppUserId"]); } if (!object.Equals(Session["PatientSex"], null)) { this.hidGender.Value = Session["PatientSex"].ToString(); } if (!object.Equals(Session["PatientAge"], null)) { this.hidDOB.Value = Session["PatientAge"].ToString(); } if (!object.Equals(Session["patientageinyearmonth"], null)) { this.hidPAYM.Value = Session["patientageinyearmonth"].ToString(); } if (!object.Equals(Session["TechnicalAreaName"], null)) { this.hidsrvNm.Value = Session["TechnicalAreaName"].ToString(); } if (!object.Equals(Session["TechnicalAreaId"], null)) { this.hidMOD.Value = Session["TechnicalAreaId"].ToString(); } //TB Assesment //------------------------------------------------------------------------------------ DataSet theDS = new DataSet(); theDS.ReadXml(MapPath("..\\XMLFiles\\ALLMasters.con")); DataView theDVDecode = new DataView(); DataTable theDTCode = new DataTable(); BindFunctions BindManager = new BindFunctions(); IQCareUtils theUtils = new IQCareUtils(); //TB Assesment Outcome theDVDecode = new DataView(theDS.Tables["mst_pmtctdecode"]); theDVDecode.RowFilter = "CodeName='TBAssessmentoutcome' and (DeleteFlag = 0 or DeleteFlag IS NULL) and SystemId in(0,1)"; theDVDecode.Sort = "SRNo desc"; if (theDVDecode.Table != null) { theDTCode = (DataTable)theUtils.CreateTableFromDataView(theDVDecode); BindManager.BindCheckedList(cblTBAssesment, theDTCode, "Name", "ID"); } //TB Findings theDVDecode = new DataView(theDS.Tables["mst_Decode"]); theDVDecode.RowFilter = "DeleteFlag=0 and CodeName='TBFindings' and Name not in('Other')"; if (theDVDecode.Table != null) { theDTCode = (DataTable)theUtils.CreateTableFromDataView(theDVDecode); BindManager.BindCombo(ddlTBFindings, theDTCode, "Name", "Id"); } //------------------------------------------------------------------------------------ if (!object.Equals(Request.QueryString["data"], null)) { string response = string.Empty; if (Session["AppLocation"] == null || Session.Count == 0 || Session["AppUserID"].ToString() == "") { CLogger.WriteLog(ELogLevel.ERROR, "Session expired!!"); ResponseType responsetype = new ResponseType() { Success = EnumUtil.GetEnumDescription(Success.False), ErrorMessage = "Session expired" }; response = SerializerUtil.ConverToJson <ResponseType>(responsetype); SendResponse(response); } if (Request.QueryString["data"].ToString() == "getdata") { response = GetRefillEncounter(Convert.ToInt32(PatientId), visitPK, locationId); SendResponse(response); IinitialFollowupVisit tbscreenManager = (IinitialFollowupVisit)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BInitialFollowupVisit, BusinessProcess.Clinical"); DataSet tbscreenDS = tbscreenManager.GetTBScreeningData(visitPK); ddlTBFindings.SelectedValue = tbscreenDS.Tables[0].Rows[0]["TBFindings"].ToString(); } if (Request.QueryString["data"].ToString() == "getzscore") { response = GetZScoreDetails(Convert.ToInt32(PatientId), visitPK, locationId); SendResponse(response); } if (Request.QueryString["data"].ToString() == "saverefillencounter") { System.IO.StreamReader sr = new System.IO.StreamReader(Request.InputStream); string jsonString = ""; jsonString = sr.ReadToEnd(); response = SaveRefillEncounterData(jsonString, PatientId, visitPK, locationId, userId); SendResponse(response); } } } }
public void fillSelect_MultiSelect() { try { theDSXML = new DataSet(); theDSXML.ReadXml(MapPath("..\\..\\XMLFiles\\AllMasters.con")); theDVCodeID = new DataView(theDSXML.Tables["Mst_Code"]); theDVCodeID.RowFilter = "Name='SexualOrientation'"; theDV = new DataView(theDSXML.Tables["Mst_Decode"]); theDV.RowFilter = "CodeID=" + ((DataTable)theDVCodeID.ToTable()).Rows[0]["CodeID"].ToString(); theDT = (DataTable)theUtils.CreateTableFromDataView(theDV); BindManager.BindCombo(rcbSexualOrientation, theDT, "Name", "ID"); theDVCodeID = new DataView(theDSXML.Tables["Mst_Code"]); theDVCodeID.RowFilter = "Name='PartnerHIVStatus'"; theDV = new DataView(theDSXML.Tables["Mst_Decode"]); theDV.RowFilter = "CodeID=" + ((DataTable)theDVCodeID.ToTable()).Rows[0]["CodeID"].ToString(); theDT = (DataTable)theUtils.CreateTableFromDataView(theDV); BindManager.BindCombo(rcbPartnerHIVStatus, theDT, "Name", "ID"); theDVCodeID = new DataView(theDSXML.Tables["Mst_Code"]); theDVCodeID.RowFilter = "Name='HighRisk'"; theDV = new DataView(theDSXML.Tables["Mst_Decode"]); theDV.RowFilter = "CodeID=" + ((DataTable)theDVCodeID.ToTable()).Rows[0]["CodeID"].ToString(); theDT = (DataTable)theUtils.CreateTableFromDataView(theDV); BindManager.BindCheckedList(cblHighRisk, theDT, "Name", "ID"); theDVCodeID = new DataView(theDSXML.Tables["Mst_Code"]); theDVCodeID.RowFilter = "Name='counselling'"; theDV = new DataView(theDSXML.Tables["Mst_Decode"]); theDV.RowFilter = "CodeID=" + ((DataTable)theDVCodeID.ToTable()).Rows[0]["CodeID"].ToString(); theDT = (DataTable)theUtils.CreateTableFromDataView(theDV); BindManager.BindCheckedList(cblCounselling, theDT, "Name", "ID"); theDVCodeID = new DataView(theDSXML.Tables["Mst_Code"]); theDVCodeID.RowFilter = "Name='RefferedToFUpF'"; theDV = new DataView(theDSXML.Tables["Mst_Decode"]); theDV.RowFilter = "CodeID=" + ((DataTable)theDVCodeID.ToTable()).Rows[0]["CodeID"].ToString(); theDT = (DataTable)theUtils.CreateTableFromDataView(theDV); BindManager.BindCheckedList(cblReferredTo, theDT, "Name", "ID"); theDVCodeID = new DataView(theDSXML.Tables["Mst_Code"]); theDVCodeID.RowFilter = "Name='TransitionPreparation'"; theDV = new DataView(theDSXML.Tables["Mst_Decode"]); theDV.RowFilter = "CodeID=" + ((DataTable)theDVCodeID.ToTable()).Rows[0]["CodeID"].ToString(); theDT = (DataTable)theUtils.CreateTableFromDataView(theDV); BindManager.BindCheckedList(cblTransitionPreparation, theDT, "Name", "ID"); theDVCodeID = new DataView(theDSXML.Tables["Mst_Code"]); theDVCodeID.RowFilter = "Name='FPMethod'"; theDV = new DataView(theDSXML.Tables["Mst_Decode"]); theDV.RowFilter = "CodeID=" + ((DataTable)theDVCodeID.ToTable()).Rows[0]["CodeID"].ToString(); theDT = (DataTable)theUtils.CreateTableFromDataView(theDV); BindManager.BindCombo(rcbFPMethod, theDT, "Name", "ID"); theDVCodeID = new DataView(theDSXML.Tables["Mst_Code"]); theDVCodeID.RowFilter = "Name='ReferredToFP'"; theDV = new DataView(theDSXML.Tables["Mst_Decode"]); theDV.RowFilter = "CodeID=" + ((DataTable)theDVCodeID.ToTable()).Rows[0]["CodeID"].ToString(); theDT = (DataTable)theUtils.CreateTableFromDataView(theDV); BindManager.BindCombo(ddlReferredFP, theDT, "Name", "ID"); theDVCodeID = new DataView(theDSXML.Tables["Mst_Code"]); theDVCodeID.RowFilter = "Name='LMP Not Accessed'"; theDV = new DataView(theDSXML.Tables["Mst_Decode"]); theDV.RowFilter = "CodeID=" + ((DataTable)theDVCodeID.ToTable()).Rows[0]["CodeID"].ToString(); theDT = (DataTable)theUtils.CreateTableFromDataView(theDV); BindManager.BindCombo(DDLReasonLMP, theDT, "Name", "ID"); theDVCodeID = new DataView(theDSXML.Tables["Mst_Code"]); theDVCodeID.RowFilter = "Name='CervicalCancerScreeningResults'"; theDV = new DataView(theDSXML.Tables["Mst_Decode"]); theDV.RowFilter = "CodeID=" + ((DataTable)theDVCodeID.ToTable()).Rows[0]["CodeID"].ToString(); theDT = (DataTable)theUtils.CreateTableFromDataView(theDV); BindManager.BindCombo(rcbCervicalCancerScreeningResults, theDT, "Name", "ID"); theDVCodeID = new DataView(theDSXML.Tables["Mst_Code"]); theDVCodeID.RowFilter = "Name='OfferedHPVaccine'"; theDV = new DataView(theDSXML.Tables["Mst_Decode"]); theDV.RowFilter = "CodeID=" + ((DataTable)theDVCodeID.ToTable()).Rows[0]["CodeID"].ToString(); theDT = (DataTable)theUtils.CreateTableFromDataView(theDV); BindManager.BindCombo(rcbOfferedHPVVaccine, theDT, "Name", "ID"); } catch (Exception ex) { //Page.ClientScript.RegisterStartupScript(this.GetType(), "fillMultiSelectError", "alert('Please refresh system cache.');", true); ScriptManager.RegisterStartupScript(this, this.GetType(), "fillMultiSelectError", "alert('Please refresh system cache.');", true); } }
private void Init_Form() { //txtcountryno.Attributes.Add("onkeyup", "chkPostiveInteger('" + txtcountryno.ClientID + "')"); //txtcountryno.Attributes.Add("onblur", "chkPostiveInteger('" + txtcountryno.ClientID + "')"); txtLPTF.Attributes.Add("onkeyup", "chkPostiveInteger('" + txtLPTF.ClientID + "')"); txtLPTF.Attributes.Add("onblur", "chkPostiveInteger('" + txtLPTF.ClientID + "')"); txtSatelliteID.Attributes.Add("onkeyup", "chkPostiveInteger('" + txtSatelliteID.ClientID + "')"); txtSatelliteID.Attributes.Add("onblur", "chkPostiveInteger('" + txtSatelliteID.ClientID + "')"); txtNationalId.Attributes.Add("onKeyup", "chkNumeric('" + txtNationalId.ClientID + "')"); txtfacilityname.Text = ""; //txtcountryno.Text = ""; txtLPTF.Text = ""; txtSatelliteID.Text = ""; txtGrace.Text = ""; txtPEPFAR_Fund.Value = ""; cmbCurrency.SelectedValue = "0"; if (Session["SystemId"].ToString() == "2") { paperless.Visible = false; } //BindCombo(); //ddBackupTime.SelectedValue = "0"; BindFunctions BindManager = new BindFunctions(); IQCareUtils theUtils = new IQCareUtils(); DataSet theDSXML = new DataSet(); theDSXML.ReadXml(MapPath("..\\XMLFiles\\AllMasters.con")); DataView theDV; DataTable theDT = new DataTable(); //theDV = new DataView(theDSXML.Tables["Mst_District"]); ICommonData oCommonData = (ICommonData)ObjectFactory.CreateInstance("BusinessProcess.Service.BCommonData,BusinessProcess.Service"); theDT = (DataTable)oCommonData.getAllCountries(); //theDV.RowFilter = "SystemID=" + Session["SystemId"] + ""; if (theDT != null && theDT.Rows.Count > 0) { //theDT = (DataTable)theUtils.CreateTableFromDataView(theDV); BindManager.BindCombo(ddCountry, theDT, "CountryName", "CountryID"); //theDV.Dispose(); theDT.Clear(); } theDT = (DataTable)oCommonData.getAllProvince(); DataView dv = new DataView(theDT); dv.RowFilter = "CountryID= " + Session["AppCountryId"] + ""; DataTable theDTSpecific = (DataTable)theUtils.CreateTableFromDataView(dv); if (theDTSpecific.Rows.Count > 0) { BindManager.BindCombo(ddlprovince, theDTSpecific, "Name", "ID"); } else if (theDT != null && theDT.Rows.Count > 0) { //theDT = (DataTable)theUtils.CreateTableFromDataView(theDV); BindManager.BindCombo(ddlprovince, theDT, "Name", "ID"); //theDV.Dispose(); theDT.Clear(); } theDT = (DataTable)oCommonData.getAllDistrict(); // theDV.RowFilter = "SystemID= " + Session["SystemId"] + ""; if (theDT != null && theDT.Rows.Count > 0) { //theDT = (DataTable)theUtils.CreateTableFromDataView(theDV); BindManager.BindCombo(ddldistrict, theDT, "Name", "ID"); //theDV.Dispose(); theDT.Clear(); } ///////////////////////////////////////////////// IFacilitySetup FacilityManager = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration"); DataSet theDSFacility = FacilityManager.GetModuleName(); DataTable DT = theDSFacility.Tables[0]; BindManager.BindCheckedList(cblPMTCT, DT, "modulename", "moduleid"); // Binding Drug Stores DataSet theDSDrugStores = FacilityManager.GetDrugStores(); BindManager.BindCheckedList(CBL_DrugStore, theDSDrugStores.Tables[0], "Name", "StoreId"); }
public void BindControl(Control cntrl, string fieldname) { DataTable thedeCodeDT = new DataTable(); IQCareUtils iQCareUtils = new IQCareUtils(); BindFunctions BindManager = new BindFunctions(); DataSet theDSXML = new DataSet(); theDSXML.ReadXml(MapPath("..\\XMLFiles\\AllMasters.con")); DataView theCodeDV = new DataView(theDSXML.Tables["MST_CODE"]); theCodeDV.RowFilter = "DeleteFlag=0 and Name='" + fieldname + "'"; DataTable theCodeDT = (DataTable)iQCareUtils.CreateTableFromDataView(theCodeDV); DataView theDV = new DataView(theDSXML.Tables["MST_DECODE"]); if (fieldname.ToString() != "") { if (theCodeDT.Rows.Count > 0) { theDV.RowFilter = "DeleteFlag=0 and SystemID IN(0," + Convert.ToString(Session["SystemId"]) + ") and CodeID=" + theCodeDT.Rows[0]["CodeId"]; theDV.Sort = "SRNo ASC"; thedeCodeDT = (DataTable)iQCareUtils.CreateTableFromDataView(theDV); } if (cntrl is CheckBoxList) { if (thedeCodeDT.Rows.Count > 0) { BindManager.BindCheckedList((CheckBoxList)cntrl, thedeCodeDT, "Name", "ID"); } } else if (cntrl is DropDownList) { if (thedeCodeDT.Rows.Count > 0) { BindManager.BindCombo((DropDownList)cntrl, thedeCodeDT, "Name", "ID"); } } else if (cntrl is RadioButtonList) { if (thedeCodeDT.Rows.Count > 0) { BindManager.RadioButtonList((RadioButtonList)cntrl, thedeCodeDT, "Name", "ID"); } } } else { theDV = new DataView(theDSXML.Tables["MST_DECODE"]); if (theDV.Table.Rows.Count > 0) { theDV.RowFilter = "DeleteFlag=0 and SystemID IN(0," + Convert.ToString(Session["SystemId"]) + ") and CodeID=17 and ModuleId=209"; theDV.Sort = "SRNo ASC"; thedeCodeDT = new DataTable(); thedeCodeDT = (DataTable)iQCareUtils.CreateTableFromDataView(theDV); } if (cntrl is CheckBoxList) { if (thedeCodeDT.Rows.Count > 0) { BindManager.BindCheckedList((CheckBoxList)cntrl, thedeCodeDT, "Name", "ID"); } } else if (cntrl is DropDownList) { if (thedeCodeDT.Rows.Count > 0) { BindManager.BindCombo((DropDownList)cntrl, thedeCodeDT, "Name", "ID"); } } else if (cntrl is RadioButtonList) { if (thedeCodeDT.Rows.Count > 0) { BindManager.RadioButtonList((RadioButtonList)cntrl, thedeCodeDT, "Name", "ID"); } } } }