/////////////////////////////////////////////////////////////////////
    // Code Written By   : Sanjay Rana
    // Written Date      : 25th Aug 2006
    // Modification Date :
    // Description       : Custom Item List
    //
    /// /////////////////////////////////////////////////////////////////
    #region "User Functions"
    private void BindGrid()
    {
        IQCareUtils theUtil = new IQCareUtils();
        DataSet     dscustomiseList;
        string      filePath = Server.MapPath("~/XMLFiles/customizelist.xml");

        dscustomiseList = new DataSet();
        dscustomiseList.ReadXml(filePath);
        DataView theDV = new DataView(dscustomiseList.Tables[0]);

        theDV.RowFilter = "SystemId=" + Session["SystemId"].ToString() + " or SystemId=0";
        DataTable theXMLDT = theUtil.CreateTableFromDataView(theDV);

        ICustomList CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");
        DataTable   theDT         = CustomManager.GetCustomFieldList(Convert.ToInt32(Session["SystemId"]), Convert.ToInt32(Session["AppLocationId"]));

        if (theDT != null && theDT.Rows.Count > 0)
        {
            theXMLDT.Merge(theDT);
        }
        theDV      = new DataView(theXMLDT);
        theDV.Sort = "Listname asc";
        grdCustomizeItems.DataSource = theUtil.CreateTableFromDataView(theDV);
        grdCustomizeItems.DataBind();
        grdCustomizeItems.Columns[1].Visible = false;
        grdCustomizeItems.Columns[2].Visible = false;
        grdCustomizeItems.Columns[3].Visible = false;
        grdCustomizeItems.Columns[4].Visible = false;
        grdCustomizeItems.Columns[5].Visible = false;
    }
Exemple #2
0
        private void BindDropdown(DropDownList DropDownID, string fieldname)
        {
            DataSet theDS = new DataSet();

            theDS.ReadXml(MapPath("..\\..\\XMLFiles\\ALLMasters.con"));
            BindFunctions BindManager = new BindFunctions();
            IQCareUtils   theUtils    = new IQCareUtils();
            DataView      theCodeDV   = new DataView(theDS.Tables["MST_CODE"]);

            theCodeDV.RowFilter = "DeleteFlag=0 and Name='" + fieldname + "'";
            DataTable theCodeDT = (DataTable)theUtils.CreateTableFromDataView(theCodeDV);

            if (theDS.Tables["Mst_Decode"] != null)
            {
                DataView theDV = new DataView(theDS.Tables["Mst_Decode"]);
                if (theCodeDT.Rows.Count > 0)
                {
                    theDV.RowFilter = "DeleteFlag=0 and CodeId=" + theCodeDT.Rows[0]["CodeId"];
                    if (theDV.Table != null)
                    {
                        DataTable theDT = (DataTable)theUtils.CreateTableFromDataView(theDV);
                        BindManager.BindCombo(DropDownID, theDT, "Name", "Id");
                    }
                }
            }
        }
        private void BindList()
        {
            DataSet theDS = new DataSet();

            theDS.ReadXml(MapPath("..\\XMLFiles\\ALLMasters.con"));
            BindFunctions BindManager = new BindFunctions();
            IQCareUtils   theUtils    = new IQCareUtils();

            if (theDS.Tables["Mst_Decode"] != null)
            {
                DataView theDVWHOStage = new DataView(theDS.Tables["Mst_Decode"]);
                theDVWHOStage.RowFilter = "CodeId=22 and (DeleteFlag = 0 or DeleteFlag IS NULL) and SystemId in(0,1)";
                theDVWHOStage.Sort      = "SRNo";
                if (theDVWHOStage.Table != null)
                {
                    DataTable theDTWHOStage = (DataTable)theUtils.CreateTableFromDataView(theDVWHOStage);
                    BindManager.BindCombo(ddlotherFacilityClinicalStage, theDTWHOStage, "Name", "Id");
                    BindManager.BindCombo(ddlthisfacilityClinicalStage, theDTWHOStage, "Name", "Id");
                }
                DataView theDVFunctionalStage = new DataView(theDS.Tables["Mst_Decode"]);
                theDVFunctionalStage.RowFilter = "CodeId=21 and (DeleteFlag=0 or DeleteFlag IS NULL) and SystemId in (0,1)";
                theDVFunctionalStage.Sort      = "SRNo";
                if (theDVFunctionalStage.Table != null)
                {
                    DataTable theDTFunctionalStage = (DataTable)theUtils.CreateTableFromDataView(theDVFunctionalStage);
                    BindManager.BindCombo(ddlotherFunction, theDTFunctionalStage, "Name", "Id");
                    BindManager.BindCombo(ddlthisFunction, theDTFunctionalStage, "Name", "Id");
                }
            }
        }
        /// <summary>
        /// Binds the dropdown reported by.
        /// </summary>
        /// <param name="EmployeeId">The employee identifier.</param>
        private void BindDropdownReportedBy(String EmployeeId)
        {
            DataSet theDS = new DataSet();

            theDS.ReadXml(MapPath("..\\XMLFiles\\ALLMasters.con"));
            BindFunctions BindManager = new BindFunctions();
            IQCareUtils   theUtils    = new IQCareUtils();

            if (theDS.Tables["Mst_Employee"] != null)
            {
                DataView theDV = new DataView(theDS.Tables["Mst_Employee"]);
                theDV.RowFilter = "DeleteFlag=0";
                if (theDV.Table != null)
                {
                    DataTable theDT = (DataTable)theUtils.CreateTableFromDataView(theDV);
                    if (Convert.ToInt32(Session["AppUserEmployeeId"]) > 0)
                    {
                        theDV           = new DataView(theDT);
                        theDV.RowFilter = "EmployeeId IN(" + Session["AppUserEmployeeId"].ToString() + "," + EmployeeId + ")";
                        if (theDV.Count > 0)
                        {
                            theDT = theUtils.CreateTableFromDataView(theDV);
                        }
                    }

                    BindManager.BindCombo(ddlLabReportedbyName, theDT, "EmployeeName", "EmployeeId");
                }
            }
        }
        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");
            }
        }
