Esempio n. 1
0
        protected void tree0_VirtualModeCreateChildren(object sender, TreeListVirtualModeCreateChildrenEventArgs e)
        {
            string nodePath = e.NodeObject == null ? FileManagerHelper.RootFolder : e.NodeObject.ToString();

            // string nodePath = e.NodeObject == null ? Server.MapPath("~") : e.NodeObject.ToString();
            if (Directory.Exists(nodePath))
            {
                List <string> children = new List <string>();
                string[]      names;
                names = Directory.GetDirectories(nodePath);
                foreach (string name in names)
                {
                    children.Add(name);
                }
                e.Children = children;
                names      = Directory.GetFiles(nodePath);
                foreach (string name in names)
                {
                    if (name.IndexOf(".bak") > 0)
                    {
                        children.Add(name);
                    }
                }
                e.Children = children;
            }
        }
        public static void VirtualModeCreateChildren(TreeListVirtualModeCreateChildrenEventArgs e)
        {
            string path = e.NodeObject == null?Request.MapPath("~/") : e.NodeObject.ToString();

            List <string> children = new List <string>();

            if (Directory.Exists(path))
            {
                foreach (string name in Directory.GetDirectories(path))
                {
                    if (!IsSystemName(name))
                    {
                        children.Add(name);
                    }
                }
                foreach (string name in Directory.GetFiles(path))
                {
                    if (!IsSystemName(name))
                    {
                        children.Add(name);
                    }
                }
            }
            e.Children = children;
        }
        protected void treeList_VirtualModeCreateChildren(object sender, TreeListVirtualModeCreateChildrenEventArgs e)
        {
            DataView    dv       = new DataView(GetRoot());
            DataView    children = null;
            DataRowView parent   = e.NodeObject as DataRowView;

            if (parent == null)
            {
                children   = dv;
                e.Children = children;
            }
            else
            {
                string   id  = parent["id"].ToString();
                DataView dv1 = new DataView(GetParent(), "parentid=" + id + "", "name", DataViewRowState.CurrentRows);
                if (dv1.Count <= 0)
                {
                    DataView dv2 = new DataView(CreateTreeList(id));
                    if (dv2.Count > 0)
                    {
                        children   = dv2;
                        e.Children = children;
                    }
                }
                else
                {
                    children   = dv1;
                    e.Children = children;
                }
            }
        }
Esempio n. 4
0
        protected void treeList_VirtualModeCreateChildren(object sender, TreeListVirtualModeCreateChildrenEventArgs e)
        {
            VNPT.Modules.Employees.EmployeesInfo emp = objEmployees.GetEmployeeByCode(this.UserInfo.Username);
            if (emp != null)
            {
                if (UserInfo.IsInRole("ToChucVTT")) // vien thong tinh
                {
                    DataView dv = new DataView(GetTable());
                    //DataView dv = new DataView(GetChild(), "id=4", "sequence", DataViewRowState.CurrentRows);
                    DataView    children = null;
                    DataRowView parent   = e.NodeObject as DataRowView;

                    if (parent == null)
                    {
                        children = dv;

                        e.Children = children;
                    }
                    else
                    {
                        string id = parent["id"].ToString();

                        DataView dv1 = new DataView(CreateTreeList(id));
                        if (dv1.Count > 0)
                        {
                            children   = dv1;
                            e.Children = children;
                        }
                    }
                }
                else
                {
                    DataView    children = null;
                    DataRowView parent   = e.NodeObject as DataRowView;
                    DataView    dv       = new DataView(GetTable_DonViCon(), "parentid=" + objUnit.GetUnit(emp.unitid).parentid + "", "Name", DataViewRowState.CurrentRows);

                    if (parent == null)
                    {
                        children = dv;

                        e.Children = children;
                    }
                    else
                    {
                        string id = parent["id"].ToString();

                        DataView dv1 = new DataView(CreateTreeList(id));
                        if (dv1.Count > 0)
                        {
                            children   = dv1;
                            e.Children = children;
                        }
                    }
                }
            }
        }
        private void TreeListOnVirtualModeCreateChildren(object sender, TreeListVirtualModeCreateChildrenEventArgs e)
        {
            var parentChooser  = ((ColumnChooser)e.NodeObject);
            var columnChoosers = GetColumnChoosers(parentChooser);

            foreach (var chooser in columnChoosers)
            {
                e.Children.Add(chooser);
            }
        }
 protected void tree_VirtualModeCreateChildren(object sender, TreeListVirtualModeCreateChildrenEventArgs e)
 {
     if (e.NodeObject == null)
     {
         e.Children = Session["collection"] as XPCollection <Category>;
     }
     else
     {
         e.Children = ((Category)e.NodeObject).Articles;
     }
 }
        public static void VirtualModeCreateChildren(TreeListVirtualModeCreateChildrenEventArgs e)
        {
            ManageAssetsModel model = (ManageAssetsModel)HttpContext.Current.Session["ManageAssetsModel"];

            if (e.NodeObject == null)
            {
                e.Children = model.GetTopLevelItems();
            }
            else
            {
                e.Children = model.GetItems((SafetyCriticalAssetModel)e.NodeObject);
            }
        }
