示例#1
0
    public void BindFolder()
    {
        try
        {
            DataTable dtFolders = BLL_QMSDB_Folders.QMSDBFoldes_List(null, null, null, null, UDFLib.ConvertIntegerToNull(Request.QueryString["DocID"].ToString()));
            ddlFolderList.DataSource     = dtFolders;
            ddlFolderList.DataTextField  = "FOLDER_NAME";
            ddlFolderList.DataValueField = "FOLDER_ID";
            ddlFolderList.DataBind();

            ddlFolderName.DataSource     = dtFolders;
            ddlFolderName.DataTextField  = "FOLDER_NAME";
            ddlFolderName.DataValueField = "FOLDER_ID";
            ddlFolderName.DataBind();

            ddlFolderName.SelectedValue = Request.QueryString["DocID"].ToString();
            if (dtFolders.Rows.Count > 0)
            {
                BindTrvFolder(dtFolders);
                GenerateUL(dtFolders);
            }
        }
        catch (Exception ex)
        {
        }
    }
示例#2
0
    /// <summary>
    /// this is method uses for the load & bind the treeview control from database.
    /// </summary>
    public void LoadtreeView()
    {
        //DataTable dtFolders = objQMS.getFolderList(87);
        //DataTable dtFiles = objQMS.getFileList(87);
        DataTable dtFolders = BLL_QMSDB_Folders.QMSDBFoldes_List(null, null, null, Convert.ToInt32(Session["USERID"]), null);
        DataTable dtFiles   = BLL_QMSDB_Folders.QMSDBFoldes_ProcedureList(null, null, null, Convert.ToInt32(Session["USERID"]), null);

        //this is for the root node
        if (dtFolders.Rows.Count == 0)
        {
            TreeNode parentNode = new TreeNode("DOCUMENTS", "DOCUMENTS", getNodeImageURL("Parent.FDC"));
            parentNode.NavigateUrl  = "AddNewFile.aspx?Path=DOCUMENTS&DocID=1";
            parentNode.Target       = "docPreview";
            parentNode.SelectAction = TreeNodeSelectAction.Select;
            parentNode.Expand();
            BrowseTreeView.Nodes.Add(parentNode);
        }
        else
        {
            TreeNode parentNode = new TreeNode(dtFolders.Rows[0]["FOLDER_NAME"].ToString(), dtFolders.Rows[0]["FOLDER_NAME"].ToString(), getNodeImageURL("Parent.FDC"));
            parentNode.NavigateUrl  = "AddNewFile.aspx?Path=DOCUMENTS&DocID=1";
            parentNode.Target       = "docPreview";
            parentNode.SelectAction = TreeNodeSelectAction.Select;
            parentNode.Expand();
            BrowseTreeView.Nodes.Add(parentNode);
        }
        if (dtFolders.Rows.Count > 0)
        {
            foreach (DataRow dr in dtFolders.Rows)
            {
                CreateChildNode(dr["XNPATH"].ToString(), dr["FOLDER_NAME"].ToString(), 1, Convert.ToInt32(dr["FOLDER_ID"].ToString()));
            }
        }
        if (dtFiles.Rows.Count > 0)
        {
            foreach (DataRow dr in dtFiles.Rows)
            {
                CreateChildNode(dr["XNPATH"].ToString(), dr["FOLDER_NAME"].ToString(), 0, Convert.ToInt32(dr["FOLDER_ID"].ToString()));
            }
        }
    }
    public void BindFolder()
    {
        try
        {
            DataTable dtFolders = BLL_QMSDB_Folders.QMSDBFoldes_List(null, null, null, null, 1);


            //ddlFolderName.DataSource = dtFolders;
            //ddlFolderName.DataTextField = "XNPATH";
            //ddlFolderName.DataValueField = "FOLDER_ID";
            //ddlFolderName.DataBind();

            if (dtFolders.Rows.Count > 0)
            {
                //ddlFolderName.SelectedValue = "1";
                BindTrvFolder(dtFolders);
                //GenerateUL(dtFolders);
            }
        }
        catch (Exception ex)
        {
        }
    }