Exemple #6
0
    /// <summary>
    ///  Bind Dropdown
    /// </summary>
    private void FillDropDowns()
    {
        BindFunctions BindManager = new BindFunctions();
        IQCareUtils   theUtils    = new IQCareUtils();
        DataTable     theDT       = new DataTable();
        DataSet       theDSXML    = new DataSet();

        theDSXML.ReadXml(MapPath("..\\XMLFiles\\AllMasters.con"));
        DataView theDV = new DataView(theDSXML.Tables["Mst_Decode"]);

        theDV.RowFilter = "DeleteFlag=0 and CodeID=210";
        if (theDV.Table != null)
        {
            theDT = (DataTable)theUtils.CreateTableFromDataView(theDV);
            BindManager.BindCombo(ddlSeverity, theDT, "Name", "ID");
            theDV.Dispose();
            theDT.Clear();
        }

        theDV           = new DataView(theDSXML.Tables["Mst_Code"]);
        theDV.RowFilter = "DeleteFlag=0 and CodeID in (207,208,209,211)";
        if (theDV.Table != null)
        {
            theDT = (DataTable)theUtils.CreateTableFromDataView(theDV);
            BindManager.BindCombo(ddlAllergyType, theDT, "Name", "CodeID");
            theDV.Dispose();
            theDT.Clear();
        }
    }
        private void FillDropDownsCTT()
        {
            BindFunctions BindManager = new BindFunctions();
            IQCareUtils   theUtils    = new IQCareUtils();

            DataTable theDT = new DataTable();

            DataSet theDSXML = new DataSet();

            theDSXML.ReadXml(MapPath("..\\XMLFiles\\AllMasters.con"));

            DataView theDV = new DataView(theDSXML.Tables["mst_CouncellingType"]);

            theDV.RowFilter = "DeleteFlag=0";
            theDV.Sort      = "Name asc";
            if (theDV.Table != null)
            {
                theDT = (DataTable)theUtils.CreateTableFromDataView(theDV);
                BindManager.BindCombo(ddlRegion, theDT, "Name", "ID");
                theDV.Dispose();
                theDT.Clear();
            }

            theDV           = new DataView(theDSXML.Tables["mst_CouncellingTopic"]);
            theDV.RowFilter = "DeleteFlag=0";
            theDV.Sort      = "Name asc";
            if (theDV.Table != null)
            {
                theDT = (DataTable)theUtils.CreateTableFromDataView(theDV);

                BindManager.BindCombo(ddDistrict, theDT, "Name", "ID");
                theDV.Dispose();
                theDT.Clear();
            }
        }
    private void FillDropDownsRD()
    {
        BindFunctions BindManager = new BindFunctions();
        IQCareUtils   theUtils    = new IQCareUtils();

        DataTable theDT = new DataTable();

        //DataSet theDSXML = new DataSet();
        //theDSXML.ReadXml(MapPath("..\\XMLFiles\\AllMasters.con"));
        DataView theDV = new DataView(oCommonData.getAllProvince());

        theDV.Sort = "Name asc";
        //theDV.RowFilter = "DeleteFlag=0";
        if (theDV.Table != null)
        {
            theDT = (DataTable)theUtils.CreateTableFromDataView(theDV);
            BindManager.BindCombo(ddlRegion, theDT, "Name", "ID");
            theDV.Dispose();
            theDT.Clear();
        }

        theDV      = new DataView(oCommonData.getAllDistrict());
        theDV.Sort = "Name asc";
        //theDV.RowFilter = "DeleteFlag=0";
        if (theDV.Table != null)
        {
            theDT = (DataTable)theUtils.CreateTableFromDataView(theDV);
            //BindManager.BindCheckedList(chkDestict, theDT, "Name", "ID");
            //theDV.Dispose();
            //theDT.Clear();
            BindManager.BindCombo(ddDistrict, theDT, "Name", "ID");
            theDV.Dispose();
            theDT.Clear();
        }
    }
        private void BindList()
        {
            DataTable theDT    = new DataTable();
            DataTable theTmpDT = new DataTable();

            DataTable DTSelected = new DataTable();

            if (ViewState["SelectedLab"] == null)
            {
                DTSelected.Columns.Add("LabTestID", System.Type.GetType("System.Int32"));
                DTSelected.Columns.Add("LabName", System.Type.GetType("System.String"));
                DTSelected.Columns.Add("SubTestID", System.Type.GetType("System.Int32"));
                DTSelected.Columns.Add("SubTestName", System.Type.GetType("System.String"));
                DTSelected.Columns.Add("LabTypeId", System.Type.GetType("System.Int32"));
                DTSelected.Columns.Add("Flag", System.Type.GetType("System.Int32"));
                DTSelected.Constraints.Add("Con1", DTSelected.Columns["SubTestID"], true);
                ViewState["SelectedLab"] = DTSelected;
            }
            DTSelected = (DataTable)ViewState["SelectedLab"];
            IQCareUtils theUtils = new IQCareUtils();

            if (ViewState["LabData"] != null)
            {
                DataView theDV = new DataView((DataTable)ViewState["LabData"]);
                #region "14-jun-07 - 1"
                // theDV.RowFilter = "LabTypeId=1";
                if (Request.QueryString["Mode"] == "Add")
                {
                    theDV.RowFilter = "LabTypeId=1 and DeleteFlag = 0";
                }
                else if (Request.QueryString["Mode"] == "All")
                {
                    theDV.RowFilter = "DeleteFlag = 0";
                }
                else
                {
                    theDV.RowFilter = "LabTypeId=1";
                }
                #endregion

                theTmpDT = theUtils.CreateTableFromDataView(theDV);
                theDT    = theTmpDT;
            }
            DataView theDV1 = new DataView(theDT);
            theDV1.Sort = "SubTestName Asc";
            theDT       = theUtils.CreateTableFromDataView(theDV1);

            BindFunctions theBind = new BindFunctions();
            theBind.BindList(lstSelected, DTSelected, "SubTestName", "SubTestID");
            for (int j = 0; j < lstSelected.Items.Count; j++)
            {
                DataRow[] theDR = theDT.Select("SubTestID=" + lstSelected.Items[j].Value);
                if (theDR.Length != 0)
                {
                    theDT.Rows.Remove(theDR[0]);
                }
            }
            ViewState["LabData"] = theDT;
            theBind.BindList(lstLabList, theDT, "SubTestName", "SubTestId");
        }