Esempio n. 8
0
    protected void treeList_VirtualModeCreateChildren(object sender, TreeListVirtualModeCreateChildrenEventArgs e)
    {
        var path = e.NodeObject == null?Page.MapPath("~/") : e.NodeObject.ToString();

        var children = new List <string>();

        if (Directory.Exists(path))
        {
            children.AddRange(Directory.GetDirectories(path).Where(d => !IsSystemName(d)).OrderBy(n => n));
            children.AddRange(Directory.GetFiles(path).Where(d => !IsSystemName(d)).OrderBy(n => n));
        }
        e.Children = children;
    }
Esempio n. 9
0
        public static void VirtualModeCreateChildren(TreeListVirtualModeCreateChildrenEventArgs e)
        {
            Employee parentEmployee = e.NodeObject as Employee;

            if (parentEmployee == null)
            {
                e.Children = nwd.Employees.Where(empl => empl.ReportsTo == null).ToList();
            }
            else
            {
                e.Children = (from empl in nwd.Employees where empl.ReportsTo == parentEmployee.EmployeeID select empl).ToList();
            }
        }
Esempio n. 10
0
    protected void tlGroups_VirtualModeCreateChildren(object sender, TreeListVirtualModeCreateChildrenEventArgs e)
    {
        var nodeKeyObject = e.NodeObject as NodeKeyObject;

        if (nodeKeyObject == null)
        {
            var query = (from n in CacheEntitiesUtil.UmProjects.Values
                         where n.DateDeleted == null
                         select NodeKeyObject.CreateForProject(n));


            var lookup   = query.ToLookup(n => n.ToString());
            var projects = lookup.Select(n => n.First()).ToList();

            e.Children = projects;
            return;
        }

        if (nodeKeyObject.IsProjectType())
        {
            var query = from n in CacheEntitiesUtil.UmGroups.Values
                        let project = CacheEntitiesUtil.UmProjects.GetValueOrDefault(n.ProjectID)
                                      where n.DateDeleted == null && n.ProjectID == nodeKeyObject.ProjectID
                                      let parentGroup = GetParent(n)
                                                        select NodeKeyObject.CreateForGroup(project, parentGroup);

            var lookup = query.ToLookup(n => n.ToString());
            var groups = lookup.Select(n => n.First()).ToList();

            e.Children = groups;
        }
        else if (nodeKeyObject.IsGroupType() || nodeKeyObject.IsChildType())
        {
            var queryChildren = from n in CacheEntitiesUtil.UmGroups.Values
                                let project = CacheEntitiesUtil.UmProjects.GetValueOrDefault(n.ProjectID)
                                              where n.DateDeleted == null &&
                                              n.ProjectID == nodeKeyObject.ProjectID &&
                                              n.ParentID == nodeKeyObject.GroupID
                                              select NodeKeyObject.CreateForGroup(project, n, n.ParentID.GetValueOrDefault());

            var lookupChildren = queryChildren.ToLookup(n => n.ToString());
            var children       = lookupChildren.Select(n => n.First()).ToList();

            e.Children = children;
        }

        else if (nodeKeyObject.IsUserType())
        {
            return;
        }
    }
Esempio n. 11
0
 protected void FileTree_VirtualModeCreateChildren(object sender, TreeListVirtualModeCreateChildrenEventArgs e)
 {
     List<Files> children = null;
     Files parent = e.NodeObject as Files;
     if (parent == null)
     {
         children = TreeViewBuilder.GetFilesTableViewByParentId((int)Session["rsch"], 0);
         if (children.Count == 0) FileTreeList.ClearNodes();
     }
     else
     {
         children = TreeViewBuilder.GetFilesTableViewByParentId((int)Session["rsch"], (int)parent.fileindex);
     }
     e.Children = children;
 }
