예제 #1
0
    private void Init_Page()
    {
        if (Session["AppLocation"] == null || Session.Count == 0 || Session["AppUserID"].ToString() == "")
        {
            IQCareMsgBox.Show("SessionExpired", this);
            Response.Redirect("~/frmlogin.aspx", true);
        }
        IQCareUtils theUtil = new IQCareUtils();
        DataTable   theDT   = theUtil.CreateTimeTable(15);
        DataRow     theDR   = theDT.NewRow();

        theDR[0] = "0";
        theDR[1] = "Select";
        theDT.Rows.InsertAt(theDR, 0);
        ddBackupTime.DataSource     = theDT;
        ddBackupTime.DataTextField  = "Time";
        ddBackupTime.DataValueField = "Id";
        ddBackupTime.DataBind();
        ddBackupDrive.SelectedValue = "Select";

        IFacilitySetup BackupManger = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");

        theDT = BackupManger.GetBackupSetup();
        if (theDT.Rows[0].IsNull("BackupTime") != true)
        {
            ddBackupTime.SelectedValue = ((DateTime)theDT.Rows[0]["BackupTime"]).TimeOfDay.ToString();
        }

        ddBackupDrive.SelectedValue = theDT.Rows[0]["BackupDrive"].ToString();
    }
        protected void cmdSave_Click(object sender, EventArgs e)
        {
            try
            {
                IQCareUtils theUtils = new IQCareUtils();
                DateTime    theTime;
                if (ddBackupTime.SelectedValue != "0")
                {
                    theTime = Convert.ToDateTime(ddBackupTime.SelectedItem.ToString());
                }
                else
                {
                    theTime = Convert.ToDateTime("1900-01-01");
                }

                IFacilitySetup BackupManger = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");
                int            noRows       = BackupManger.SaveBackupSetup(ddBackupDrive.SelectedItem.ToString(), theTime);
                BackupManger = null;
                IQCareMsgBox.Show("BackupSetupSave", this);
            }
            catch (Exception err)
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["MessageText"] = err.Message.ToString();
                IQCareMsgBox.Show("#C1", theBuilder, this);
            }
        }
예제 #3
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");
        }
        private void Init_Page()
        {
            IQCareUtils theUtil = new IQCareUtils();
            DataTable   theDT   = theUtil.CreateTimeTable(15);
            DataRow     theDR   = theDT.NewRow();

            theDR[0] = "0";
            theDR[1] = "Select";
            theDT.Rows.InsertAt(theDR, 0);
            ddBackupTime.DataSource     = theDT;
            ddBackupTime.DataTextField  = "Time";
            ddBackupTime.DataValueField = "Id";
            ddBackupTime.DataBind();
            ddBackupDrive.SelectedValue = "Select";

            IFacilitySetup BackupManger = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");

            theDT = BackupManger.GetBackupSetup();
            if (theDT.Rows[0].IsNull("BackupTime") != true)
            {
                ddBackupTime.SelectedValue = ((DateTime)theDT.Rows[0]["BackupTime"]).TimeOfDay.ToString();
            }

            ddBackupDrive.SelectedValue = theDT.Rows[0]["BackupDrive"].ToString();
        }
예제 #5
0
    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");
    }