Exemple #10
0
        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");
        }
        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)')");
        }
Exemple #12
0
        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");
        }
    //int currentDate;
    #region "Modified13June07(1)"
    private void fillDropDownList(int idPurpose, int idEmployee)
    {
        IAppointment FormManager;

        FormManager = (IAppointment)ObjectFactory.CreateInstance("BusinessProcess.Scheduler.BAppointment, BusinessProcess.Scheduler");
        DataSet       theDtSet        = FormManager.GetEmployees(idEmployee);
        DataSet       theDtSetPurpose = FormManager.GetAppointmentReasons(idPurpose);
        BindFunctions appBind         = new BindFunctions();
        IQCareUtils   theUtils        = new IQCareUtils();

        if (Request.QueryString["Name"] == "Add")
        {
            //if (Convert.ToInt32(Session["PatientVisitId"]) == 0)
            //{
            DataView theDV = new DataView(theDtSet.Tables[0]);
            DataView TheDV = new DataView(theDtSetPurpose.Tables[0]);
            theDV.RowFilter = "DeleteFlag=0";
            TheDV.RowFilter = "DeleteFlag=0";
            if (theDV.Table != null)
            {
                DataTable DT = (DataTable)theUtils.CreateTableFromDataView(theDV);
                if (Convert.ToInt32(Session["AppUserEmployeeId"]) > 0)
                {
                    theDV = new DataView(DT);

                    //theDV.RowFilter = "EmployeeId IN("+ EmployeeId +" ," + Session["AppUserEmployeeId"].ToString() + ")";
                    theDV.RowFilter = "EmployeeId =" + Session["AppUserEmployeeId"].ToString();
                    if (theDV.Count > 0)
                    {
                        DT = theUtils.CreateTableFromDataView(theDV);
                    }
                }
                DataTable TheDT = (DataTable)theUtils.CreateTableFromDataView(TheDV);

                //appBind.BindCombo(ddAppProvider, DT, "EmployeeName", "EmployeeId");
                //BindUserDropdown(ddAppProvider, string.Empty);
                BindUserDropdown(ddAppProvider, Session["AppUserId"].ToString());
                appBind.BindCombo(ddAppPurpose, TheDT, "Name", "Id");
                theDV.Dispose();
                TheDV.Dispose();
                DT.Clear();
                TheDT.Clear();
            }
            //}
        }
        if (Request.QueryString["name"] == "Edit" || Request.QueryString["name"] == "Delete")
        {
            BindDropdownOrderBy(theDtSet.Tables[0].Rows[0]["EmployeeName"].ToString());

            this.ddAppProvider.SelectedValue = theDtSet.Tables[0].Rows[0]["EmployeeName"].ToString();
            //appBind.BindCombo(ddAppProvider, theDtSet.Tables[0], "EmployeeName", "EmployeeId");
            appBind.BindCombo(ddAppPurpose, theDtSetPurpose.Tables[0], "Name", "Id");
        }
    }
        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");
        }
