示例#1
0
    private string GetSearchString()
    {
        string          searchString          = string.Empty;
        BrowseTreeView  yearsTreeView         = null;
        BrowseTreeView  categoriesTreeView    = null;
        BrowseTreeView  resourceTypesTreeView = null;
        AuthorsListView authorsListView       = null;

        //Find selected TreeView control on the master page.
        Master masterPage = (Master)this.Page.Master;

        if (masterPage.SelectedBrowseTreeView != null)
        {
            if (masterPage.SelectedBrowseTreeView is AuthorsListView)
            {
                authorsListView = masterPage.SelectedBrowseTreeView as AuthorsListView;
            }
            else
            {
                BrowseTreeView selectedTree = (BrowseTreeView)masterPage.SelectedBrowseTreeView;
                if (selectedTree.BrowseBy == YearMonthtree.BrowseBy)
                {
                    yearsTreeView = selectedTree;
                }
                else if (selectedTree.BrowseBy == CategoryNodeTree.BrowseBy)
                {
                    categoriesTreeView = selectedTree;
                }
                else if (selectedTree.BrowseBy == ResourceTypeTree.BrowseBy)
                {
                    resourceTypesTreeView = selectedTree;
                }
            }
        }
        if (yearsTreeView == null)
        {
            yearsTreeView = YearMonthtree;
        }
        if (categoriesTreeView == null)
        {
            categoriesTreeView = CategoryNodeTree;
        }
        if (resourceTypesTreeView == null)
        {
            resourceTypesTreeView = ResourceTypeTree;
        }
        if (authorsListView == null)
        {
            authorsListView = AuthorsView;
        }

        //Construct query string.
        searchString += yearsTreeView.SelectedSearchValue + _space
                        + categoriesTreeView.SelectedSearchValue + _space
                        + resourceTypesTreeView.SelectedSearchValue + _space
                        + authorsListView.SelectedSearchValue + _space
                        + txtFilter.Text;

        return(searchString.Trim());
    }