Esempio n. 12
0
 protected void RegTree_VirtualModeCreateChildren(object sender, TreeListVirtualModeCreateChildrenEventArgs e)
 {
     List<Reg> children = null;
     Reg parent = e.NodeObject as Reg;
     if (parent == null)
     {
         children = TreeViewBuilder.GetRegsTableViewByParentId((int)Session["rsch"], 0);
         if (children.Count == 0) RegTreeList.ClearNodes();
     }
     else
     {
         children = TreeViewBuilder.GetRegsTableViewByParentId((int)Session["rsch"], (int)parent.KeyIndex);
     }
     e.Children = children;
 }
Esempio n. 13
0
        protected void treeList_VirtualModeCreateChildren(object sender, TreeListVirtualModeCreateChildrenEventArgs e)
        {
            object ma_unit = SqlHelper.ExecuteScalar(strconn, "QLDVIEN_QUYEN_GET", UserInfo.Username);

            if (e.NodeObject == null)
            {
                DataTable tb_dstt = SqlHelper.ExecuteDataset(strconn, "SP_CAPTHOCHUC_GET", ma_unit, 0, 0).Tables[0];
                e.Children = new DataView(tb_dstt);
            }
            else
            {
                decimal   id_cha  = Convert.ToDecimal(((DataRowView)e.NodeObject)["MA_DV"]);
                DataTable tb_dstt = SqlHelper.ExecuteDataset(strconn, "SP_CAPTHOCHUC_GET", "", id_cha, 1).Tables[0];
                e.Children = new DataView(tb_dstt);
            }
        }
Esempio n. 14
0
        protected void tree_VirtualModeCreateChildren(object sender, TreeListVirtualModeCreateChildrenEventArgs e)
        {
            //string nodePath = e.NodeObject == null ? FileManagerHelper.RootFolder : e.NodeObject.ToString();
            string nodePath = e.NodeObject == null ? FileManagerHelper.CurrentDataFolder : e.NodeObject.ToString();

            if (Directory.Exists(nodePath))
            {
                List <string> children = new List <string>();
                string[]      names;
                names = Directory.GetDirectories(nodePath);
                foreach (string name in names)
                {
                    children.Add(name);
                }
                names = Directory.GetFiles(nodePath);
                foreach (string name in names)
                {
                    children.Add(name);
                }
                e.Children = children;
            }
        }
    protected void treeList_VirtualModeCreateChildren(object sender, TreeListVirtualModeCreateChildrenEventArgs e)
    {
        string path = e.NodeObject == null?Page.MapPath("~/" + ImagesFolder + "/") : e.NodeObject.ToString();

        List <string> children = new List <string>();

        if (Directory.Exists(path))
        {
            foreach (string name in Directory.GetDirectories(path))
            {
                children.Add(name);
            }
            foreach (string name in Directory.GetFiles(path))
            {
                if (IsImageFile(name))
                {
                    children.Add(name);
                }
            }
        }
        e.Children = children;
    }
 protected void treeList_VirtualModeCreateChildren(object sender, TreeListVirtualModeCreateChildrenEventArgs e)
 {
     if (e.NodeObject == null)
     {
         e.Children = GetListDonVi();
     }
     else
     {
         if (e.NodeObject is VNPT.Modules.Unit.UnitInfo)
         {
             VNPT.Modules.Unit.UnitInfo parent = e.NodeObject as VNPT.Modules.Unit.UnitInfo;
             if (parent.ischild == true)
             {
                 var listDonviCon = GetListDonViCon(parent.id);
                 e.Children = listDonviCon;
             }
             else
             {
                 e.Children = objEmployees.GetEmployeesByUnit(parent.id);
             }
         }
     }
 }