Exemple #15
0
    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();
            }
        }
        if (Convert.ToInt32(Session["Lab_ID"]) > 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"]));
            if (DTtestDate.Rows[0].IsNull("PreClinicLabDate") == false)
            {
                if (((DateTime)DTtestDate.Rows[0]["PreClinicLabDate"]).ToString(Session["AppDateFormat"].ToString()) != "01-Jan-1900")
                {
                    this.txtLabtobeDone.Text = (((DateTime)DTtestDate.Rows[0]["PreClinicLabDate"]).ToString(Session["AppDateFormat"].ToString())).ToString();
                }
            }

            if (this.txtLabtobeDone.Text != "")
            {
                this.preclinicLabs.Checked = true;
            }


            //dtLabTest = (DataTable)ViewState["LabTestID"];
            Session["dtLabTest"] = (DataTable)ViewState["LabTestID"];
            LoadLabResult((DataTable)ViewState["LabTestID"]);
        }
    }
        private void BindTransferDetail()
        {
            txtLocationName.Text     = Session["AppLocation"].ToString();
            txtLocationName.ReadOnly = true;

            /*Binding Satellite ID*/
            BindFunctions BindManager = new BindFunctions();
            IQCareUtils   theUtils    = new IQCareUtils();
            DataTable     theDT       = new DataTable();

            DataSet          theDS = new DataSet();
            IPatientTransfer PatientTransferMgr = (IPatientTransfer)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientTransfer, BusinessProcess.Clinical");

            if (btnSave.Text == "Save")
            {
                tredit.Visible       = false;
                theDS                = PatientTransferMgr.GetSatelliteLocation(PatientId.ToString(), TransferId, 0, Session["SystemId"].ToString());
                txtLocationName.Text = theDS.Tables[0].Rows[0]["CurrentSatName"].ToString();
                DataView theDV = new DataView(theDS.Tables[1]);
                if (theDV.Table != null)
                {
                    theDT = (DataTable)theUtils.CreateTableFromDataView(theDV);
                    BindManager.BindCombo(ddSatellite, theDT, "Name", "ID");
                    theDV.Dispose();
                    theDT.Clear();
                }
            }


            if (btnSave.Text == "Update")
            {
                tredit.Visible = true;
                theDS          = PatientTransferMgr.GetSatelliteLocation(PatientId.ToString(), TransferId, 1, Session["SystemId"].ToString());

                txtLocationNameEdit.Text    = theDS.Tables[0].Rows[0]["CurrentSatName"].ToString();
                txtLocationNameEdit.Enabled = false;
                txtFromSatellite.Text       = theDS.Tables[2].Rows[0]["TransferfromSatellite"].ToString();
                txtFromSatellite.Enabled    = false;
                ViewState["FromID"]         = theDS.Tables[2].Rows[0]["TransferredfromID"].ToString();
                //ddSatelliteEdit.Enabled = false;
                TxtTransDateEdit.Text     = string.Format("{0:dd-MMM-yyyy}", Convert.ToDateTime(theDS.Tables[2].Rows[0]["TransferredDate"]));
                ViewState["TransferDate"] = TxtTransDateEdit.Text;
                DataView theDV = new DataView(theDS.Tables[1]);
                //theDV.RowFilter = "DeleteFlag=0";
                if (theDV.Table != null)
                {
                    theDT = (DataTable)theUtils.CreateTableFromDataView(theDV);
                    BindManager.BindCombo(ddSatelliteEdit, theDT, "Name", "ID");
                    theDV.Dispose();
                    theDT.Clear();
                }
                ddSatelliteEdit.SelectedValue = theDS.Tables[2].Rows[0][3].ToString();
            }
        }