예제 #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //(Master.FindControl("lblRoot") as Label).Text = "Clinical Forms >>";
        //(Master.FindControl("lblMark") as Label).Visible = false;
        //(Master.FindControl("lblheader") as Label).Text = "Location Transfer";
        //(Master.FindControl("lblformname") as Label).Text = "Patient Transfer";
        (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Text     = "Clinical Forms >> ";
        (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text   = "Location Transfer";
        (Master.FindControl("levelTwoNavigationUserControl1").FindControl("lblformname") as Label).Text = "Patient Transfer";


        txtTransferDate.Attributes.Add("onkeyup", "DateFormat(this,this.value,event,false,'3')");
        txtTransferDate.Attributes.Add("OnBlur", "DateFormat(this,this.value,event,true,'3')");
        TxtTransDateEdit.Attributes.Add("onkeyup", "DateFormat(this,this.value,event,false,'3')");
        TxtTransDateEdit.Attributes.Add("OnBlur", "DateFormat(this,this.value,event,true,'3')");

        //PatientId = Request.QueryString["PatientId"].ToString();
        PatientId = Convert.ToString(Session["PatientId"]);

        BtnUpdate = Request.QueryString["name"].ToString();
        //(Master.FindControl("lblpntStatus") as Label).Text = Session["AppStatus"].ToString();

        if (Request.QueryString["sts"].ToString() == "1")

        {
            btnSave.Enabled = false;
        }
        AuthenticationManager Authentiaction = new AuthenticationManager();

        if (Authentiaction.HasFunctionRight(ApplicationAccess.Transfer, FunctionAccess.Print, (DataTable)Session["UserRight"]) == false)
        {
            btnPrint.Enabled = false;
        }
        if (BtnUpdate == "Edit")
        {
            tredit.Visible       = true;
            tradd.Visible        = false;
            btnSave.Text         = "Update";
            TransferId           = Request.QueryString["TransferId"].ToString();
            ViewState["RegDate"] = Request.QueryString["RegDate"].ToString();
        }
        if (!IsPostBack)
        {
            IFacilitySetup FacilityMaster = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");
            theFacilityDS           = FacilityMaster.GetSystemBasedLabels(Convert.ToInt32(Session["SystemId"]), 56, 0);
            ViewState["FacilityDS"] = theFacilityDS;
            SetPageLabels();

            ViewState["SortDirection"] = "Desc";
            ViewState["Sorted"]        = "";
            ViewState["Save"]          = null;
            BindTransferDetail();
            BindGrid();
            //SaveUpdateMsg();
        }
    }
예제 #7
0
    private void Init_Form()
    {
        AuthenticationManager Authentication = new AuthenticationManager();
        IFacilitySetup        FacilityMaster = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");

        theFacilityDS              = FacilityMaster.GetFacilityList(Convert.ToInt32(Session["SystemId"]), ApplicationAccess.FacilitySetup, 0);
        ViewState["FacilityDS"]    = theFacilityDS;
        ViewState["grdDataSource"] = theFacilityDS.Tables[0];
        ViewState["SortDirection"] = "Asc";
        BindGrid(theFacilityDS.Tables[0]);
    }
    private void BindHeader()
    {
        DataSet theFacilityDS = new DataSet();
        AuthenticationManager Authentication = new AuthenticationManager();
        IFacilitySetup        FacilityMaster = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");

        theFacilityDS = FacilityMaster.GetSystemBasedLabels(Convert.ToInt32(Session["SystemId"]), ApplicationAccess.SchedularAppointment, 0);

        DataTable theDT = theFacilityDS.Tables[0];

        ViewState["grdDataSource"] = theFacilityDS.Tables[0];
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["AppLocation"] == null || Session.Count == 0 || Session["AppUserID"].ToString() == "")
        {
            IQCareMsgBox.Show("SessionExpired", this);
            Response.Redirect("~/frmlogin.aspx", true);
        }
        (Master.FindControl("levelTwoNavigationUserControl1").FindControl("lblpntStatus") as Label).Text = Session["lblpntstatus"].ToString();

        (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Visible  = false;
        (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text   = "Patient Classification";
        (Master.FindControl("levelTwoNavigationUserControl1").FindControl("lblformname") as Label).Text = "Patient Classification";
        IFacilitySetup FacilityMaster = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");

        txtdate.Attributes.Add("onkeyup", "DateFormat(this,this.value,event,false,'3')");
        txtdate.Attributes.Add("OnBlur", "DateFormat(this,this.value,event,true,'3')");
        if (Authentiaction.HasFunctionRight(ApplicationAccess.PatientClassification, FunctionAccess.Print, (DataTable)Session["UserRight"]) == false)
        {
            btnPrint.Enabled = false;
        }
        if (!IsPostBack)
        {
            if (Request.QueryString["name"] == "Add")
            {
                //Session["PtnRedirect"] = Convert.ToInt32(Request.QueryString["PatientId"]);
                Boolean blnRightfind = false;
                if (Authentiaction.HasFunctionRight(ApplicationAccess.PatientClassification, FunctionAccess.View, (DataTable)Session["UserRight"]) == false)
                {
                    string theUrl = string.Empty;
                    theUrl = string.Format("../ClinicalForms/frmPatient_Home.aspx?");
                    Response.Redirect(theUrl);
                }
                else if (Authentiaction.HasFunctionRight(ApplicationAccess.PatientClassification, FunctionAccess.Add, (DataTable)Session["UserRight"]) == false)
                {
                    blnRightfind    = true;
                    btnadd.Enabled  = false;
                    btnsave.Enabled = false;
                }
            }

            if (Session["lblpntstatus"].ToString() == "1")
            {
                btnadd.Enabled  = false;
                btnsave.Enabled = false;
            }
            Session["SelectedId"]  = "";
            Session["SelectedRow"] = -1;// index of row selected for editing from grid
            Session["RemoveFlag"]  = "False";
            Session["Ptn_Pk"]      = Convert.ToInt32(Session["PtnRedirect"].ToString());
            BindClassification();
            GetAllData();
        }
    }
예제 #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["AppLocation"] == null || Session.Count == 0 || Session["AppUserID"].ToString() == "")
        {
            IQCareMsgBox.Show("SessionExpired", this);
            Response.Redirect("~/frmlogin.aspx", true);
        }

        txtTransferDate.Attributes.Add("onkeyup", "DateFormat(this,this.value,event,false,'3')");
        txtTransferDate.Attributes.Add("OnBlur", "DateFormat(this,this.value,event,true,'3')");
        TxtTransDateEdit.Attributes.Add("onkeyup", "DateFormat(this,this.value,event,false,'3')");
        TxtTransDateEdit.Attributes.Add("OnBlur", "DateFormat(this,this.value,event,true,'3')");

        PatientId = Convert.ToString(Session["PatientId"]);

        BtnUpdate = Request.QueryString["name"].ToString();
        //(Master.FindControl("lblpntStatus") as Label).Text = Session["AppStatus"].ToString();
        if (!object.Equals(Request.QueryString["sts"], null))
        {
            if (Request.QueryString["sts"].ToString() == "1")
            {
                btnSave.Enabled = false;
            }
        }
        AuthenticationManager Authentiaction = new AuthenticationManager();

        if (Authentiaction.HasFunctionRight(ApplicationAccess.Transfer, FunctionAccess.Print, (DataTable)Session["UserRight"]) == false)
        {
            btnPrint.Enabled = false;
        }
        if (BtnUpdate == "Edit")
        {
            tredit.Visible       = true;
            tradd.Visible        = false;
            btnSave.Text         = "Update";
            TransferId           = Request.QueryString["TransferId"].ToString();
            ViewState["RegDate"] = Request.QueryString["RegDate"].ToString();
        }
        if (!IsPostBack)
        {
            IFacilitySetup FacilityMaster = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");
            theFacilityDS           = FacilityMaster.GetSystemBasedLabels(Convert.ToInt32(Session["SystemId"]), 56, 0);
            ViewState["FacilityDS"] = theFacilityDS;
            SetPageLabels();

            ViewState["SortDirection"] = "Desc";
            ViewState["Sorted"]        = "";
            ViewState["Save"]          = null;
            BindTransferDetail();
            BindGrid();
        }
    }
예제 #11
0
    private void Init_Page()
    {
        if (Session["AppLocation"] == null || Session.Count == 0 || Session["AppUserID"].ToString() == "")
        {
            IQCareMsgBox.Show("SessionExpired", this);
            Response.Redirect("~/frmlogin.aspx", true);
        }
        AuthenticationManager Authentication = new AuthenticationManager();
        IFacilitySetup        FacilityMaster = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");

        theFacilityDS              = FacilityMaster.GetSystemBasedLabels(Convert.ToInt32(Session["SystemId"]), 999, 0);
        ViewState["FacilityDS"]    = theFacilityDS;
        ViewState["grdDataSource"] = theFacilityDS.Tables[0];
        ViewState["SortDirection"] = "Asc";
        BindGrid();
        SetPageLabels();


        txtDOB.Value             = "";
        txtfirstname.Text        = "";
        txtmiddlename.Text       = "";
        txtlastname.Text         = "";
        txtidentificationno.Text = string.Empty;

        if (Request.QueryString["mnuClicked"] != null)
        {
            if (Request.QueryString["mnuClicked"] != "DeletePatient")
            {
                ddSex.SelectedValue = "0";
            }
        }
        if (Session["TechnicalAreaId"] == null)
        {
            Session["TechnicalAreaId"] = 0;
        }
        BindIdentifierDropdown(Session["TechnicalAreaId"].ToString());
        BindServiceDropdown();
        IUser theLocationManager;

        theLocationManager = (IUser)ObjectFactory.CreateInstance("BusinessProcess.Security.BUser, BusinessProcess.Security");
        DataTable theDT = theLocationManager.GetFacilityList();
        DataRow   theDR = theDT.NewRow();

        theDR["FacilityName"] = "All";
        theDR["FacilityId"]   = 9999;
        theDT.Rows.InsertAt(theDR, 0);
        BindFunctions theBindManger = new BindFunctions();

        theBindManger.BindCombo(ddFacility, theDT, "FacilityName", "FacilityId");
        ddFacility.SelectedValue = Convert.ToString(Session["AppLocationId"]);
    }
예제 #12
0
    private void BindHeader()
    {
        DataSet theFacilityDS = new DataSet();
        AuthenticationManager Authentication = new AuthenticationManager();
        IFacilitySetup        FacilityMaster = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");

        if (Session["SystemId"].ToString() == "1")
        {
            theFacilityDS = FacilityMaster.GetSystemBasedLabels(Convert.ToInt32(Session["SystemId"]), ApplicationAccess.Allergy, 0);
        }
        else if (Session["SystemId"].ToString() == "2")
        {
            theFacilityDS = FacilityMaster.GetSystemBasedLabels(Convert.ToInt32(Session["SystemId"]), ApplicationAccess.Allergy, 0);
        }
        ViewState["grdDataSource"] = theFacilityDS.Tables[0];
    }
예제 #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Session["PatientId"] = 0;
            //(Master.FindControl("lblheaderfacility") as Label).Visible = false;
            //(Master.FindControl("lblheader") as Label).Text = "Back up/Restore";
            (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Visible = false;
            (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text  = "Back up/Restore";



            if (IsPostBack == false)
            {
                txtbakuppath.Text = Session["BackupDrive"].ToString() + "\\IQCareDBBackup";
                txtbakuppath.Attributes.Add("readonly", "true");
                IQCareUtils theUtil = new IQCareUtils();
                DataTable   theDT   = theUtil.CreateTimeTable(15);
                DataRow     theDR   = theDT.NewRow();
                theDR[0] = "0";
                theDR[1] = "Select";
                theDT.Rows.InsertAt(theDR, 0);
                ddBackupTime.DataSource     = theDT;
                ddBackupTime.DataTextField  = "Time";
                ddBackupTime.DataValueField = "Id";
                ddBackupTime.DataBind();
                ddBackupDrive.SelectedValue = "Select";

                IFacilitySetup BackupManger = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");
                theDT = BackupManger.GetBackupSetup();
                if (theDT.Rows[0].IsNull("BackupTime") != true)
                {
                    ddBackupTime.SelectedValue = ((DateTime)theDT.Rows[0]["BackupTime"]).TimeOfDay.ToString();
                }
                if (theDT.Rows[0].IsNull("BackupDrive") != true)
                {
                    txtbakuppath.Text           = theDT.Rows[0]["BackupDrive"].ToString() + "\\IQCareDBBackup";
                    ddBackupDrive.SelectedValue = theDT.Rows[0]["BackupDrive"].ToString();
                }
            }
            if (Application["BackupSetFile"] != null)
            {
                txtRestore.Text          = Application["BackupSetFile"].ToString();
                ViewState["BkpPosition"] = Application["Position"].ToString();
                //chkDeidentified.Checked = false;
                Application.Remove("BackupSetFile");
                Application.Remove("Position");
            }
        }
예제 #14
0
        protected void cmdSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (showSetup == "")
                {
                    IQCareUtils theUtils = new IQCareUtils();
                    DateTime    theTime;
                    string      timeStr  = Request.Form[ddBackupTime.UniqueID].ToString();
                    string      driveStr = Request.Form[ddBackupDrive.UniqueID].ToString();

                    if (timeStr != "0" || timeStr != "")
                    {
                        theTime = Convert.ToDateTime(timeStr);
                    }
                    else
                    {
                        theTime = Convert.ToDateTime("1900-01-01");
                    }
                    Session["BackupDrive"] = driveStr;
                    IFacilitySetup BackupManger = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");
                    int            noRows       = BackupManger.SaveBackupSetup(driveStr, theTime);
                    BackupManger = null;
                    //IQCareMsgBox.Show("BackupSetupSave", this);
                    IQCareMsgBox.NotifyAction("Backup Setup Updated Successfully", "Database Backup Setup", false, this, "window.location.href='../AdminForms/frmDBBackup.aspx'");
                }
                else
                {
                    IQCareMsgBox.NotifyAction("Your are not authorized to setup database backup", "Database Backup Setup", true, this, "");
                    HttpContext.Current.ApplicationInstance.CompleteRequest();
                    Response.Redirect("~/frmLogOff.aspx", false);
                }
            }
            catch (Exception err)
            {
                //MsgBuilder theBuilder = new MsgBuilder();
                //theBuilder.DataElements["MessageText"] = err.Message.ToString();
                //IQCareMsgBox.Show("#C1", theBuilder, this);
                IQCareMsgBox.NotifyAction(err.Message, "Database Backup Setup", true, this, "");
            }
        }