Esempio n. 17
0
 protected void RegTree_VirtualModeCreateChildren(object sender, TreeListVirtualModeCreateChildrenEventArgs e)
 {
     int eltrootid=-1;
     if (Session["eltrootid"] != null) int.TryParse(Session["eltrootid"].ToString(), out eltrootid);
     if (eltrootid > -1)
     {
         int rschsysid = -1;
         if (Session["rschsysid"]!=null) int.TryParse(Session["rschsysid"].ToString(), out rschsysid);
         int rsch = -1;
         if (Session["rsch"] != null) int.TryParse(Session["rsch"].ToString(), out rsch);
         int rsch2 = -1;
         if (Session["rsch2"] != null) int.TryParse(Session["rsch2"].ToString(), out rsch2);
         List<long> rschparids = Session["rschparids"] != null ? (List<long>)Session["rschparids"] : null;
         long rschparid = -1;
         if (rschparids != null)
         {
             if (rschparids.Count > 0) rschparid = rschparids[rschparids.Count - 1];
             else rschparid = 0;
         }
         List<long> rschparids2 = Session["rschparids2"] != null ? (List<long>)Session["rschparids2"] : null;
         long rschparid2 = -1;
         if (rschparids2 != null)
         {
             if (rschparids2.Count > 0) rschparid2 = rschparids2[rschparids2.Count - 1];
             else rschparid2 = 0;
         }
         List<RegCompareTreeItem2> children = null;
         RegCompareTreeItem2 parent = e.NodeObject as RegCompareTreeItem2;
         if (parent == null)
         {
             children = TreeViewBuilder.GetRegsCompTableView2(RegTreeList.TotalNodeCount + 1, 0, rschparid, rschparid2, rschsysid, eltrootid, rsch, -1, rsch2, -1);
             if (children.Count == 0) RegTreeList.ClearNodes();
         }
         else
         {
             children = TreeViewBuilder.GetRegsCompTableView2(RegTreeList.TotalNodeCount + 1, parent.ID, rschparid, rschparid2, rschsysid, parent.EtlID, rsch, parent.RegID, rsch2, parent.RegID2);
         }
         e.Children = children;
     }
 }
Esempio n. 18
0
 protected void RegTree_VirtualModeCreateChildren(object sender, TreeListVirtualModeCreateChildrenEventArgs e)
 {
     //ScriptManager sm = (ScriptManager)Master.Master.FindControl("ScriptManager1");
     //int i;
     //if (sm.IsInAsyncPostBack) i = 1;
     //string ctrlName = Page.Request.Params.Get("__EVENTTARGET");
     //if (RegTreeList.UniqueID == ctrlName) i = 2;
     if (IsPostBack && RegTreeList.UniqueID != Page.Request.Params.Get("__EVENTTARGET")) return;
     List<Reg> children = null;
     Reg parent = e.NodeObject as Reg;
     if (parent == null)
     {
         children = TreeViewBuilder.GetRegsTableViewByParentId((int)Session["rsch"], 0);
         if (children.Count == 0) RegTreeList.ClearNodes();
     }
     else
     {
         children = TreeViewBuilder.GetRegsTableViewByParentId((int)Session["rsch"], (int)parent.KeyIndex);
     }
     e.Children = children;
 }
Esempio n. 19
0
 protected void RegTree_VirtualModeCreateChildren(object sender, TreeListVirtualModeCreateChildrenEventArgs e)
 {
     List<RegsEtl> children = null;
     RegsEtl parent = e.NodeObject as RegsEtl;
     if (parent == null)
     {
         children = TreeViewBuilder.GetRegsEtlTableViewByParentId(GetSelectedSystemId(), 0);
         if (children.Count == 0) RegTreeList.ClearNodes();
     }
     else
     {
         children = TreeViewBuilder.GetRegsEtlTableViewByParentId(GetSelectedSystemId(), (int)parent.KeyIndex);
     }
     e.Children = children;
 }
Esempio n. 20
0
 protected void FileTree_VirtualModeCreateChildren(object sender, TreeListVirtualModeCreateChildrenEventArgs e)
 {
     if (IsPostBack && FileTreeList.UniqueID != Page.Request.Params.Get("__EVENTTARGET")) return;
     List<Files> children = null;
     Files parent = e.NodeObject as Files;
     if (parent == null)
     {
         children = TreeViewBuilder.GetFilesTableViewByParentId((int)Session["rsch"], 0);
         if (children.Count == 0) FileTreeList.ClearNodes();
     }
     else
     {
         children = TreeViewBuilder.GetFilesTableViewByParentId((int)Session["rsch"], (int)parent.fileindex);
     }
     e.Children = children;
 }