Exemple #17
0
    protected void txtAllergen_TextChanged(object sender, EventArgs e)
    {
        IQCareUtils theUtils = new IQCareUtils();
        DataView    theAutoDV;
        DataView    theExistsDV;
        DataSet     theAutoDS = (DataSet)ViewState["MasterData"];
        int         DrugId;

        if (hdCustID.Value != "")
        {
            if ((Convert.ToInt32(hdCustID.Value) != 0))
            {
                DrugId              = Convert.ToInt32(hdCustID.Value);
                theAutoDV           = new DataView(theAutoDS.Tables[0]);
                theAutoDV.RowFilter = "Drug_Pk = " + DrugId;
                DataTable theAutoDT = (DataTable)theUtils.CreateTableFromDataView(theAutoDV);
                if (Session["AddARV"] == null)
                {
                    DataTable theDT = new DataTable();
                    theDT.Columns.Add("DrugId", System.Type.GetType("System.Int32"));
                    theDT.Columns.Add("DrugName", System.Type.GetType("System.String"));
                    theDT.Columns.Add("Generic", System.Type.GetType("System.Int32"));
                    theDT.Columns.Add("DrugTypeId", System.Type.GetType("System.Int32"));
                    Session["AddARV"] = theDT;
                }
                DataTable ExistDT = (DataTable)Session["AddARV"];
                theExistsDV           = new DataView(ExistDT);
                theExistsDV.RowFilter = "DrugId =" + theAutoDT.Rows[0]["Drug_pk"];
                DataTable theSelExistsDT = (DataTable)theUtils.CreateTableFromDataView(theExistsDV);
                if (theSelExistsDT.Rows.Count == 0)
                {
                    DataRow DR = ExistDT.NewRow();
                    DR[0] = theAutoDT.Rows[0]["Drug_pk"];
                    DR[1] = theAutoDT.Rows[0]["DrugName"];
                    DR[2] = 0;
                    DR[3] = theAutoDT.Rows[0]["DrugTypeId"];
                    ExistDT.Rows.Add(DR);
                }
                else
                {
                    IQCareMsgBox.Show("DrugExists", this);
                    txtAllergen.Text = "";
                    return;
                }
                hdCustID.Value = "";
            }
        }
        else
        {
            txtAllergen.Text = "";
            hdCustID.Value   = "";
        }
    }
Exemple #18
0
    /// <summary>
    ///  Bind Dropdown Data
    /// </summary>
    private void fillSubDdlData()
    {
        BindFunctions BindManager = new BindFunctions();
        IQCareUtils   theUtils    = new IQCareUtils();
        DataTable     theDT       = new DataTable();
        DataSet       theDSXML    = new DataSet();

        theDSXML.ReadXml(MapPath("..\\XMLFiles\\AllMasters.con"));
        DataView theDV;

        txtAllergenOther.Visible = true;
        txtAllergenOther.Text    = "";
        if (ddlAllergyType.SelectedItem.Value != "207" && ddlAllergyType.SelectedItem.Value != "211" && ddlAllergyType.SelectedItem.Text != "Select")
        {
            ddlAllergen.Visible      = true;
            txtAllergen.Visible      = false;
            txtAllergen.Text         = "";
            txtAllergenOther.Visible = false;
            txtAllergenOther.Text    = "";
            if (ddlAllergyType.SelectedItem.Value == "208")
            {
                theDV           = new DataView(theDSXML.Tables["Mst_Decode"]);
                theDV.RowFilter = "DeleteFlag=0 and CodeID=208";
                if (theDV.Table != null)
                {
                    theDT = (DataTable)theUtils.CreateTableFromDataView(theDV);
                    BindManager.BindCombo(ddlAllergen, theDT, "Name", "ID");
                    theDV.Dispose();
                    theDT.Clear();
                }
            }
            else if (ddlAllergyType.SelectedItem.Value == "209")
            {
                theDV           = new DataView(theDSXML.Tables["Mst_Decode"]);
                theDV.RowFilter = "DeleteFlag=0 and CodeID=209";
                if (theDV.Table != null)
                {
                    theDT = (DataTable)theUtils.CreateTableFromDataView(theDV);
                    BindManager.BindCombo(ddlAllergen, theDT, "Name", "ID");
                    theDV.Dispose();
                    theDT.Clear();
                }
            }
        }
        else if (ddlAllergyType.SelectedItem.Value == "207")
        {
            txtAllergen.Visible      = true;
            txtAllergen.Text         = "";
            txtAllergenOther.Visible = false;
            txtAllergenOther.Text    = "";
            GetPediatricFields(Convert.ToInt32(Session["PatientId"]));
        }
    }
Exemple #19
0
    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();
        }
    }