示例#2
0
    private int CreateChildNode111(TreeNode ParentNodee, int stIndexdd, string[] DirectoryList, string DocID, int NodeType)
    {
        TreeNode ParentNode = null;

        try
        {
            for (int stIndex = 0; stIndex < DirectoryList.Length; stIndex++)
            {
                // string nodeText = ParentNode.ValuePath + "/" + DirectoryList[stIndex];
                if (stIndex == 0)
                {
                    ParentNode = BrowseTreeView.FindNode(DirectoryList[stIndex]);
                }
                else
                {
                    ParentNode = BrowseTreeView.FindNode(DirectoryList[stIndex - 1]);
                }

                TreeNode ChildNode = BrowseTreeView.FindNode(DirectoryList[stIndex]);
                TreeNode NewNode   = new TreeNode();

                if (ChildNode == null)
                {
                    ParentNode.ChildNodes.Add(new TreeNode(DirectoryList[stIndex], DirectoryList[stIndex], getNodeImageURL(DirectoryList[stIndex]), "", DocID));
                }

                // string nodeText1 = ParentNode.ValuePath + "/" + DirectoryList[stIndex];
                NewNode = BrowseTreeView.FindNode(ParentNode.ValuePath + "/" + DirectoryList[stIndex]);
                if (NewNode != null)
                {
                    //if (NodeType == 0 && ChildNode == null)
                    if (DirectoryList[stIndex].ToString().IndexOf(".") > 0)
                    {
                        NewNode.NavigateUrl  = "FileLoader.aspx?DocID=" + DocID;
                        NewNode.Target       = "docPreview";
                        NewNode.SelectAction = TreeNodeSelectAction.Select;
                        NewNode.Expand();
                    }
                    else
                    {
                        string value = Convert.ToString(NewNode.ValuePath);
                        NewNode.NavigateUrl  = "AddNewFile.aspx?Path=" + value;
                        NewNode.Target       = "docPreview";
                        NewNode.SelectAction = TreeNodeSelectAction.SelectExpand;
                        NewNode.Collapse();
                    }
                }
                // stIndex++;
                //CreateChildNode(NewNode, stIndex, DirectoryList, DocID);
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
        return(0);
    }
示例#3
0
 private void BrowseTreeView_MouseDown(object sender, MouseEventArgs e)
 {
     try
     {
         BrowseTreeView.SelectedNode = BrowseTreeView.GetNodeAt(e.X, e.Y);
     }
     catch (Exception exception)
     {
         ServerUtils.HandleException(this.Text, exception);
     }
 }
示例#4
0
    /// <summary>
    /// this is method uses for the load & bind the treeview control from database.
    /// </summary>
    public void LoadtreeView()
    {
        dsTreeResult = objQMS.getFilpath();
        DataTable dtTree = dsTreeResult.Tables[0];

        BrowseTreeView.Nodes.Add(new TreeNode("DOCUMENT", "DOCUMENT"));
        foreach (DataRow dr in dtTree.Rows)
        {
            string[] DirectoryList = dr[0].ToString().Split('\\');
            int      stIndex       = 3;
            TreeNode ParentNode    = BrowseTreeView.FindNode("DOCUMENT");
            CreateChildNode(ParentNode, stIndex, DirectoryList);
        }
    }
示例#5
0
        private void ResetBackUpDataTab()
        {
            TreeNode selectedNode = BrowseTreeView.SelectedNode;

            InitializeBrowseTreeView(wf.backupData.GetSetlists());

            if (selectedNode != null)
            {
                foreach (TreeNode node in BrowseTreeView.GetAllNodes())
                {
                    if (node.Level == selectedNode.Level && node.Name == selectedNode.Name)
                    {
                        BrowseTreeView.SelectedNode = node;
                        node.Expand();
                        break;
                    }
                }
            }
        }
    protected void CreateChildNode(string NodePath, string NodeName, int NodeType, string NodeValue, string ParentNodeValue, string DocFileExt, string VogId)
    {
        try
        {
            //string ParentNodePath = NodePath.Replace("/" + NodeName, "");
            string[] Temp = NodePath.Split('/');


            string ParentNodePath = "";
            for (int i = 0; i < Temp.Length - 1; i++)
            {
                if (ParentNodePath.Length > 0)
                {
                    ParentNodePath += "/";
                }
                ParentNodePath += Temp[i];
            }

            TreeNode ParentNode = BrowseTreeView.FindNode(ParentNodePath);

            if (ParentNode == null)
            {
                string[] sN = ParentNodePath.Split('/');

                CreateChildNode(ParentNodePath, sN[sN.Length - 1], 0, NodeValue, ParentNodeValue, DocFileExt, VogId);

                TreeNode ParentNode1 = BrowseTreeView.FindNode(ParentNodePath);
                if (ParentNode1 != null)
                {
                    CreateNode(ParentNode1, NodeName, NodeType, NodeValue, ParentNodeValue, DocFileExt, VogId);
                }
            }
            else
            {
                CreateNode(ParentNode, NodeName, NodeType, NodeValue, ParentNodeValue, DocFileExt, VogId);
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
示例#7
0
 /// <summary>
 /// this is for the child node by passsing the ParentNode,starting index of the node & directory list.
 /// </summary>
 /// <param name="ParentNode"></param>
 /// <param name="stIndex"></param>
 /// <param name="DirectoryList"></param>
 /// <returns></returns>
 private int CreateChildNode(TreeNode ParentNode, int stIndex, string[] DirectoryList)
 {
     try
     {
         if (stIndex < DirectoryList.Length - 1)
         {
             TreeNode ChildNode = BrowseTreeView.FindNode(ParentNode.ValuePath + "/" + DirectoryList[stIndex + 1]);
             TreeNode NewNode   = new TreeNode();
             if (ChildNode == null)
             {
                 ParentNode.ChildNodes.Add(new TreeNode(DirectoryList[stIndex + 1], DirectoryList[stIndex + 1]));
             }
             NewNode = BrowseTreeView.FindNode(ParentNode.ValuePath + "/" + DirectoryList[stIndex + 1]);
             stIndex++;
             CreateChildNode(NewNode, stIndex, DirectoryList);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return(0);
 }
示例#8
0
        private void BrowseTreeView_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            TreeListItem item = WpfUtil.GetTreeListItem(e.OriginalSource);

            if (item == null)
            {
                return;
            }

            BrowseComponent browse = BrowseController.SelectedItem;

            if (browse != null)
            {
                if (browse.File)
                {
                    DownloadController.Download(browse);
                }
                else
                {
                    TreeNode node = BrowseTreeView.SelectedNode;

                    if (node != null)
                    {
                        if (Application.Current != null)
                        {
                            Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Send, new Action(delegate
                            {
                                BrowseTreeView.SetIsExpanded(node, !node.IsExpanded);
                            }));
                        }
                    }
                }
            }

            BrowseTreeView.UnselectAll();
        }
示例#9
0
    /// <summary>
    /// this is for the child node by passsing the ParentNodePath,Node Name,node type & node ID.
    /// </summary>
    /// <param name="NodePath"></param>
    /// <param name="NodeName"></param>
    /// <param name="NodeType"></param>
    /// <param name="NodeID"></param>
    /// <returns></returns>
    ///
    private int CreateChildNode(string NodePath, string NodeName, int NodeType, int NodeID)
    {
        try
        {
            string   ParentNodePath = NodePath.Replace("/" + NodeName, "");
            TreeNode ParentNode     = BrowseTreeView.FindNode(ParentNodePath);

            if (ParentNode != null)
            {
                TreeNode NewNode = new TreeNode(NodeName, NodeName.ToString(), getNodeImageURL(NodeName));


                if (NodeType == 0)
                {
                    NewNode.NavigateUrl  = "FileLoader.aspx?DocID=" + NodeID;
                    NewNode.Target       = "docPreview";
                    NewNode.SelectAction = TreeNodeSelectAction.Select;
                    NewNode.Expand();
                }
                else
                {
                    NewNode.NavigateUrl  = "AddNewFile.aspx?Path=" + NodePath;
                    NewNode.Target       = "docPreview";
                    NewNode.SelectAction = TreeNodeSelectAction.SelectExpand;
                    NewNode.Collapse();
                }

                ParentNode.ChildNodes.Add(NewNode);
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
        return(0);
    }
示例#10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     LoadtreeView();
     if (!IsPostBack)
     {
         string js = "<script language='javascript' type='text/javascript'>DocOpenOnIFrame('DocPublishPendingList.aspx');</script>";
         Page.ClientScript.RegisterStartupScript(GetType(), "script", js);
     }
     else
     {
         if (Session["NAV_URL"] != null)
         {
             if (Session["NAV_URL"].ToString() != "")
             {
                 NavigateNodeURL(Session["NAV_URL"].ToString());
                 TreeNode tNode = BrowseTreeView.FindNode(Session["NAV_URL"].ToString());
                 hidden_SelectedNodeURL.Value = Session["NAV_URL"].ToString();
                 //OpenfileInfo.Disabled = true;
                 Session["NAV_URL"] = "";
             }
         }
         Session["FolderPath"] = hidden_SelectedNodeURL.Value;
     }
 }
示例#11
0
    /// <summary>
    /// this is method uses for the load & bind the treeview control from database.
    /// </summary>
    public void LoadtreeView()
    {
        //string FilePath[]= "";
        dsTreeResult = objQMS.getFilpath();
        DataTable dtTree = dsTreeResult.Tables[0];

        //foreach (DataRow dr in dtTree.Rows)
        //{
        //    string[] DirectoryList = dr[0].ToString().Split('\\');
        //   // string DirectoryList = dr[0].ToString();
        //    TreeNode tr = new TreeNode();
        //    string sd = DirectoryList[4].ToUpper();
        //    int iTreeIndex = 0;
        //    //for (int i = 3; i < DirectoryList.Length; i++)
        //    //{
        //    //    if(DirectoryList[i].ToUpper() == "QMS")
        //    //    {
        //    //        iTreeIndex = i+1;
        //    //        startindex = i+2;
        //    //        tr = new TreeNode(DirectoryList[i+1].ToUpper());
        //    //        BrowseTreeView.Nodes.Add(tr);

        //    //    }
        //        CreateChildNode(DirectoryList[3].ToUpper(), DirectoryList[4].ToUpper(), iTreeIndex, DirectoryList);
        //   //}
        //}

        BrowseTreeView.Nodes.Add(new TreeNode("DOCUMENT", "DOCUMENT"));
        foreach (DataRow dr in dtTree.Rows)
        {
            string[] DirectoryList = dr[0].ToString().Split('\\');
            int      stIndex       = 3;
            TreeNode ParentNode    = BrowseTreeView.FindNode("DOCUMENT");
            CreateChildNode(ParentNode, stIndex, DirectoryList);
        }
    }
示例#12
0
 private void BrowseDownloadCommand_Executed(object sender, ExecutedRoutedEventArgs e)
 {
     BrowseController.Download(BrowseController.SelectedItems);
     BrowseTreeView.UnselectAll();
 }