예제 #15
0
    private void Init_Page()
    {
        AuthenticationManager Authentication = new AuthenticationManager();
        IFacilitySetup        FacilityMaster = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");

        theFacilityDS              = FacilityMaster.GetSystemBasedLabels(Convert.ToInt32(Session["SystemId"]), 999, 0);
        ViewState["FacilityDS"]    = theFacilityDS;
        ViewState["grdDataSource"] = theFacilityDS.Tables[0];
        ViewState["SortDirection"] = "Asc";
        BindGrid();
        SetPageLabels();


        txtDOB.Text        = "";
        txtfirstname.Text  = "";
        txtmiddlename.Text = "";
        txtlastname.Text   = "";

        if (Request.QueryString["mnuClicked"] != null)
        {
            if (Request.QueryString["mnuClicked"] != "DeletePatient")
            {
                ddSex.SelectedValue = "0";
            }
        }

        IUser theLocationManager;

        theLocationManager = (IUser)ObjectFactory.CreateInstance("BusinessProcess.Security.BUser, BusinessProcess.Security");
        DataTable theDT = theLocationManager.GetFacilityList();
        DataRow   theDR = theDT.NewRow();

        theDR["FacilityName"] = "All";
        theDR["FacilityId"]   = 9999;
        theDT.Rows.InsertAt(theDR, 0);
        BindFunctions theBindManger = new BindFunctions();

        theBindManger.BindCombo(ddFacility, theDT, "FacilityName", "FacilityId");
        ddFacility.SelectedValue = Convert.ToString(Session["AppLocationId"]);
        BindServiceDropdown();
    }
    private void BindGrid()
    {
        string  filePath        = Server.MapPath("~/XMLFiles/customizelist.xml");
        DataSet dscustomiseList = new DataSet();

        dscustomiseList.ReadXml(filePath);

        DataView       theDV           = new DataView(dscustomiseList.Tables[0]);
        DataTable      theXMLDT        = new DataTable();
        IFacilitySetup FacilityManager = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");
        DataSet        theDSFacility   = FacilityManager.GetModuleName();
        DataTable      theDTPubModule  = (DataTable)Session["AppModule"];
        DataTable      theDTModule     = theDSFacility.Tables[1];

        string theModList = "";

        foreach (DataRow theDR in theDTModule.Rows)
        {
            if (theModList == "")
            {
                theModList = theDR["ModuleId"].ToString();
            }
            else
            {
                theModList = theModList + "," + theDR["ModuleId"].ToString();
            }
        }
        IQCareUtils theUtil = new IQCareUtils();

        theDV.RowFilter = "ModuleId in (0," + theModList + ")";
        if (theDV.Count > 0)
        {
            theDV.RowFilter = "(SystemId=" + Session["SystemId"].ToString() + " or SystemId=0)";
            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);
        }
        //////DataTable theDTPmtct = CustomManager.GetCustomFieldListPMTCT();
        //////if (theDTPmtct != null && theDTPmtct.Rows.Count > 0)
        //////{
        //////    theXMLDT.Merge(theDTPmtct);
        //////    theXMLDT.AcceptChanges();
        //////}

        #region "ParentNode"
        TreeNode root = new TreeNode();
        TreeNode theChildRoot;
        TreeNode theMRoot;
        tvcustomlist.LeafNodeStyle.Font.Underline = true;
        tvcustomlist.LeafNodeStyle.ForeColor      = System.Drawing.Color.Blue;
        bool   flag     = true;
        bool   flagroot = true;
        string stralpha = string.Empty;
        AuthenticationManager Authentication = new AuthenticationManager();
        root.Text = "List";
        if (flagroot)
        {
            root.Expand();
            flagroot = false;
        }
        else
        {
            root.Collapse();
        }
        tvcustomlist.Nodes.Add(root);
        #endregion

        #region "Universal Node"
        theMRoot        = new TreeNode();
        theMRoot.Text   = "Universal";
        theMRoot.Value  = "0";
        theMRoot.Target = "_blank";
        theMRoot.Expand();
        root.ChildNodes.Add(theMRoot);

        theDV           = new DataView(theXMLDT);
        theDV.RowFilter = "ModuleId = 0";
        theDV.Sort      = "ListName asc";
        DataTable objTable = theDV.ToTable();
        foreach (DataRow theUniDR in objTable.Rows)
        {
            string url = string.Empty;
            theChildRoot      = new TreeNode();
            theChildRoot.Text = theUniDR["ListName"].ToString();

            theChildRoot.Target = "";
            if ((theUniDR["FeatureID"].ToString() != "0") && (Authentication.HasFeatureRight(Convert.ToInt32(theUniDR["FeatureID"].ToString()), theXMLDT) == false))
            {
                theChildRoot.ImageUrl     = "~/Images/lock.jpg";
                theChildRoot.ImageToolTip = "You are Not Authorized to Access this Functionality";
                theChildRoot.SelectAction = TreeNodeSelectAction.None;
            }
            else
            {
                //url = string.Format("{0}?TableName={1}&CategoryId={2}&LstName={3}&Fid={4}&Upd={5}&CCID={6}", theUniDR["FormName"].ToString(), theUniDR["TableName"].ToString(), theUniDR["CategoryId"].ToString(), theUniDR["ListName"].ToString(), theUniDR["FeatureID"].ToString(), theUniDR["Update"].ToString(), theUniDR["CountryID"].ToString());
                url = string.Format("{0}?TableName={1}&CategoryId={2}&LstName={3}&Fid={4}&Upd={5}&CCID={6}&ModId={7}", theUniDR["FormName"].ToString(), theUniDR["TableName"].ToString(), theUniDR["CategoryId"].ToString(), theUniDR["ListName"].ToString(), theUniDR["FeatureID"].ToString(), theUniDR["Update"].ToString(), theUniDR["CountryID"].ToString(), "0");
                theChildRoot.NavigateUrl = url;
            }
            theMRoot.ChildNodes.Add(theChildRoot);
        }


        #endregion

        #region "Module Nodes"
        //////////////////////////////////////////////////////////////////////
        string    thePubModList = "";
        DataTable objPubTable;
        foreach (DataRow thepubDR in theDTPubModule.Rows)
        {
            if (thePubModList == "")
            {
                thePubModList = thepubDR["ModuleId"].ToString();
            }
            else
            {
                thePubModList = thePubModList + "," + thepubDR["ModuleId"].ToString();
            }
        }
        DataView thepubDV = new DataView(theXMLDT);
        thepubDV.RowFilter = "ModuleId in(" + thePubModList.ToString() + ")";
        thepubDV.Sort      = "ListName asc";
        objPubTable        = thepubDV.ToTable();
        ////////////////////////////////////////////////////////////
        foreach (DataRow theModRow in theDTModule.Rows)
        {
            theDV           = new DataView(theXMLDT);
            theDV.RowFilter = "ModuleId =" + theModRow["ModuleId"].ToString();
            theDV.Sort      = "ListName asc";
            objTable        = theDV.ToTable();

            if (objTable.Rows.Count > 0)
            {
                theMRoot        = new TreeNode();
                theMRoot.Text   = theModRow["ModuleName"].ToString();
                theMRoot.Value  = theModRow["ModuleId"].ToString();
                theMRoot.Target = "_blank";
                root.ChildNodes.Add(theMRoot);

                foreach (DataRow theUniDR in objTable.Rows)
                {
                    string url = string.Empty;
                    theChildRoot      = new TreeNode();
                    theChildRoot.Text = theUniDR["ListName"].ToString();

                    theChildRoot.Target = "";

                    if ((theUniDR["ModuleID"].ToString() != "0") && (Authentication.HasModuleRight(Convert.ToInt32(theUniDR["ModuleID"].ToString()), objPubTable) == false))
                    {
                        theChildRoot.ImageUrl     = "~/Images/lock.jpg";
                        theChildRoot.ImageToolTip = "You are Not Authorized to Access this Functionality";
                        theChildRoot.SelectAction = TreeNodeSelectAction.None;
                    }
                    else
                    {
                        //url = string.Format("{0}?TableName={1}&CategoryId={2}&LstName={3}&Fid={4}&Upd={5}&CCID={6}", theUniDR["FormName"].ToString(), theUniDR["TableName"].ToString(), theUniDR["CategoryId"].ToString(), theUniDR["ListName"].ToString(), theUniDR["FeatureID"].ToString(), theUniDR["Update"].ToString(), theUniDR["CountryID"].ToString());
                        url = string.Format("{0}?TableName={1}&CategoryId={2}&LstName={3}&Fid={4}&Upd={5}&CCID={6}&ModId={7}", theUniDR["FormName"].ToString(), theUniDR["TableName"].ToString(), theUniDR["CategoryId"].ToString(), theUniDR["ListName"].ToString(), theUniDR["FeatureID"].ToString(), theUniDR["Update"].ToString(), theUniDR["CountryID"].ToString(), theUniDR["ModuleID"].ToString());
                        theChildRoot.NavigateUrl = url;
                    }
                    theMRoot.ChildNodes.Add(theChildRoot);
                }
            }
        }
        #endregion

        ////ArrayList myData = new ArrayList();
        ////myData.Add("hello world");
        ////Session["AppModule"] = myData; //Add the data to session.
        ////ArrayList myDataRetrieved = (ArrayList)Session["AppModule"];

        ////IQCareUtils theUtil = new IQCareUtils();
        ////DataSet dscustomiseList;
        ////string[] arr = new string[100];
        ////arr.SetValue("Universal", 0);
        ////foreach (DataRow theDR in ((DataTable)Session["AppModule"]).Rows)
        ////{
        ////    arr.SetValue(theDR["ModuleName"].ToString(), Convert.ToInt32(theDR["ModuleId"]));
        ////}

        ////string filePath = Server.MapPath("~/XMLFiles/customizelist.xml");
        ////dscustomiseList = new DataSet();
        ////dscustomiseList.ReadXml(filePath);

        ////////
        ////dscustomiseList.WriteXmlSchema("c:\\testxml1.xml");
        ///////

        ////DataView theDV = new DataView(dscustomiseList.Tables[0]);
        ////DataTable theXMLDT = new DataTable();
        ////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();
        ////}
        ////DataTable dt = theDV.ToTable();
        ////theDV.Sort = "ModuleId asc,Listname asc";
        ////theDV.RowFilter = "ModuleId in (0," + theModList + ")";
        ////if (theDV.Count > 0)
        ////{
        ////    theDV.RowFilter = "(SystemId=" + Session["SystemId"].ToString() + " or SystemId=0)";
        ////    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);
        ////}
        ////DataTable theDTPmtct = CustomManager.GetCustomFieldListPMTCT();
        ////if (theDTPmtct != null && theDTPmtct.Rows.Count > 0)
        ////{
        ////    theXMLDT.Merge(theDTPmtct);
        ////}

        ////theDV = new DataView(theXMLDT);
        ////theDV.Sort = "ModuleId asc,Listname asc";
        ////DataTable objTable = new DataTable();
        ////objTable = theDV.ToTable();
        ////TreeNode root = new TreeNode();
        ////TreeNode theChileRoot = new TreeNode();
        ////TreeNode theMRoot = new TreeNode();
        ////tvcustomlist.LeafNodeStyle.Font.Underline = true;
        ////tvcustomlist.LeafNodeStyle.ForeColor = System.Drawing.Color.Blue;
        ////bool flag = true;
        ////bool flagroot = true;
        ////string stralpha = string.Empty;
        ////AuthenticationManager Authentication = new AuthenticationManager();
        ////root.Text = "List";
        ////if (flagroot)
        ////{
        ////    root.Expand();
        ////    flagroot = false;
        ////}
        ////else
        ////{
        ////    root.Collapse();
        ////}
        ////tvcustomlist.Nodes.Add(root);

        ////foreach (DataRow theDR in objTable.Rows)
        ////{
        ////    if (stralpha != theDR["ModuleId"].ToString())
        ////    {
        ////        theChileRoot = new TreeNode();
        ////        theChileRoot.Text = arr[Convert.ToInt32(theDR["ModuleId"])];
        ////        theChileRoot.Target = "_blank";

        ////        if (flag)
        ////        {
        ////            theChileRoot.Expand();
        ////            flag = false;
        ////        }
        ////        else
        ////        {
        ////            theChileRoot.Collapse();
        ////        }
        ////        root.ChildNodes.Add(theChileRoot);
        ////        stralpha = theDR["ModuleId"].ToString();
        ////    }
        ////    if (stralpha == theDR["ModuleId"].ToString())
        ////    {
        ////        string url = string.Empty;
        ////        theMRoot = new TreeNode();
        ////        theMRoot.Text = theDR["ListName"].ToString();

        ////        theMRoot.Target = "";
        ////        if ((theDR["FeatureID"].ToString() != "0") && (Authentication.HasFeatureRight(Convert.ToInt32(theDR["FeatureID"].ToString()), dt) == false))
        ////        {
        ////            theMRoot.ImageUrl = "~/Images/lock.jpg";
        ////            theMRoot.ImageToolTip = "You are Not Authorized to Access this Functionality";
        ////            theMRoot.SelectAction = TreeNodeSelectAction.None;
        ////        }
        ////        else
        ////        {
        ////            url = string.Format("{0}?TableName={1}&CategoryId={2}&LstName={3}&Fid={4}&Upd={5}&CCID={6}", theDR["FormName"].ToString(), theDR["TableName"].ToString(), theDR["CategoryId"].ToString(), theDR["ListName"].ToString(), theDR["FeatureID"].ToString(), theDR["Update"].ToString(), theDR["CountryID"].ToString());
        ////            theMRoot.NavigateUrl = url;
        ////        }
        ////        theChileRoot.ChildNodes.Add(theMRoot);
        ////    }
        ////}
    }
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (CurrentSession.Current == null || Session["PatientId"] == null || Session["TechnicalAreaId"] == null)
            {
                HttpContext.Current.ApplicationInstance.CompleteRequest();
                Response.Redirect("~/frmLogin.aspx", true);
            }

            if (!IsPostBack)
            {
                IFacilitySetup FacilityMaster = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");
                DataSet        objDs          = new DataSet();
                (Master.FindControl("levelTwoNavigationUserControl1").FindControl("lblpntStatus") as Label).Text = Session["lblpntstatus"].ToString();

                (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Visible  = false;
                (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text   = "Follow-up Education";
                (Master.FindControl("levelTwoNavigationUserControl1").FindControl("lblformname") as Label).Text = "Follow-up Education";
                if (Authentication.HasFunctionRight(ApplicationAccess.FollowupEducation, FunctionAccess.Print, (DataTable)Session["UserRight"]) == false)
                {
                    btnPrint.Enabled = false;
                }
                if (Request.QueryString["name"] == "Add")
                {
                    //Session["PtnRedirect"] = Convert.ToInt32(Request.QueryString["PatientId"]);
                    bool blnRightfind = false;
                    if (Authentication.HasFunctionRight(ApplicationAccess.FollowupEducation, FunctionAccess.View, (DataTable)Session["UserRight"]) == false)
                    {
                        string theUrl = string.Empty;
                        theUrl = string.Format("../ClinicalForms/frmPatient_Home.aspx?PatientId=" + this.PatientId.ToString());
                        Response.Redirect(theUrl);
                    }
                    else if (Authentication.HasFunctionRight(ApplicationAccess.FollowupEducation, FunctionAccess.Add, (DataTable)Session["UserRight"]) == false)
                    {
                        blnRightfind        = true;
                        btnaddtopic.Enabled = false;
                        btnsave.Enabled     = false;
                    }
                    else if (Authentication.HasFunctionRight(ApplicationAccess.FollowupEducation, FunctionAccess.Update, (DataTable)Session["UserRight"]) == false)
                    {
                        if (!blnRightfind)
                        {
                            btnsave.Enabled     = true;
                            btnaddtopic.Enabled = true;
                        }
                    }
                }

                txtvisitdate.Attributes.Add("onkeyup", "DateFormat(this,this.value,event,false,'3')");
                txtvisitdate.Attributes.Add("OnBlur", "DateFormat(this,this.value,event,true,'3')");

                Session["SaveFlag"]    = "Add"; // "Edit"
                Session["SelectedId"]  = "";
                Session["SelectedRow"] = -1;    // index of row selected for editing from grid
                Session["RemoveFlag"]  = "False";
                //Session["Ptn_Pk"] = Convert.ToInt32(Request.QueryString["PatientId"]);
                BindCouncellingType();
                GetAllData();

                if (Session["lblpntstatus"].ToString() == "1")
                {
                    btnaddtopic.Enabled = false;
                    btnsave.Enabled     = false;
                }
                else
                {
                    btnaddtopic.Enabled = true;
                }
            }
        }
예제 #18
0
    //private void BindCombo()
    //{
    //    IQCareUtils theUtil = new IQCareUtils();
    //    DataTable theDT = theUtil.CreateTimeTable(15);
    //    DataRow theDR = theDT.NewRow();
    //    theDR[0] = "0";
    //    theDR[1] = "Select";
    //    theDT.Rows.InsertAt(theDR, 0);
    //    ddBackupTime.DataSource = theDT;
    //    ddBackupTime.DataTextField = "Time";
    //    ddBackupTime.DataValueField = "Id";
    //    ddBackupTime.DataBind();
    //}

    private void Fill_Details()
    {
        string script;

        /*-------------------Dynamic Label Settings----------------------*/
        //DataTable theDT = ((DataSet)ViewState["FacilityDS"]).Tables[1];
        theFacilityDS = new DataSet();
        AuthenticationManager Authentication = new AuthenticationManager();
        IFacilitySetup        FacilityMaster = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");

        theFacilityDS = FacilityMaster.GetFacilityList(Convert.ToInt32(Session["SystemId"]), ApplicationAccess.FacilitySetup, 0);

        DataTable theDT = theFacilityDS.Tables[1];

        //lblCountry.InnerText = theDT.Rows[0]["Label"].ToString() + ":";
        lblPOS.InnerText       = theDT.Rows[1]["Label"].ToString() + ":";
        lblSatellite.InnerText = theDT.Rows[2]["Label"].ToString() + ":";
        /*---------------------------------------------------------------*/

        if (Convert.ToInt32(ViewState["FacilityId"]) > 0)
        {
            DataView theDV = new DataView(((DataSet)ViewState["FacilityDS"]).Tables[0]);
            theDV.RowFilter      = "FacilityId=" + ViewState["FacilityId"].ToString();
            txtfacilityname.Text = theDV[0]["FacilityName"].ToString();

            txtLPTF.Text            = theDV[0]["PosId"].ToString();
            txtSatelliteID.Text     = theDV[0]["SatelliteId"].ToString();
            txtNationalId.Text      = theDV[0]["NationalId"].ToString();
            txtGrace.Text           = theDV[0]["AppGracePeriod"].ToString();
            ddCountry.SelectedValue = theDV[0]["CountryId"].ToString();
            //txtcountryno.Text = theDV[0]["CountryId"].ToString();
            ddlprovince.SelectedValue = theDV[0]["provinceId"].ToString();
            ddldistrict.SelectedValue = theDV[0]["DistrictId"].ToString();

            if (theDV[0]["PepFarStartDate"].ToString() != "")
            {
                txtPEPFAR_Fund.Value = ((DateTime)theDV[0]["PepFarStartDate"]).ToString(Session["AppDateFormat"].ToString());
            }
            cmbCurrency.SelectedValue = theDV[0]["Currency"].ToString();
            if (theDV[0]["Status"].ToString() == "Active")
            {
                ddStatus.SelectedValue = "0";
            }
            else if (theDV[0]["Status"].ToString() == "In-Active")
            {
                ddStatus.SelectedValue = "1";
            }
            if (theDV[0]["Preferred"].ToString() == "Yes")
            {
                chkPreferred.Checked = true;
            }
            else
            {
                chkPreferred.Checked = false;
            }

            if (theDV[0]["Paperless"].ToString() == "Yes")
            {
                chkPaperlessclinic.Checked = true;
                ViewState["Paperless"]     = "1";
            }
            else
            {
                chkPaperlessclinic.Checked = false;
                ViewState["Paperless"]     = "0";
            }
            if (theDV[0]["StrongPassFlag"].ToString() == "1")
            {
                chkStrongPwd.Checked = true;
            }
            else
            {
                chkStrongPwd.Checked = false;
            }
            if (theDV[0]["ExpPwdFlag"].ToString() == "1")
            {
                chkexpPwd.Checked = true;
                script            = "";
                script            = "<script language = 'javascript' defer ='defer' id = 'ExpNoofDays_0'>\n";
                script           += "show('divnoofdays');\n";
                script           += "</script>\n";
                RegisterStartupScript("ExpNoofDays_0", script);
                txtnoofdays.Text = theDV[0]["ExpPwdDays"].ToString();
            }
            else
            {
                chkexpPwd.Checked = false;
                script            = "";
                script            = "<script language = 'javascript' defer ='defer' id = 'ExpNoofDays_1'>\n";
                script           += "hide('divnoofdays');\n";
                script           += "</script>\n";
                RegisterStartupScript("ExpNoofDays_1", script);
                txtnoofdays.Text = "";
            }
            //deepika
            ddCountry.Enabled = true;
            //txtcountryno.Enabled = true;
            txtLPTF.Enabled        = true;
            txtSatelliteID.Enabled = true;
            //Facility Address
            txtFacAddress.Text    = theDV[0]["FacilityAddress"].ToString();
            txtFacCell.Text       = theDV[0]["FacilityCell"].ToString();
            txtFacEmail.Text      = theDV[0]["FacilityEmail"].ToString();
            txtFacFax.Text        = theDV[0]["FacilityFax"].ToString();
            txtFactele.Text       = theDV[0]["FacilityTel"].ToString();
            txtFacURL.Text        = theDV[0]["FacilityURL"].ToString();
            txtpharmfoottext.Text = theDV[0]["FacilityFooter"].ToString();

            if (theDV[0]["FacilityTemplate"].ToString() == "0")
            {
                Radio1.Checked = true;
            }
            else if (theDV[0]["FacilityTemplate"].ToString() == "1")
            {
                Radio2.Checked = true;
            }

            if (theDV[0]["DateConstraint"].ToString() == "1")
            {
                chkdateconstraint.Checked = true;
            }
            else
            {
                chkdateconstraint.Checked = false;
            }
            //Billing
            if (theDV[0]["Billing"].ToString() == "1")
            {
                chkbilling.Checked = true;
            }
            else
            {
                chkbilling.Checked = false;
            }
            //PMSCM
            if (theDV[0]["PMSCM"].ToString() == "1")
            {
                chkpmscm.Checked = true;
            }
            else
            {
                chkpmscm.Checked = false;
            }
            //Wards
            chkwards.Checked = (theDV[0]["Wards"].ToString() == "1");
            chkLMIS.Checked  = (theDV[0]["LMIS"].ToString() == "1");

            //PMTCT Binding
            string    strExpr;
            DataRow[] foundRows;
            DataView  theDVmdl = new DataView(((DataSet)ViewState["FacilityDS"]).Tables[2]);
            DataView  dvStore  = new DataView(((DataSet)ViewState["FacilityDS"]).Tables[3]);
            strExpr   = "FacilityId=" + ViewState["FacilityId"].ToString();
            foundRows = theDVmdl.Table.Select(strExpr);
            if (foundRows.GetUpperBound(0) != -1)
            {
                foreach (DataRow dr in foundRows)
                {
                    for (int i = 0; i < cblPMTCT.Items.Count; i++)
                    {
                        if (cblPMTCT.Items[i].Value == dr[1].ToString())
                        {
                            cblPMTCT.Items[i].Selected = true;
                        }
                    }
                }
            }
            // Already link stores with this facility
            foundRows = null;
            foundRows = dvStore.Table.Select(strExpr);
            if (foundRows.GetUpperBound(0) != -1)
            {
                foreach (DataRow dr in foundRows)
                {
                    for (int i = 0; i < CBL_DrugStore.Items.Count; i++)
                    {
                        if (CBL_DrugStore.Items[i].Value == dr["StoreID"].ToString())
                        {
                            CBL_DrugStore.Items[i].Selected = true;
                        }
                    }
                }
            }
        }

        //IFacilitySetup FacilityManager;
        //FacilityManager = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");
        //DataSet theDS = FacilityManager.GetFacility();
        //if (theDS.Tables[0].Rows.Count > 0)
        //{
        //    FacilityId = Convert.ToInt32(theDS.Tables[0].Rows[0]["FacilityID"]);
        //    txtfacilityname.Text = theDS.Tables[0].Rows[0]["FacilityName"].ToString();
        //    txtcountryno.Text = theDS.Tables[0].Rows[0]["CountryID"].ToString();
        //    txtLPTF.Text = theDS.Tables[0].Rows[0]["PosID"].ToString();
        //    txtSatelliteID.Text = theDS.Tables[0].Rows[0]["SatelliteID"].ToString();
        //   // ddsatelliteloc.SelectedValue = theDS.Tables[0].Rows[0]["SatelliteID"].ToString();
        //    txtGrace.Text = theDS.Tables[0].Rows[0]["AppGracePeriod"].ToString();
        //    cmbCurrency.SelectedValue = theDS.Tables[0].Rows[0]["Currency"].ToString();
        //    DateTime Pepfardate;
        //    if (theDS.Tables[0].Rows[0]["PepFarStartDate"] != System.DBNull.Value)
        //    {
        //        Pepfardate = Convert.ToDateTime(theDS.Tables[0].Rows[0]["PepFarStartDate"]);
        //        txtPEPFAR_Fund.Value = Pepfardate.ToString(Session["AppDateFormat"].ToString());
        //    }

        //    ddBackupDrive.SelectedValue = theDS.Tables[0].Rows[0]["BackupDrive"].ToString();
        //    //if (theDS.Tables[0].Rows[0]["BackupTime"].ToString() == "00:00:00")
        //    if (theDS.Tables[0].Rows[0]["BackupTime"].ToString() == "")
        //    {
        //        ddBackupTime.SelectedValue = "Select";
        //    }
        //    else { ddBackupTime.SelectedValue = theDS.Tables[0].Rows[0]["BackupTime"].ToString(); }
        //    //FileLoad.Value = theDS.Tables[0].Rows[0]["Image"].ToString();
        //    ViewState["LoginImage"] = theDS.Tables[0].Rows[0]["Image"].ToString();
        //}
        //else
        //{
        //    Session["AppUserId"] = "1";
        //}
    }
예제 #19
0
        private void Fill_Details()
        {
            string script;

            /*-------------------Dynamic Label Settings----------------------*/
            //DataTable theDT = ((DataSet)ViewState["FacilityDS"]).Tables[1];
            theFacilityDS = new DataSet();
            AuthenticationManager Authentication = new AuthenticationManager();
            IFacilitySetup        FacilityMaster = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");

            theFacilityDS = FacilityMaster.GetFacilityList(Convert.ToInt32(Session["SystemId"]), ApplicationAccess.FacilitySetup, 0);

            DataTable theDT = theFacilityDS.Tables[1];

            lblCountry.InnerText   = theDT.Rows[0]["Label"].ToString() + ":";
            lblPOS.InnerText       = theDT.Rows[1]["Label"].ToString() + ":";
            lblSatellite.InnerText = theDT.Rows[2]["Label"].ToString() + ":";
            /*---------------------------------------------------------------*/

            if (Convert.ToInt32(ViewState["FacilityId"]) > 0)
            {
                DataView theDV = new DataView(((DataSet)ViewState["FacilityDS"]).Tables[0]);
                theDV.RowFilter           = "FacilityId=" + ViewState["FacilityId"].ToString();
                txtfacilityname.Text      = theDV[0]["FacilityName"].ToString();
                txtcountryno.Text         = theDV[0]["CountryId"].ToString();
                txtLPTF.Text              = theDV[0]["PosId"].ToString();
                txtSatelliteID.Text       = theDV[0]["SatelliteId"].ToString();
                txtNationalId.Text        = theDV[0]["NationalId"].ToString();
                txtGrace.Text             = theDV[0]["AppGracePeriod"].ToString();
                ddlprovince.SelectedValue = theDV[0]["provinceId"].ToString();
                ddldistrict.SelectedValue = theDV[0]["DistrictId"].ToString();
                if (theDV[0]["PepFarStartDate"].ToString() != "")
                {
                    txtPEPFAR_Fund.Text = ((DateTime)theDV[0]["PepFarStartDate"]).ToString(Session["AppDateFormat"].ToString());
                }
                cmbCurrency.SelectedValue = theDV[0]["Currency"].ToString();
                if (theDV[0]["Status"].ToString() == "Active")
                {
                    ddStatus.SelectedValue = "0";
                }
                else if (theDV[0]["Status"].ToString() == "In-Active")
                {
                    ddStatus.SelectedValue = "1";
                }
                if (theDV[0]["Preferred"].ToString() == "Yes")
                {
                    chkPreferred.Checked = true;
                }
                else
                {
                    chkPreferred.Checked = false;
                }

                if (theDV[0]["Paperless"].ToString() == "Yes")
                {
                    chkPaperlessclinic.Checked = true;
                    ViewState["Paperless"]     = "1";
                }
                else
                {
                    chkPaperlessclinic.Checked = false;
                    ViewState["Paperless"]     = "0";
                }
                if (theDV[0]["StrongPassFlag"].ToString() == "1")
                {
                    chkStrongPwd.Checked = true;
                }
                else
                {
                    chkStrongPwd.Checked = false;
                }
                if (theDV[0]["ExpPwdFlag"].ToString() == "1")
                {
                    chkexpPwd.Checked = true;
                    script            = "";
                    script            = "<script language = 'javascript' defer ='defer' id = 'ExpNoofDays_0'>\n";
                    script           += "show('divnoofdays');\n";
                    script           += "</script>\n";
                    ClientScript.RegisterStartupScript(this.GetType(), "ExpNoofDays_0", script);
                    txtnoofdays.Text = theDV[0]["ExpPwdDays"].ToString();
                }
                else
                {
                    chkexpPwd.Checked = false;
                    script            = "";
                    script            = "<script language = 'javascript' defer ='defer' id = 'ExpNoofDays_1'>\n";
                    script           += "hide('divnoofdays');\n";
                    script           += "</script>\n";
                    ClientScript.RegisterStartupScript(this.GetType(), "ExpNoofDays_1", script);
                    txtnoofdays.Text = "";
                }
                //deepika
                txtcountryno.Enabled   = true;
                txtLPTF.Enabled        = true;
                txtSatelliteID.Enabled = true;
                //Facility Address
                txtFacAddress.Text    = theDV[0]["FacilityAddress"].ToString();
                txtFacCell.Text       = theDV[0]["FacilityCell"].ToString();
                txtFacEmail.Text      = theDV[0]["FacilityEmail"].ToString();
                txtFacFax.Text        = theDV[0]["FacilityFax"].ToString();
                txtFactele.Text       = theDV[0]["FacilityTel"].ToString();
                txtFacURL.Text        = theDV[0]["FacilityURL"].ToString();
                txtpharmfoottext.Text = theDV[0]["FacilityFooter"].ToString();

                if (theDV[0]["FacilityTemplate"].ToString() == "0")
                {
                    Radio1.Checked = true;
                }
                else if (theDV[0]["FacilityTemplate"].ToString() == "1")
                {
                    Radio2.Checked = true;
                }

                //PMTCT Binding
                string    strExpr;
                DataRow[] foundRows;
                DataView  theDVmdl = new DataView(((DataSet)ViewState["FacilityDS"]).Tables[2]);
                strExpr   = "FacilityId=" + ViewState["FacilityId"].ToString();
                foundRows = theDVmdl.Table.Select(strExpr);
                if (foundRows.GetUpperBound(0) != -1)
                {
                    foreach (DataRow dr in foundRows)
                    {
                        for (int i = 0; i < cblPMTCT.Items.Count; i++)
                        {
                            if (cblPMTCT.Items[i].Value == dr[1].ToString())
                            {
                                cblPMTCT.Items[i].Selected = true;
                            }
                        }
                    }
                }
            }
        }
예제 #20
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            //(Master.FindControl("lblRoot") as Label).Text = "Clinical Forms >>";
            //(Master.FindControl("lblMark") as Label).Visible = false;
            //(Master.FindControl("lblheader") as Label).Text = "Patient History";
            //(Master.FindControl("lblformname") as Label).Text = "Existing Forms";
            (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Text     = "Clinical Forms >> ";
            (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text   = "Patient History";
            (Master.FindControl("levelTwoNavigationUserControl1").FindControl("lblformname") as Label).Text = "Existing Forms";



            #region "Refresh Patient Records"
            IPatientHome PManager;
            if (null == Session["PatientInformation"])
            {
                PManager = (IPatientHome)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientHome, BusinessProcess.Clinical");
                System.Data.DataSet thePDS = PManager.GetPatientDetails(Convert.ToInt32(Session["PatientId"]), Convert.ToInt32(Session["SystemId"]), Convert.ToInt32(Session["TechnicalAreaId"]));
                //System.Data.DataSet thePDS = PManager.GetPatientDetails(Convert.ToInt32(Request.QueryString["PatientId"]), Convert.ToInt32(Session["SystemId"]));

                Session["PatientInformation"] = thePDS.Tables[0];
            }
            #endregion

            IPatientHome PatientManager;
            PatientManager = (IPatientHome)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientHome, BusinessProcess.Clinical");

            try
            {
                (Master.FindControl("levelTwoNavigationUserControl1").FindControl("lblpntStatus") as Label).Text = Convert.ToString(Session["PatientStatus"]);
                if (!IsPostBack)
                {
                    IFacilitySetup FacilityMaster = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");
                    //theFacilityDS = FacilityMaster.GetFacilityList(Convert.ToInt32(Session["SystemId"]), 1001);
                    //theFacilityDS = FacilityMaster.GetSystemBasedLabels(Convert.ToInt32(Session["SystemId"]), 1001, 0);
                    //ViewState["FacilityDS"] = theFacilityDS;
                    //SetPageLabels();
                    //******************************************************//
                    if (Session["PatientId"] == null || Convert.ToString(Session["PatientId"]) == "0")
                    {
                        Session["PatientId"] = Request.QueryString["PatientId"];  //remove it after session of patient set on find add when patient selected from grid.
                    }

                    PId    = Convert.ToString(Session["PatientId"]);
                    PtnSts = Convert.ToString(Session["PatientStatus"]);;
                    if (Session["PatientId"] != null && Convert.ToInt32(Session["PatientId"]) != 0)
                    {
                        PId = Session["PatientId"].ToString();
                    }
                    if (Session["PatientStatus"] != null)
                    {
                        PtnSts = Session["PatientStatus"].ToString();
                    }
                    DataSet theDS = PatientManager.GetPatientHistory(Convert.ToInt32(PId));
                    ViewState["theCFDT"] = theDS.Tables[3].Copy();
                    FormIQCare(theDS);
                }
            }

            catch (Exception err)
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["MessageText"] = err.Message.ToString();
                IQCareMsgBox.Show("#C1", theBuilder, this);
                return;
            }
            finally
            {
                PatientManager = null;
            }
        }
예제 #21
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.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");
    }
    private void BindGrid()
    {
        if (Session["SystemId"].ToString() == "3")
        {
            TreeNode root = new TreeNode();
            TreeNode theChildRoot;
            TreeNode theMRoot;
            tvcustomlist.LeafNodeStyle.Font.Underline = true;
            tvcustomlist.LeafNodeStyle.ForeColor      = System.Drawing.Color.Blue;
            bool   flagroot = true;
            string stralpha = string.Empty;
            AuthenticationManager Authentication = new AuthenticationManager();
            root.Text = "List";
            if (flagroot)
            {
                root.Expand();
                flagroot = false;
            }
            else
            {
                root.Collapse();
            }
            tvcustomlist.Nodes.Add(root);
            #region "Universal Node"
            theMRoot        = new TreeNode();
            theMRoot.Text   = "PASDP Universal";
            theMRoot.Value  = "0";
            theMRoot.Target = "_blank";
            theMRoot.Expand();
            root.ChildNodes.Add(theMRoot);

            string  filePath        = Server.MapPath("~/XMLFiles/customizelist.xml");
            DataSet dscustomiseList = new DataSet();
            dscustomiseList.ReadXml(filePath);
            DataView  theDV    = new DataView(dscustomiseList.Tables[0]);
            DataTable theXMLDT = new DataTable();
            theDV.RowFilter = "SystemId = 3";
            theDV.Sort      = "ListName asc";
            DataTable objTable = theDV.ToTable();
            foreach (DataRow theUniDR in objTable.Rows)
            {
                string url = string.Empty;
                theChildRoot        = new TreeNode();
                theChildRoot.Text   = theUniDR["ListName"].ToString();
                theChildRoot.Target = "";
                url = string.Format("{0}?TableName={1}&CategoryId={2}&LstName={3}&Fid={4}&Upd={5}&CCID={6}&ModId={7}", theUniDR["FormName"].ToString(), theUniDR["TableName"].ToString(), theUniDR["CategoryId"].ToString(), theUniDR["ListName"].ToString(), theUniDR["FeatureID"].ToString(), theUniDR["Update"].ToString(), theUniDR["CountryID"].ToString(), theUniDR["ModuleId"]);
                theChildRoot.NavigateUrl = url;
                theMRoot.ChildNodes.Add(theChildRoot);
            }
            #endregion
        }
        else
        {
            string  filePath        = Server.MapPath("~/XMLFiles/customizelist.xml");
            DataSet dscustomiseList = new DataSet();
            dscustomiseList.ReadXml(filePath);

            DataView       theDV           = new DataView(dscustomiseList.Tables[0]);
            DataTable      theXMLDT        = new DataTable();
            IFacilitySetup FacilityManager = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");
            DataSet        theDSFacility   = FacilityManager.GetModuleName();
            DataTable      theDTPubModule  = (DataTable)Session["AppModule"];
            DataTable      theDTModule     = theDSFacility.Tables[1];

            ///UserRight Table
            DataTable theDTUserRight = (DataTable)Session["AppUserCustomList"];
            //

            string theModList = "";
            foreach (DataRow theDR in theDTModule.Rows)
            {
                if (theModList == "")
                {
                    theModList = theDR["ModuleId"].ToString();
                }
                else
                {
                    theModList = theModList + "," + theDR["ModuleId"].ToString();
                }
            }
            IQCareUtils theUtil = new IQCareUtils();
            theDV.RowFilter = "ModuleId in (0," + theModList + ")";
            if (theDV.Count > 0)
            {
                theDV.RowFilter = "(SystemId=" + Session["SystemId"].ToString() + " or SystemId=0)";
                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);
            }
            //////DataTable theDTPmtct = CustomManager.GetCustomFieldListPMTCT();
            //////if (theDTPmtct != null && theDTPmtct.Rows.Count > 0)
            //////{
            //////    theXMLDT.Merge(theDTPmtct);
            //////    theXMLDT.AcceptChanges();
            //////}

            #region "ParentNode"
            TreeNode root = new TreeNode();
            TreeNode theChildRoot;
            TreeNode theMRoot;
            tvcustomlist.LeafNodeStyle.Font.Underline = true;
            tvcustomlist.LeafNodeStyle.ForeColor      = System.Drawing.Color.Blue;
            bool   flagroot = true;
            string stralpha = string.Empty;
            AuthenticationManager Authentication = new AuthenticationManager();
            root.Text = "List";
            if (flagroot)
            {
                root.Expand();
                flagroot = false;
            }
            else
            {
                root.Collapse();
            }
            tvcustomlist.Nodes.Add(root);
            #endregion

            #region "Universal Node"
            theMRoot        = new TreeNode();
            theMRoot.Text   = "Universal";
            theMRoot.Value  = "0";
            theMRoot.Target = "_blank";
            theMRoot.Expand();
            root.ChildNodes.Add(theMRoot);

            theDV           = new DataView(theXMLDT);
            theDV.RowFilter = "ModuleId = 0";
            theDV.Sort      = "ListName asc";
            DataTable objTable = theDV.ToTable();
            foreach (DataRow theUniDR in objTable.Rows)
            {
                string url = string.Empty;
                theChildRoot        = new TreeNode();
                theChildRoot.Text   = theUniDR["ListName"].ToString();
                theChildRoot.Target = "";
                //if ((theUniDR["FeatureID"].ToString() != "0") && (ModuleExists(Convert.ToInt32(theUniDR["ModuleId"].ToString()),theDTUserRight) == false) && (Authentication.HasFeatureRight(Convert.ToInt32(theUniDR["FeatureID"].ToString()), theDTUserRight) == false) && Convert.ToInt32(Session["AppUserId"]) > 1)
                if ((theUniDR["FeatureID"].ToString() != "0") && (ModuleExists(Convert.ToInt32(theUniDR["ModuleId"].ToString()), Convert.ToInt32(theUniDR["FeatureID"].ToString()), theDTUserRight) == false) && Convert.ToInt32(Session["AppUserId"]) > 1)
                {
                    theChildRoot.ImageUrl     = "~/Images/lock.jpg";
                    theChildRoot.ImageToolTip = "You are Not Authorized to Access this Functionality";
                    theChildRoot.SelectAction = TreeNodeSelectAction.None;
                }
                //else if ((theUniDR["FeatureID"].ToString() == "0") && Authentication.HasFeatureRight(Convert.ToString(theUniDR["ListName"].ToString()), 0, theDTUserRight) == false && Convert.ToInt32(Session["AppUserId"]) > 1)
                else if ((theUniDR["FeatureID"].ToString() == "0") && (ModuleExists(Convert.ToInt32(theUniDR["ModuleId"].ToString()), Convert.ToString(theUniDR["ListName"].ToString()), theDTUserRight) == false) && Convert.ToInt32(Session["AppUserId"]) > 1)
                {
                    theChildRoot.ImageUrl     = "~/Images/lock.jpg";
                    theChildRoot.ImageToolTip = "You are Not Authorized to Access this Functionality";
                    theChildRoot.SelectAction = TreeNodeSelectAction.None;
                }
                else
                {
                    url = string.Format("{0}?TableName={1}&CategoryId={2}&LstName={3}&Fid={4}&Upd={5}&CCID={6}&ModId={7}", theUniDR["FormName"].ToString(), theUniDR["TableName"].ToString(), theUniDR["CategoryId"].ToString(), theUniDR["ListName"].ToString(), theUniDR["FeatureID"].ToString(), theUniDR["Update"].ToString(), theUniDR["CountryID"].ToString(), "0");
                    theChildRoot.NavigateUrl = url;
                    //theChildRoot.ImageUrl = "~/Images/lock.jpg";
                    //theChildRoot.ImageToolTip = "You are Not Authorized to Access this Functionality";
                    //theChildRoot.SelectAction = TreeNodeSelectAction.None;
                }
                theMRoot.ChildNodes.Add(theChildRoot);
            }
            //theDV = new DataView((DataTable)Session["UserFeatures"]);
            //theDV.RowFilter = "ModuleId = 0 and FacilityId=0";
            //theDV.Sort = "FeatureName asc";
            //DataTable FrmRightsTable = theDV.ToTable();
            //foreach (DataRow theFrmDR in FrmRightsTable.Rows)
            //{
            //    for (int m = 0; m < theMRoot.ChildNodes.Count; m++)
            //    {
            //        if (theFrmDR["FeatureName"].ToString() == theMRoot.ChildNodes[m].Text)
            //        {
            //            theMRoot.ChildNodes[m].ImageUrl = "";
            //            theMRoot.ChildNodes[m].ImageToolTip = "";
            //            theMRoot.ChildNodes[m].SelectAction = TreeNodeSelectAction.Select;
            //        }
            //    }
            //}
            //if (Convert.ToInt32(Session["AppUserId"]) == 1)
            //{
            //    for (int m = 0; m < theMRoot.ChildNodes.Count; m++)
            //    {

            //        theMRoot.ChildNodes[m].ImageUrl = "";
            //        theMRoot.ChildNodes[m].ImageToolTip = "";
            //        theMRoot.ChildNodes[m].SelectAction = TreeNodeSelectAction.Select;

            //    }

            //}
            #endregion

            #region "Module Nodes"
            //////////////////////////////////////////////////////////////////////
            string    thePubModList = "";
            DataTable objPubTable;
            foreach (DataRow thepubDR in theDTPubModule.Rows)
            {
                if (thePubModList == "")
                {
                    thePubModList = thepubDR["ModuleId"].ToString();
                }
                else
                {
                    thePubModList = thePubModList + "," + thepubDR["ModuleId"].ToString();
                }
            }
            DataView thepubDV = new DataView(theXMLDT);
            thepubDV.RowFilter = "ModuleId in(" + thePubModList.ToString() + ")";
            thepubDV.Sort      = "ListName asc";
            objPubTable        = thepubDV.ToTable();
            ////////////////////////////////////////////////////////////
            foreach (DataRow theModRow in theDTModule.Rows)
            {
                theDV           = new DataView(theXMLDT);
                theDV.RowFilter = "ModuleId =" + theModRow["ModuleId"].ToString();
                theDV.Sort      = "ListName asc";
                objTable        = theDV.ToTable();

                if (objTable.Rows.Count > 0)
                {
                    theMRoot        = new TreeNode();
                    theMRoot.Text   = theModRow["ModuleName"].ToString();
                    theMRoot.Value  = theModRow["ModuleId"].ToString();
                    theMRoot.Target = "_blank";
                    root.ChildNodes.Add(theMRoot);
                    foreach (DataRow theUniDR in objTable.Rows)
                    {
                        string url = string.Empty;
                        theChildRoot        = new TreeNode();
                        theChildRoot.Text   = theUniDR["ListName"].ToString();
                        theChildRoot.Target = "";
                        //if ((theUniDR["ModuleID"].ToString() != "0") && (Authentication.HasModuleRight(Convert.ToInt32(theUniDR["ModuleID"].ToString()), objPubTable) == false))
                        //{
                        //    theChildRoot.ImageUrl = "~/Images/lock.jpg";
                        //    theChildRoot.ImageToolTip = "You are Not Authorized to Access this Functionality";
                        //    theChildRoot.SelectAction = TreeNodeSelectAction.None;
                        //}
                        if ((theUniDR["FeatureID"].ToString() != "0") && (Authentication.HasFeatureRight(Convert.ToInt32(theUniDR["FeatureID"].ToString()), theDTUserRight) == false) && Convert.ToInt32(Session["AppUserId"]) > 1)
                        {
                            theChildRoot.ImageUrl     = "~/Images/lock.jpg";
                            theChildRoot.ImageToolTip = "You are Not Authorized to Access this Functionality";
                            theChildRoot.SelectAction = TreeNodeSelectAction.None;
                        }
                        else if (Authentication.HasFeatureRight(Convert.ToString(theUniDR["ListName"].ToString()), Convert.ToInt32(theUniDR["ModuleID"]), theDTUserRight) == false && Convert.ToInt32(Session["AppUserId"]) > 1)
                        {
                            theChildRoot.ImageUrl     = "~/Images/lock.jpg";
                            theChildRoot.ImageToolTip = "You are Not Authorized to Access this Functionality";
                            theChildRoot.SelectAction = TreeNodeSelectAction.None;
                        }
                        else
                        {
                            url = string.Format("{0}?TableName={1}&CategoryId={2}&LstName={3}&Fid={4}&Upd={5}&CCID={6}&ModId={7}", theUniDR["FormName"].ToString(), theUniDR["TableName"].ToString(), theUniDR["CategoryId"].ToString(), theUniDR["ListName"].ToString(), theUniDR["FeatureID"].ToString(), theUniDR["Update"].ToString(), theUniDR["CountryID"].ToString(), theUniDR["ModuleID"].ToString());
                            theChildRoot.NavigateUrl = url;
                            //theChildRoot.ImageUrl = "~/Images/lock.jpg";
                            //theChildRoot.ImageToolTip = "You are Not Authorized to Access this Functionality";
                            //theChildRoot.SelectAction = TreeNodeSelectAction.None;
                        }
                        theMRoot.ChildNodes.Add(theChildRoot);
                    }
                }
                //theDV = new DataView((DataTable)Session["UserFeatures"]);
                //theDV.RowFilter = "ModuleId = " + theModRow["ModuleId"].ToString() + " and FacilityId=0";
                //theDV.Sort = "FeatureName asc";
                //FrmRightsTable = theDV.ToTable();
                //foreach (DataRow theFrmDR in FrmRightsTable.Rows)
                //{
                //    for (int m = 0; m < theMRoot.ChildNodes.Count; m++)
                //    {
                //        if (theFrmDR["FeatureName"].ToString() == theMRoot.ChildNodes[m].Text)
                //        {
                //            theMRoot.ChildNodes[m].ImageUrl = "";
                //            theMRoot.ChildNodes[m].ImageToolTip = "";
                //            theMRoot.ChildNodes[m].SelectAction = TreeNodeSelectAction.Select;
                //        }
                //    }
                //}

                //if (Convert.ToInt32(Session["AppUserId"]) == 1)
                //{
                //    for (int m = 0; m < theMRoot.ChildNodes.Count; m++)
                //    {
                //theMRoot.ChildNodes[m].ImageUrl = "";
                //theMRoot.ChildNodes[m].ImageToolTip = "";
                //        //theMRoot.ChildNodes[m].SelectAction = TreeNodeSelectAction.Select;
                //    }
                //}
            }
            #endregion
        }
    }