Exemple #20
0
        private void BindEmpoyee(RadComboBox rcb)
        {
            DataSet theDS = new DataSet();

            theDS.ReadXml(MapPath("..\\..\\XMLFiles\\ALLMasters.con"));
            BindFunctions BindManager = new BindFunctions();
            IQCareUtils   theUtils    = new IQCareUtils();

            rcb.DataSource = null;
            rcb.Items.Clear();

            if (theDS.Tables["Mst_Employee"] != null)
            {
                DataView theDV = new DataView(theDS.Tables["Mst_Employee"]);
                if (Convert.ToInt32(Session["PatientVisitId"]) == 0)
                {
                    theDV.RowFilter = "DeleteFlag=0";
                    if (theDV.Table != null)
                    {
                        DataTable theDT = 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);
                            }
                        }
                        BindManager.BindCombo(rcb, theDT, "EmployeeName", "EmployeeId");
                    }
                }
                else
                {
                    if (theDV.Table != null)
                    {
                        DataTable theDT = 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);
                            }
                        }
                        BindManager.BindCombo(rcb, theDT, "EmployeeName", "EmployeeId");
                    }
                }
            }
        }
        public void BindList()
        {
            IQCareUtils   theUtils = new IQCareUtils();
            BindFunctions theBind  = new BindFunctions();
            DataView      theDV;

            theDV = new DataView((DataTable)Session["DrugData"]);
            DataTable theDT = theUtils.CreateTableFromDataView(theDV);

            if (theDT != null)
            {
                DataView theDV1 = new DataView(theDT);
                theDV1.Sort = "DrugName Asc";
                theDT       = theUtils.CreateTableFromDataView(theDV1);
            }
            if (theDT != null)
            {
                Session["DrugTable"] = theDT;
                theBind.BindList(lstDrugList, theDT, "DrugName", "drug_pk");
            }



            DataSet    thePharmacyDS = new DataSet();
            IPediatric PediatricManager;

            PediatricManager = (IPediatric)ObjectFactory.CreateInstance("BusinessProcess.Pharmacy.BPediatric, BusinessProcess.Pharmacy");
            thePharmacyDS    = PediatricManager.GetPreDefinedDruglist();
            if (thePharmacyDS.Tables[0].Rows.Count > 0)
            {
                Session["SelectedData"] = thePharmacyDS.Tables[0];
                theBind.BindList(lstSelectedDrug, thePharmacyDS.Tables[0], "DrugName", "drug_pk");
                DataTable theDT1 = (DataTable)Session["DrugTable"];
                foreach (DataRow r in thePharmacyDS.Tables[0].Rows)
                {
                    DataRow[] theDR1 = theDT1.Select("drug_pk=" + r[0].ToString());
                    if (theDR1.Length > 0)
                    {
                        theDT1.Rows.Remove(theDR1[0]);
                    }
                }
                Session["DrugTable"] = theDT1;
                lstDrugList.Items.Clear();
                theBind.BindList(lstDrugList, theDT1, "DrugName", "drug_pk");
            }
            else
            {
                Session["SelectedData"] = CreateSelectedTable();
            }
        }
    private void Init_Form()
    {
        BindFunctions BindManager      = new BindFunctions();
        IQCareUtils   theUtils         = new IQCareUtils();
        ILabFunctions LabResultManager = (ILabFunctions)ObjectFactory.CreateInstance("BusinessProcess.Laboratory.BLabFunctions, BusinessProcess.Laboratory");
        DataSet       theDSLabs;

        theDSLabs = LabResultManager.GetLabValues();
        DataTable HivTestType = theDSLabs.Tables[2];
        DataView  theDV1      = new DataView(HivTestType);

        theDV1.RowFilter = "SubTestId in (53,114)";
        HivTestType      = theUtils.CreateTableFromDataView(theDV1);
        BindManager.BindCombo(DDHIVTestType, HivTestType, "SubTestName", "SubTestId");
        DataSet theDSXML = new DataSet();

        theDSXML.ReadXml(MapPath("..\\XMLFiles\\ALLMasters.con"));
        DataView  theDV = new DataView();
        DataTable theDT = new DataTable();

        /*******/
        theDV           = new DataView(theDSXML.Tables["Mst_ModDeCode"]);
        theDV.RowFilter = "DeleteFlag=0 and CodeID=5";
        if (theDV.Table != null)
        {
            theDT = (DataTable)theUtils.CreateTableFromDataView(theDV);
            BindManager.BindCombo(DDFinalResult, theDT, "Name", "ID");
            theDV.Dispose();
            theDT.Clear();
        }
        theDV           = new DataView(theDSXML.Tables["mst_PMTCTDecode"]);
        theDV.RowFilter = "DeleteFlag=0 and CodeID=5";
        if (theDV.Table != null)
        {
            theDT = (DataTable)theUtils.CreateTableFromDataView(theDV);
            BindManager.BindCombo(DDResult, theDT, "Name", "ID");
            theDV.Dispose();
            theDT.Clear();
        }
        theDV           = new DataView(theDSXML.Tables["mst_PMTCTDecode"]);
        theDV.RowFilter = "DeleteFlag=0 and CodeID=4";
        if (theDV.Table != null)
        {
            theDT = (DataTable)theUtils.CreateTableFromDataView(theDV);
            BindManager.BindCombo(DDInfantFeedingPractice, theDT, "Name", "ID");
            theDV.Dispose();
            theDT.Clear();
        }
    }
    //{
    //    IAppointment FormManager;
    //    BindFunctions appBind;
    //    DataSet theDtSet;
    //    DataSet theDtSetPurpose;

    //    //*******Get the patient details on the basis of Patient Enrollment Id and show the details.*******//
    //    FormManager = (IAppointment)ObjectFactory.CreateInstance("BusinessProcess.Scheduler.BAppointment, BusinessProcess.Scheduler");
    //    theDtSet = FormManager.GetAppointmentReasons(idPurpose);

    //    appBind = new BindFunctions();
    //    appBind.BindCombo(ddAppPurpose, theDtSet.Tables[0], "Name", "Id");

    //    theDtSetPurpose = FormManager.GetEmployees(idEmployee);
    //    appBind = new BindFunctions();
    //    appBind.BindCombo(ddAppProvider, theDtSetPurpose.Tables[0], "EmployeeName", "EmployeeId");

    //}
    #endregion


    private void BindDropdownOrderBy(String EmployeeId)
    {
        IAppointment FormManager;

        FormManager = (IAppointment)ObjectFactory.CreateInstance("BusinessProcess.Scheduler.BAppointment, BusinessProcess.Scheduler");

        DataSet theDtSet = FormManager.GetEmployees(0);


        IQCareUtils theUtils = new IQCareUtils();


        DataView theDV = new DataView(theDtSet.Tables[0]);

        theDV.RowFilter = "DeleteFlag=0";

        if (theDV.Table != null)
        {
            DataTable theDT = (DataTable)theUtils.CreateTableFromDataView(theDV);

            if (Convert.ToInt32(Session["AppUserEmployeeId"]) > 0)
            {
                string theModList = "";
                foreach (DataRow theDR in theDT.Rows)
                {
                    if (theModList == "")
                    {
                        theModList = theDR["EmployeeId"].ToString();
                    }
                    else
                    {
                        theModList = theModList + "," + theDR["EmployeeId"].ToString();
                    }
                }



                theDV.RowFilter = "EmployeeId IN(" + Session["AppUserEmployeeId"].ToString() + "," + theModList + ")";
                if (theDV.Count > 0)
                {
                    theDT = theUtils.CreateTableFromDataView(theDV);
                }
            }
            BindFunctions BindManager = new BindFunctions();
            //BindManager.BindCombo(ddAppProvider, theDT, "EmployeeName", "EmployeeId");
            //BindUserDropdown(ddAppProvider, string.Empty);
            BindUserDropdown(ddAppProvider, Session["AppUserId"].ToString());
        }
    }
        public void BindLabList()
        {
            IQCareUtils   theUtils = new IQCareUtils();
            BindFunctions theBind  = new BindFunctions();
            DataView      theDV;

            theDV = new DataView((DataTable)Session["DrugData"]);
            DataTable theDT = theUtils.CreateTableFromDataView(theDV);

            if (theDT != null)
            {
                DataView theDV1 = new DataView(theDT);
                theDV1.Sort = "SubTestName";
                theDT       = theUtils.CreateTableFromDataView(theDV1);
            }
            if (theDT != null)
            {
                Session["DrugTable"] = theDT;
                theBind.BindList(lstDrugList, theDT, "SubTestName", "SubTestId");
            }
            DataSet       theLabDS = new DataSet();
            ILabFunctions LabManager;

            LabManager = (ILabFunctions)ObjectFactory.CreateInstance("BusinessProcess.Laboratory.BLabFunctions, BusinessProcess.Laboratory");
            theLabDS   = LabManager.GetPreDefinedLablist(Convert.ToInt32(Session["SystemId"]));

            if (theLabDS.Tables[0].Rows.Count > 0)
            {
                Session["SelectedData"] = theLabDS.Tables[0];
                theBind.BindList(lstSelectedDrug, theLabDS.Tables[0], "SubTestName", "SubTestId");
                DataTable theDT1 = (DataTable)Session["DrugTable"];
                foreach (DataRow r in theLabDS.Tables[0].Rows)
                {
                    DataRow[] theDR1 = theDT1.Select("SubTestId=" + r[1].ToString());
                    if (theDR1.Length > 0)
                    {
                        theDT1.Rows.Remove(theDR1[0]);
                    }
                }
                Session["DrugTable"] = theDT1;
                lstDrugList.Items.Clear();
                theBind.BindList(lstDrugList, theDT1, "SubTestName", "SubTestId");
            }
            else
            {
                Session["SelectedData"] = CreateLabSelectedTable();
            }
        }
    private void RegistrationCTCRemoveDrug()
    {
        try
        {
            DataRow   theDR;
            DataTable theDT = (DataTable)Session["DrugDataPtnReg"];
            theDR    = theDT.NewRow();
            theDR[0] = Convert.ToInt32(lstSelectedDrug.SelectedValue);
            theDR[1] = lstSelectedDrug.SelectedItem.Text;
            DataTable theDT1 = (DataTable)Session["SelectedData"];
            DataRow[] theDR1 = theDT1.Select("DrugId=" + lstSelectedDrug.SelectedValue);
            theDR[2] = theDR1[0][2];
            theDT.Rows.Add(theDR);
            IQCareUtils theUtils = new IQCareUtils();
            DataView    theDV    = theUtils.GridSort(theDT, "DrugName", "asc");
            theDT = theUtils.CreateTableFromDataView(theDV);
            Session.Remove("DrugDataPtnReg");
            Session["DrugDataPtnReg"] = theDT;
            lstDrugList.DataSource    = theDT;
            lstDrugList.DataBind();

            theDT1.Rows.Remove(theDR1[0]);
            Session.Remove("SelectedData");
            Session["SelectedData"]    = theDT1;
            ViewState["SelectedDrug"]  = Session["SelectedData"];
            lstSelectedDrug.DataSource = theDT1;
            lstSelectedDrug.DataBind();
        }
        catch (Exception err)
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["MessageText"] = err.Message.ToString();
            IQCareMsgBox.Show("#C1", theBuilder, this);
        }
    }
 private void CustomFormRemoveDrug(int RemoveDrgtypeID)
 {
     try
     {
         DataRow   theDR;
         DataTable theDT = (DataTable)Session["" + RemoveDrgtypeID + ""];;
         theDR    = theDT.NewRow();
         theDR[0] = Convert.ToInt32(lstSelectedDrug.SelectedValue);
         theDR[1] = lstSelectedDrug.SelectedItem.Text;
         DataTable theDT1 = (DataTable)Session["Selected" + RemoveDrgtypeID + ""];
         DataRow[] theDR1 = theDT1.Select("DrugId=" + lstSelectedDrug.SelectedValue);
         theDR[2] = theDR1[0][2];
         theDT.Rows.Add(theDR);
         IQCareUtils theUtils = new IQCareUtils();
         DataView    theDV    = theUtils.GridSort(theDT, "DrugName", "asc");
         theDT = theUtils.CreateTableFromDataView(theDV);
         Session.Remove("" + RemoveDrgtypeID + "");
         Session["" + RemoveDrgtypeID + ""] = theDT;
         lstDrugList.DataSource             = theDT;
         lstDrugList.DataBind();
         theDT1.Rows.Remove(theDR1[0]);
         if (theDT1.Rows.Count > 0)
         {
             Session["Selected" + RemoveDrgtypeID + ""] = theDT1;
         }
         lstSelectedDrug.DataSource = theDT1;
         lstSelectedDrug.DataBind();
     }
     catch (Exception err)
     {
         MsgBuilder theBuilder = new MsgBuilder();
         theBuilder.DataElements["MessageText"] = err.Message.ToString();
         IQCareMsgBox.Show("#C1", theBuilder, this);
     }
 }
    public Boolean CheckDateConstriant(int FacilityId)
    {
        DataSet theDS = new DataSet();

        theDS.ReadXml(System.Web.HttpContext.Current.Server.MapPath("..\\XMLFiles\\ALLMasters.con"));
        if (theDS.Tables["Mst_Facility"] != null)
        {
            DataView theDV = new DataView(theDS.Tables["Mst_Facility"]);
            theDV.RowFilter = "FacilityID=" + FacilityId;
            if (theDV.Table != null)
            {
                IQCareUtils iQCareUtils = new IQCareUtils();
                DataTable   theDt       = (DataTable)iQCareUtils.CreateTableFromDataView(theDV);
                if (theDt.Rows.Count > 0)
                {
                    if (theDt.Rows[0]["DateConstraint"].ToString() == "1")
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
            }
        }
        return(false);
    }
    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);
        }
    }
