Ejemplo n.º 1
0
        private void CheckForProjectId()
        {
            _LblStatus.Text    = string.Empty;
            _LblStatus.Visible = false;

            if (Session[SessionName.ProjectId] != null)
            {
                string _ProjectId = Session[SessionName.ProjectId].ToString();

                WSDocManagement.DocSvc docSvc = new WSDocManagement.DocSvc();
                DataSet _DsFolders            = docSvc.GetFoldersByMatter(_ProjectId);

                if (_TViewFolders.Nodes.Count > 0)
                {
                    _TViewFolders.Nodes.Clear();
                }

                TreeNode _Tn = new TreeNode("Documents");
                _TViewFolders.Nodes.Add(_Tn);

                if (_DsFolders.Tables[0].Rows.Count != 0)
                {
                    foreach (DataRow _Dr in _DsFolders.Tables[0].Rows)
                    {
                        string DocAttValue = _Dr["DocAttributeValue"].ToString().Trim();

                        //_Tn = new TreeNode(DocAttValue + "  (" + docSvc.GetFileByMatter(Session[SessionName.ProjectId].ToString(), DocAttValue).Tables[0].Rows.Count + ")");
                        _Tn       = new TreeNode(DocAttValue);
                        _Tn.Value = _Dr["DocAttributeValue"].ToString().Trim();

                        _TViewFolders.Nodes[0].ChildNodes.Add(_Tn);

                        if (Session["SelectedFolder"] != null)
                        {
                            if (Session["SelectedFolder"].ToString().Trim() == _Dr["DocAttributeValue"].ToString().Trim())
                            {
                                _TViewFolders.Nodes[0].ChildNodes[_TViewFolders.Nodes[0].ChildNodes.Count - 1].Selected = true;
                            }
                        }
                    }

                    _TViewFolders.Nodes[0].Expand();
                }
            }


            //if (Session[SessionName.ProjectId] != null)
            //{
            //    string ProjectId = Session[SessionName.ProjectId].ToString().Trim();

            //    _LblStatus.Text = "Project (" + ProjectId + ") has been selected!";
            //}
        }
        private void CheckForProjectId()
        {
            _LblStatus.Text = string.Empty;
            _LblStatus.Visible = false;

            if (Session[SessionName.ProjectId] != null)
            {
                string _ProjectId = Session[SessionName.ProjectId].ToString();

                WSDocManagement.DocSvc docSvc = new WSDocManagement.DocSvc();
                DataSet _DsFolders = docSvc.GetFoldersByMatter(_ProjectId);

                if (_TViewFolders.Nodes.Count > 0) { _TViewFolders.Nodes.Clear(); }

                TreeNode _Tn = new TreeNode("Documents");
                _TViewFolders.Nodes.Add(_Tn);

                if (_DsFolders.Tables[0].Rows.Count != 0)
                {
                    foreach (DataRow _Dr in _DsFolders.Tables[0].Rows)
                    {
                        string DocAttValue = _Dr["DocAttributeValue"].ToString().Trim();

                        //_Tn = new TreeNode(DocAttValue + "  (" + docSvc.GetFileByMatter(Session[SessionName.ProjectId].ToString(), DocAttValue).Tables[0].Rows.Count + ")");
                        _Tn = new TreeNode(DocAttValue);
                        _Tn.Value = _Dr["DocAttributeValue"].ToString().Trim();

                        _TViewFolders.Nodes[0].ChildNodes.Add(_Tn);

                        if (Session["SelectedFolder"] != null)
                        {
                            if (Session["SelectedFolder"].ToString().Trim() == _Dr["DocAttributeValue"].ToString().Trim())
                            {
                                _TViewFolders.Nodes[0].ChildNodes[_TViewFolders.Nodes[0].ChildNodes.Count - 1].Selected = true;
                            }
                        }
                    }

                    _TViewFolders.Nodes[0].Expand();
                }
            }

            //if (Session[SessionName.ProjectId] != null)
            //{
            //    string ProjectId = Session[SessionName.ProjectId].ToString().Trim();

            //    _LblStatus.Text = "Project (" + ProjectId + ") has been selected!";
            //}
        }