Esempio n. 21
0
 protected void RegComp_VirtualModeCreateChildren(object sender, TreeListVirtualModeCreateChildrenEventArgs e)
 {
     int eltrootid = -1;
     if (Session["eltrootid"] != null) int.TryParse(Session["eltrootid"].ToString(), out eltrootid);
     if (eltrootid > -1)
     {
         int rschsysid = -1;
         if (Session["rschsysid"] != null) int.TryParse(Session["rschsysid"].ToString(), out rschsysid);
         int rsch = -1;
         if (Session["rsch"] != null) int.TryParse(Session["rsch"].ToString(), out rsch);
         List<RegCompareTreeItem> children = null;
         RegCompareTreeItem parent = e.NodeObject as RegCompareTreeItem;
         if (parent == null)
         {
             children = TreeViewBuilder.GetRegsCompTableView(RegCompTreeList.TotalNodeCount + 1, 0, rschsysid, eltrootid, rsch, 0);
             if (children.Count == 0) RegTreeList.ClearNodes();
         }
         else
         {
             children = TreeViewBuilder.GetRegsCompTableView(RegCompTreeList.TotalNodeCount + 1, parent.ID, rschsysid, parent.EtlID, rsch, parent.RegID);
         }
         e.Children = children;
     }
 }
    protected void tree_ORG_VirtualModeCreateChildren(object sender, TreeListVirtualModeCreateChildrenEventArgs e)
    {
        string path = e.NodeObject == null ? Page.MapPath("~/") : e.NodeObject.ToString();

        List<string> children = new List<string>();
        if (Directory.Exists(path))
        {
            foreach (string name in Directory.GetDirectories(path))
            {
                if (!IsSystemName(name))
                    children.Add(name);
            }
            foreach (string name in Directory.GetFiles(path))
                if (!IsSystemName(name))
                    children.Add(name);
        }
        e.Children = children;
    }
Esempio n. 23
0
    protected void tlGroups_VirtualModeCreateChildren(object sender, TreeListVirtualModeCreateChildrenEventArgs e)
    {
        var nodeKeyObject = e.NodeObject as NodeKeyObject;

        if (nodeKeyObject == null)
        {
            var query = from n in CacheEntitiesUtil.UmProjects.Values
                        select NodeKeyObject.CreateForProject(n);



            var lookup   = query.ToLookup(n => n.ToString());
            var projects = lookup.Select(n => n.First()).ToList();

            projects = projects.OrderBy(n => n.Project.Name, new StringLogicalComparer()).ToList();

            e.Children = projects;
            return;
        }

        if (nodeKeyObject.IsProjectType())
        {
            var query = from n in CacheEntitiesUtil.UmGroups.Values
                        let project = CacheEntitiesUtil.UmProjects.GetValueOrDefault(n.ProjectID)
                                      where n.DateDeleted == null && n.ProjectID == nodeKeyObject.ProjectID
                                      let parentGroup = GetParent(n)
                                                        select NodeKeyObject.CreateForGroup(project, parentGroup);



            var lookup = query.ToLookup(n => n.ToString());
            var groups = lookup.Select(n => n.First()).ToList();

            groups = groups.OrderBy(n => n.Group.Name, new StringLogicalComparer()).ToList();

            e.Children = groups;
        }
        else if (nodeKeyObject.IsGroupType() || nodeKeyObject.IsChildType())
        {
            var queryChildren = from n in CacheEntitiesUtil.UmGroups.Values
                                let project = CacheEntitiesUtil.UmProjects.GetValueOrDefault(n.ProjectID)
                                              where n.DateDeleted == null &&
                                              n.ProjectID == nodeKeyObject.ProjectID &&
                                              n.ParentID == nodeKeyObject.GroupID
                                              select NodeKeyObject.CreateForGroup(project, n, n.ParentID.GetValueOrDefault());

            var lookupChildren = queryChildren.ToLookup(n => n.ToString());
            var children       = lookupChildren.Select(n => n.First()).ToList();

            e.Children = children;

            var queryUsers = from groupUser in CacheEntitiesUtil.UmGroupUsers.Values
                             where groupUser != null
                             let @group = CacheEntitiesUtil.UmGroups.GetValueOrDefault(groupUser.GroupID)
                                          where @group != null
                                          let project = CacheEntitiesUtil.UmProjects.GetValueOrDefault(@group.ProjectID)
                                                        where project != null
                                                        let user = CacheEntitiesUtil.UmUsers.GetValueOrDefault(groupUser.UserID)
                                                                   where user != null &&
                                                                   groupUser.DateDeleted == null &&
                                                                   groupUser.GroupID == nodeKeyObject.GroupID
                                                                   select NodeKeyObject.CreateForUser(project, @group, user);

            var lookupUsers = queryUsers.ToLookup(n => n.ToString());

            var users = lookupUsers.Select(n => n.First()).ToList();
            users = users.OrderBy(n => n.User.LoginName, new StringLogicalComparer()).ToList();

            foreach (var user in users)
            {
                e.Children.Add(user);
            }
        }
        else if (nodeKeyObject.IsUserType())
        {
            return;
        }
    }