Exemple #29
0
    protected void BindServiceDropdown()
    {
        BindFunctions        BindManager = new BindFunctions();
        IPatientRegistration ptnMgr      = (IPatientRegistration)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientRegistration, BusinessProcess.Clinical");
        DataSet DSModules = ptnMgr.GetModuleNames(Convert.ToInt32(Session["AppLocationId"]), Convert.ToInt32(Session["AppUserId"]));

        DataTable theModDT = new DataTable();

        //if Admin user load all service areas
        if (Convert.ToString(Session["AppUserId"]) == "1")
        {
            theModDT = DSModules.Tables[0];
        }
        else
        {
            theModDT = DSModules.Tables[2];
        }

        DataView theModDV = new DataView(theModDT);

        theModDV.RowFilter = "ModuleId NOT IN(206,207,7)";
        IQCareUtils theModUtils = new IQCareUtils();
        DataTable   theDT       = new DataTable();

        theDT = theModUtils.CreateTableFromDataView(theModDV);
        if (theDT.Rows.Count > 0)
        {
            BindManager.BindCombo(ddlServices, theDT, "ModuleName", "ModuleID");
            ptnMgr = null;
        }
    }
    private void Init_Form()
    {
        lblHeader.Text = ViewState["ListName"].ToString();

        ICustomList CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");
        DataTable   theDT         = CustomManager.GetCustomList(ViewState["TableName"].ToString(), Convert.ToInt32(ViewState["CategoryId"]), Convert.ToInt32(Session["SystemId"]));

        if (ViewState["ModuleId"] != null)
        {
            if (Convert.ToInt32(ViewState["ModuleId"]) > 0 && ViewState["TableName"].ToString().ToUpper() == "DECODE")
            {
                IQCareUtils theUtilsCF = new IQCareUtils();
                DataView    theDVCF    = new DataView(theDT);
                theDVCF.RowFilter = "ModuleId in(0," + Convert.ToInt32(ViewState["ModuleId"]) + ")";
                theDT             = new DataTable();
                theDT             = (DataTable)theUtilsCF.CreateTableFromDataView(theDVCF);
            }
        }
        if (ViewState["gridSource"] == null)
        {
            ViewState["gridSource"]        = theDT;
            ViewState["gridSortDirection"] = "Desc";
        }

        grdCustom.DataSource = theDT;
        Bind_Grid();
    }