public string InitAlarmNameTreePanel() { try { var root = new Ext.Net.TreeNode(); root.Text = "告警类型"; root.NodeID = "-1&-1"; root.Icon = Icon.House; root.Leaf = false; root.Expanded = true; root.SingleClickExpand = true; AlarmNameTreePanel.Root.Clear(); AlarmNameTreePanel.Root.Add(root); var dict = new BComboBox().GetAlarmDevs(); if (dict != null && dict.Count > 0) { foreach (var key in dict) { var node = new AsyncTreeNode(); node.Text = key.Value; node.NodeID = String.Format("0&{0}", key.Key); node.Icon = Icon.TextListBullets; node.Leaf = false; node.Expanded = false; node.SingleClickExpand = true; root.Nodes.Add(node); } } return(AlarmNameTreePanel.Root.ToJson()); } catch (Exception err) { WebUtility.WriteLog(EnmSysLogLevel.Error, EnmSysLogType.Exception, err.ToString(), Page.User.Identity.Name); WebUtility.ShowMessage(EnmErrType.Error, err.Message); } return(String.Empty); }
public string Ekle_NodeYukle(string NodeID) { int INodeID = int.Parse(NodeID); TreeNodeCollection TNC = new TreeNodeCollection(); if (!string.IsNullOrEmpty(NodeID)) { using (BaglantiCumlesi SME = new BaglantiCumlesi()) { int KatTip = int.Parse(Ekle_ComboBoxTip.SelectedItem.Value); if (KatTip == (int)Class.Sabitler.Dosya.Resim) { Ekle_TreePanelKategoriler.Title = ""; Ekle_TreePanelKategoriler.Title = "Resim Grupları"; } else if (KatTip == (int)Class.Sabitler.Dosya.Video) { Ekle_TreePanelKategoriler.Title = ""; Ekle_TreePanelKategoriler.Title = "Video Grupları"; } var SQL = (from p in SME.tbl_dosyalar_kategori where p.kategori_id == INodeID && p.tip == KatTip select new { p.ad, p.kategori_id, p.id, alt_kategori_sayisi = SME.tbl_dosyalar_kategori.Where(k => k.kategori_id == p.id).Count() }); foreach (var i in SQL) { if (i.alt_kategori_sayisi > 0) { AsyncTreeNode ATN = new AsyncTreeNode(); ATN.Text = i.ad; ATN.NodeID = i.id.ToString(); ATN.Expanded = true; ATN.Checked = ThreeStateBool.False; TNC.Add(ATN); } else { TreeNode TN = new TreeNode(); TN.Text = i.ad; TN.NodeID = i.id.ToString(); TN.Expanded = true; TN.Leaf = true; TN.Checked = ThreeStateBool.False; TNC.Add(TN); } } } } return(TNC.ToJson()); }
public string NodeLoad(string nodeID) { try { Ext.Net.TreeNodeCollection nodes = new Ext.Net.TreeNodeCollection(); List <DAL.DM_DONVI> list = new DM_DONVIController().GetByAll(txtSearch.Text, nodeID); foreach (var item in list) { AsyncTreeNode asyncNode = new AsyncTreeNode(); asyncNode.Text = item.TEN_DONVI; asyncNode.NodeID = item.MA_DONVI; asyncNode.Icon = Icon.House; asyncNode.CustomAttributes.Add(new ConfigItem("MA_DONVI", item.MA_DONVI, ParameterMode.Value)); asyncNode.CustomAttributes.Add(new ConfigItem("TEN_DONVI", item.TEN_DONVI, ParameterMode.Value)); asyncNode.CustomAttributes.Add(new ConfigItem("TEN_TAT", item.TEN_TAT, ParameterMode.Value)); asyncNode.CustomAttributes.Add(new ConfigItem("TEN_DONVI_EN", item.TEN_DONVI_EN, ParameterMode.Value)); asyncNode.CustomAttributes.Add(new ConfigItem("DIA_CHI", item.DIA_CHI, ParameterMode.Value)); asyncNode.Expanded = true; nodes.Add(asyncNode); } return(nodes.ToJson()); } catch (Exception ex) { Dialog.ShowError(ex.Message.ToString()); return(null); } }
public TreeNodeCollection GetNodes(string node) { TreeNodeCollection nodes = new TreeNodeCollection(false); if (!string.IsNullOrEmpty(node)) { for (int i = 1; i < 6; i++) { AsyncTreeNode asyncNode = new AsyncTreeNode(); asyncNode.Text = node + i; asyncNode.NodeID = node + i; nodes.Add(asyncNode); } for (int i = 6; i < 11; i++) { TreeNode treeNode = new TreeNode(); treeNode.Text = node + i; treeNode.NodeID = node + i; treeNode.Leaf = true; nodes.Add(treeNode); } } return(nodes); }
public static TreeNodeCollection BuildFirstLevel() { string path = HttpContext.Current.Server.MapPath("~/Examples/"); DirectoryInfo root = new DirectoryInfo(path); DirectoryInfo[] folders = root.GetDirectories(); folders = SortFolders(root, folders); TreeNodeCollection nodes = new TreeNodeCollection(false); foreach (DirectoryInfo folder in folders) { if ((folder.Attributes & FileAttributes.Hidden) == FileAttributes.Hidden || excludeList.Contains(folder.Name) || folder.Name.StartsWith("_")) { continue; } ExampleConfig cfg = new ExampleConfig(folder.FullName + "\\config.xml", false); string iconCls = string.IsNullOrEmpty(cfg.IconCls) ? "" : cfg.IconCls; AsyncTreeNode node = new AsyncTreeNode(); node.Text = MarkNew(folder.FullName, folder.Name.Replace("_", " ")); node.IconCls = iconCls; string url = PhysicalToVirtual(folder.FullName + "/"); node.NodeID = "e" + Math.Abs(url.ToLower().GetHashCode()); nodes.Add(node); } return(nodes); }
public static TreeNodeCollection BuildFirstLevel() { string path = HttpContext.Current.Server.MapPath("~/Examples/"); DirectoryInfo root = new DirectoryInfo(path); DirectoryInfo[] folders = root.GetDirectories(); folders = SortFolders(root, folders); TreeNodeCollection nodes = new TreeNodeCollection(false); foreach (DirectoryInfo folder in folders) { if ((folder.Attributes & FileAttributes.Hidden) == FileAttributes.Hidden || excludeList.Contains(folder.Name) || folder.Name.StartsWith("_")) { continue; } ExampleConfig cfg = new ExampleConfig(folder.FullName + "\\config.xml", false); string iconCls = string.IsNullOrEmpty(cfg.IconCls) ? "" : cfg.IconCls; AsyncTreeNode node = new AsyncTreeNode(); node.Text = MarkNew(folder.FullName, folder.Name.Replace("_", " ")); node.IconCls = iconCls; string url = PhysicalToVirtual(folder.FullName + "/"); node.NodeID = "e" + Math.Abs(url.ToLower().GetHashCode()); nodes.Add(node); } return nodes; }
public string NodeLoad(string nodeID) { Ext.Net.TreeNodeCollection nodes = new Ext.Net.TreeNodeCollection(); if (!string.IsNullOrEmpty(nodeID)) { int parentRoleID = 0; int.TryParse(nodeID, out parentRoleID); var customerRoles = base.CustomerService.GetCustomerRoleByParentCustomerRoleID(parentRoleID); foreach (var item in customerRoles) { AsyncTreeNode asyncNode = new AsyncTreeNode(); if (item.Active) { asyncNode.Text = item.Name; } else { asyncNode.Text = "<font color='red'>" + item.Name + "</font>"; } asyncNode.NodeID = item.CustomerRoleID.ToString(); asyncNode.Listeners.Click.Fn = "SelectNode"; asyncNode.Expanded = true; nodes.Add(asyncNode); } } return(nodes.ToJson()); }
private void BindModule() { var modules = base.ACLService.GetModulesByModuleID(0); foreach (var item in modules) { TreePanel treePanel = new TreePanel(); treePanel.AutoScroll = true; treePanel.RootVisible = false; treePanel.Border = false; treePanel.Lines = false; treePanel.EnableDD = false; treePanel.ContainerScroll = true; treePanel.Title = " <font color='white'><b>" + item.ModuleName + "</b></font>"; treePanel.Width = 170; treePanel.IconCls = item.iconCls; treePanel.Listeners.BeforeLoad.Fn = "nodeLoad"; AsyncTreeNode asyncNode = new AsyncTreeNode(); asyncNode.Text = item.ModuleName; asyncNode.NodeID = item.ModuleID.ToString(); asyncNode.SingleClickExpand = true; treePanel.Root.Add(asyncNode); treePanel.LayoutConfig.Add(new AccordionLayoutConfig() { Animate = true }); this.pnlModule.Items.Add(treePanel); } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/json"; string nodeId = context.Request["node"]; if (!string.IsNullOrEmpty(nodeId)) { TreeNodeCollection nodes = new TreeNodeCollection(false); for (int i = 1; i < 6; i++) { AsyncTreeNode asyncNode = new AsyncTreeNode(); asyncNode.Text = nodeId + i; asyncNode.NodeID = nodeId + i; nodes.Add(asyncNode); } for (int i = 6; i < 11; i++) { TreeNode node = new TreeNode(); node.Text = nodeId + i; node.NodeID = nodeId + i; node.Leaf = true; nodes.Add(node); } context.Response.Write(nodes.ToJson()); context.Response.End(); } }
protected void NodeLoad(object sender, NodeLoadEventArgs e) { string sql = "select " + DisplayColumn + "," + NodeIDColumn + "," + ParentIDColumnName + " from " + TableName + " where ISNULL(" + ParentIDColumnName + ",'0')='0' or " + ParentIDColumnName + " = '0'"; DataTable table = DataHandler.GetInstance().ExecuteDataTable(sql); foreach (DataRow row in table.Rows) { AsyncTreeNode node = new AsyncTreeNode(); node.NodeID = row[NodeIDColumn].ToString(); node.Text = row[DisplayColumn].ToString(); node.Checked = ThreeStateBool.False; e.Nodes.Add(node); // node.Nodes.Add(GetChildNode(TableName,Text,NodeID,ParentColumnName,row[ParentColumnName].ToString())); } //for (int i = 1; i < 6; i++) //{ // AsyncTreeNode asyncNode = new AsyncTreeNode(); // asyncNode.Text = prefix + e.NodeID + i; // asyncNode.NodeID = e.NodeID + i; // e.Nodes.Add(asyncNode); //} //for (int i = 6; i < 11; i++) //{ // Ext.Net.TreeNode treeNode = new Ext.Net.TreeNode(); // treeNode.Text = prefix + e.NodeID + i; // treeNode.NodeID = e.NodeID + i; // treeNode.Leaf = true; // e.Nodes.Add(treeNode); //} }
/// <summary> /// Load Station Tree Nodes /// </summary> protected void StaIncludedLoaded(object sender, NodeLoadEventArgs e) { try { if (String.IsNullOrEmpty(e.NodeID)) { return; } var ids = WebUtility.ItemSplit(e.NodeID); if (ids.Length != 2) { return; } var lscId = Int32.Parse(ids[0]); var parentId = Int32.Parse(ids[1]); var userData = UserData; var lscUser = userData.LscUsers.Find(lu => { return(lu.LscID == lscId); }); if (lscUser == null) { return; } var groupNodes = lscUser.Group.GroupNodes.FindAll(gti => { return(gti.LastNodeID == parentId && gti.NodeType < EnmNodeType.Dev); }); if (groupNodes.Count == 0) { return; } var staIncluded = StaIncludedField.Text.Trim(); var values = new List <String>(staIncluded.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries)); foreach (var gti in groupNodes) { if (gti.NodeType == EnmNodeType.Sta) { var node = new Ext.Net.TreeNode(); node.Text = gti.NodeName; node.NodeID = gti.NodeID.ToString(); node.Icon = Icon.Building; node.Leaf = true; node.Checked = values.Any(v => v.Equals(node.NodeID)) ? ThreeStateBool.True : ThreeStateBool.False; e.Nodes.Add(node); } else { var node = new AsyncTreeNode(); node.Text = gti.NodeName; node.NodeID = String.Format("{0}&{1}", lscUser.LscID, gti.NodeID); node.Icon = Icon.Building; node.Leaf = false; node.SingleClickExpand = true; e.Nodes.Add(node); } } } catch (Exception err) { WebUtility.WriteLog(EnmSysLogLevel.Error, EnmSysLogType.Exception, err.ToString(), Page.User.Identity.Name); WebUtility.ShowMessage(EnmErrType.Error, err.Message); } }
/// <summary> /// Load Alarm Name Tree Nodes /// </summary> protected void AlarmNameLoaded(object sender, NodeLoadEventArgs e) { try { if (String.IsNullOrEmpty(e.NodeID)) { return; } var ids = WebUtility.ItemSplit(e.NodeID); if (ids.Length != 2) { return; } var type = Int32.Parse(ids[0]); var pId = Int32.Parse(ids[1]); if (type == 0) { var dict = new BComboBox().GetAlarmLogics(pId); if (dict != null && dict.Count > 0) { foreach (var key in dict) { var node = new AsyncTreeNode(); node.Text = key.Value; node.NodeID = String.Format("1&{0}", key.Key); node.Icon = Icon.TextListBullets; node.Leaf = false; node.SingleClickExpand = true; e.Nodes.Add(node); } } } else if (type == 1) { var values = new List <String>(AlarmNameDropDownField.Text.Trim().Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries)); var dict = new BComboBox().GetAlarmNames(pId); if (dict != null && dict.Count > 0) { foreach (var key in dict) { var node = new Ext.Net.TreeNode(); node.Text = key.Value; node.NodeID = key.Key; node.Icon = Icon.TagBlue; node.Leaf = true; node.Checked = values.Any(v => v.Equals(node.NodeID)) ? ThreeStateBool.True : ThreeStateBool.False; e.Nodes.Add(node); } } } } catch (Exception err) { WebUtility.WriteLog(EnmSysLogLevel.Error, EnmSysLogType.Exception, err.ToString(), Page.User.Identity.Name); WebUtility.ShowMessage(EnmErrType.Error, err.Message); } }
private void AddGZRW(Coolite.Ext.Web.TreeNodeCollection nodes, string pid) { var gzrw = dc.Worktasks.Where(p => p.Professionalid == decimal.Parse(pid)); foreach (var r in gzrw) { AsyncTreeNode asyncNode = new AsyncTreeNode(); asyncNode.Text = r.Worktask; asyncNode.NodeID = "w" + r.Worktaskid.ToString(); nodes.Add(asyncNode); } }
public string RefreshCustomerRoleTreeLoad() { Ext.Net.TreeNodeCollection nodes = new Ext.Net.TreeNodeCollection(); AsyncTreeNode rootNode = new AsyncTreeNode(); rootNode.Text = "角色"; rootNode.NodeID = "0"; rootNode.SingleClickExpand = true; rootNode.Expanded = true; nodes.Add(rootNode); return(nodes.ToJson()); }
public string NodeYukle(string NodeID) { int DilID = int.Parse(ComboBoxDil.SelectedItem.Value); int INodeID = int.Parse(NodeID); TreeNodeCollection TNC = new TreeNodeCollection(); if (!string.IsNullOrEmpty(NodeID)) { using (BaglantiCumlesi SME = new BaglantiCumlesi()) { var SQL = (from p in SME.tbl_kategoriler where p.kategori_id == INodeID && p.dil_id == DilID select new { p.ad, p.kategori_id, p.id, alt_kategori_sayisi = SME.tbl_kategoriler.Where(k => k.kategori_id == p.id).Count() }); foreach (var i in SQL) { if (i.alt_kategori_sayisi > 0) { AsyncTreeNode ATN = new AsyncTreeNode(); ATN.Text = i.ad; ATN.NodeID = i.id.ToString(); ATN.Expanded = true; ATN.Checked = ThreeStateBool.False; TNC.Add(ATN); } else { TreeNode TN = new TreeNode(); TN.Text = i.ad; TN.NodeID = i.id.ToString(); TN.Expanded = true; TN.Leaf = true; TN.Checked = ThreeStateBool.False; TNC.Add(TN); } } } } return(TNC.ToJson()); }
private void AddGZRW(Coolite.Ext.Web.TreeNodeCollection nodes, string p) { StringBuilder strSql = new StringBuilder(); strSql.Append(string.Format("select * from worktasks where professionalid={0}", p)); DataTable dt = OracleHelper.Query(strSql.ToString()).Tables[0]; foreach (DataRow r in dt.Rows) { AsyncTreeNode asyncNode = new AsyncTreeNode(); asyncNode.Text = r["WORKTASK"].ToString(); asyncNode.NodeID = "w" + r["WORKTASKID"].ToString(); nodes.Add(asyncNode); } }
public string InitStaTreePanel() { try { if (WLscsComboBox.SelectedItem.Value == null || WLscsComboBox.SelectedItem.Value == String.Empty) { return(String.Empty); } var lscId = Int32.Parse(WLscsComboBox.SelectedItem.Value); var userData = UserData; var lscUser = userData.LscUsers.Find(lu => { return(lu.LscID == lscId); }); if (lscUser == null) { return(String.Empty); } var groupNodes = lscUser.Group.GroupNodes.FindAll(gt => { return(gt.NodeType < EnmNodeType.Dev); }); if (groupNodes.Count == 0) { return(String.Empty); } var root = new Ext.Net.TreeNode(); root.Text = "动力环境监控中心系统"; root.NodeID = "-1&-1"; root.Icon = Icon.House; root.Leaf = false; root.Expanded = true; root.SingleClickExpand = true; StaTreePanel.Root.Clear(); StaTreePanel.Root.Add(root); if (lscUser.Group != null) { var node = new AsyncTreeNode(); node.Text = lscUser.Group.GroupName; node.NodeID = String.Format("{0}&{1}", lscUser.LscID, 0); node.Icon = Icon.House; node.Leaf = false; node.Expanded = true; node.SingleClickExpand = true; root.Nodes.Add(node); } return(StaTreePanel.Root.ToJson()); } catch (Exception err) { WebUtility.WriteLog(EnmSysLogLevel.Error, EnmSysLogType.Exception, err.ToString(), Page.User.Identity.Name); WebUtility.ShowMessage(EnmErrType.Error, err.Message); } return(String.Empty); }
public string DM_NodeYukle(string NodeID) { int INodeID = int.Parse(NodeID); TreeNodeCollection TNC = new TreeNodeCollection(); if (!string.IsNullOrEmpty(NodeID)) { using (BaglantiCumlesi db = new BaglantiCumlesi()) { var SQL = (from p in db.tbl_dosyalar_kategori where p.kategori_id == INodeID && p.tip == (int)Class.Sabitler.Dosya.Video select new { p.ad, p.kategori_id, p.id, alt_kategori_sayisi = db.tbl_dosyalar_kategori.Where(k => k.kategori_id == p.id).Any() }); foreach (var i in SQL) { if (i.alt_kategori_sayisi) { AsyncTreeNode ATN = new AsyncTreeNode(); ATN.Text = i.ad; ATN.NodeID = i.id.ToString(); ATN.Expanded = true; ATN.Checked = ThreeStateBool.False; TNC.Add(ATN); } else { TreeNode TN = new TreeNode(); TN.Text = i.ad; TN.NodeID = i.id.ToString(); TN.Expanded = true; TN.Leaf = true; TN.Checked = ThreeStateBool.False; TNC.Add(TN); } } } } return(TNC.ToJson()); }
public string NodeLoad(string nodeID) { Ext.Net.TreeNodeCollection nodes = new Ext.Net.TreeNodeCollection(); if (!string.IsNullOrEmpty(nodeID)) { int moduleID = 0; int.TryParse(nodeID, out moduleID); var modules = base.ACLService.GetModulesByModuleID(moduleID); foreach (var item in modules) { if (item.childModules.Count() > 0) { AsyncTreeNode asyncNode = new AsyncTreeNode(); asyncNode.Text = item.ModuleName; asyncNode.NodeID = item.ModuleID.ToString(); asyncNode.Expanded = item.Expand; asyncNode.SingleClickExpand = true; nodes.Add(asyncNode); } else { Ext.Net.TreeNode treeNode = new Ext.Net.TreeNode(); treeNode.Text = item.ModuleName; treeNode.NodeID = item.ModuleID.ToString(); treeNode.Listeners.Click.Handler = "addTab(#{TabPanel1}, '" + item.ModuleID + "', '" + CommonHelper.ModifyQueryString(item.href, "WebModuleID=" + item.ModuleID, "") + "', '" + item.ModuleName + "', '" + item.iconCls + "');"; //treeNode.Href = item.href; //if (item.isTarget) //{ // treeNode.HrefTarget = "ContentPage"; //} //else //{ // treeNode.HrefTarget = "_blank"; //} treeNode.IconCls = item.iconCls; treeNode.Leaf = true; nodes.Add(treeNode); } } } return(nodes.ToJson()); }
private void AddType(Type type, TreeNodeCollection typesNodes, bool addBaseTypeNode) { TypeInfo typeInfo = TypeInfo.AddToCache(type); if (addBaseTypeNode) { TreeNode typeNode = new TreeNode(); typeNode.Leaf = false; //typeNode.SingleClickExpand = true; typeNode.Text = this.Context.Server.HtmlEncode(typeInfo.TypeName); typeNode.CustomAttributes.Add(new ConfigItem("marker", "type:" + typeInfo.Type.GUID, ParameterMode.Value)); typeNode.CustomAttributes.Add(new ConfigItem("isType", "true", ParameterMode.Raw)); typeNode.IconCls = typeInfo.IconCls; typesNodes.Add(typeNode); AsyncTreeNode baseTypeNode = new AsyncTreeNode(); baseTypeNode.SingleClickExpand = true; baseTypeNode.Text = "Base types"; baseTypeNode.CustomAttributes.Add(new ConfigItem("marker", "type:" + typeInfo.Type.GUID, ParameterMode.Value)); typeNode.Nodes.Add(baseTypeNode); return; } TreeNodeBase treeNode; if (typeInfo.BaseType != null || typeInfo.Interfaces.Length > 0) { treeNode = new AsyncTreeNode(); //treeNode.SingleClickExpand = true; } else { treeNode = new TreeNode(); treeNode.Leaf = true; } treeNode.Text = this.Context.Server.HtmlEncode(typeInfo.TypeName); //treeNode.NodeID = "type:" + typeInfo.Type.GUID; treeNode.CustomAttributes.Add(new ConfigItem("marker", "type:" + typeInfo.Type.GUID, ParameterMode.Value)); treeNode.CustomAttributes.Add(new ConfigItem("isType", "true", ParameterMode.Raw)); treeNode.IconCls = typeInfo.IconCls; typesNodes.Add(treeNode); }
private void BuildTree() { tpkind.Root.Clear(); Coolite.Ext.Web.TreeNode root = new Coolite.Ext.Web.TreeNode(); root.Text = "-1"; root.NodeID = "专业管理"; tpkind.Root.Add(root); var dm = dc.SqsDomain.Where(p => p.Fid == -1 && p.Usingdept == SessionBox.GetUserSession().DeptNumber); foreach (var r in dm) { //Coolite.Ext.Web.TreeNode asyncNode = new Coolite.Ext.Web.TreeNode(); AsyncTreeNode asyncNode = new AsyncTreeNode(); asyncNode.Text = r.Dname; asyncNode.NodeID = r.Did.ToString(); asyncNode.Qtip = "满分分值:" + r.Fullscore.ToString(); root.Nodes.Add(asyncNode); } }
private void BuildNamespace(string requestedNS, TreeNodeCollection nodes) { ICollection <NamespaceInfo> list; NamespaceInfo ns; if (requestedNS == "_root") { list = ReflectionHelper.Namespaces; foreach (NamespaceInfo info in list) { TreeNodeBase treeNode; if (info.NamespaceTypes.Count == 0) { treeNode = new TreeNode(); treeNode.Leaf = true; } else { treeNode = new AsyncTreeNode(); treeNode.SingleClickExpand = true; } treeNode.Text = this.Context.Server.HtmlEncode(info.NamespaceName); //treeNode.NodeID = "ns:"+info.FullName; treeNode.CustomAttributes.Add(new ConfigItem("marker", "ns:" + info.NamespaceName, ParameterMode.Value)); treeNode.IconCls = "namespace-icon"; nodes.Add(treeNode); } nodes.Sort((x, y) => x.Text.CompareTo(y.Text)); } else { ns = NamespaceInfo.GetByName(requestedNS); if (ns != null) { foreach (Type type in ns.NamespaceTypes) { this.AddType(type, nodes, true); } } nodes.Sort((x, y) => x.Text.CompareTo(y.Text)); } }
public TreeNodeCollection GetNodes(string node) { TreeNodeCollection nodes = new TreeNodeCollection(false); if (!string.IsNullOrEmpty(node)) { var list = CategoryBLL.GetList(int.Parse(node),0); foreach (Model.CategoryTbl category in list) { AsyncTreeNode asyncNode = new AsyncTreeNode(); asyncNode.Text = category.categoryname; asyncNode.NodeID = category.cateid.ToString(); asyncNode.Cls = Icon.Folder.ToString(); asyncNode.Icon = Icon.Folder; asyncNode.Listeners.Click.Handler = "Northwind.addTab({ title: '" + category.categoryname + "', url:'/Video/index?id=" + category.cateid.ToString() + "', icon: 'icon-folder'})"; nodes.Add(asyncNode); } } return nodes; }
public string NodeLoad(string nodeID) { Coolite.Ext.Web.TreeNodeCollection nodes = new Coolite.Ext.Web.TreeNodeCollection(); var dm = dc.SqsDomain.Where(p => p.Fid == decimal.Parse(nodeID)); foreach (var r in dm) { //Coolite.Ext.Web.TreeNode asyncNode = new Coolite.Ext.Web.TreeNode(); AsyncTreeNode asyncNode = new AsyncTreeNode(); asyncNode.Text = r.Dname; asyncNode.NodeID = r.Did.ToString(); asyncNode.Qtip = "满分分值:" + r.Fullscore.ToString() + ",系数:" + r.Rate.ToString(); if (dc.SqsDomain.Count(p => p.Fid == r.Did) == 0) { asyncNode.Listeners.Click.Handler = string.Format("Coolite.AjaxMethods.GVLoad({0});", r.Did.ToString()); asyncNode.Leaf = true; } nodes.Add(asyncNode); } return(nodes.ToJson()); }
private void BuildTreeYh() { tpYh.Root.Clear(); var type = from t in dc.CsBaseinfoset where t.Fid == int.Parse(PublicMethod.ReadXmlReturnNode("ZY", this)) orderby t.Infoid ascending select new { t.Infoid, t.Infoname }; var lavel = from c in dc.CsBaseinfoset where c.Fid == int.Parse(PublicMethod.ReadXmlReturnNode("YHJB", this)) orderby c.Infoid select new { c.Infoid, c.Infoname }; Coolite.Ext.Web.TreeNode root = new Coolite.Ext.Web.TreeNode(); root.NodeID = "-1"; root.Text = "隐患信息"; tpYh.Root.Add(root); foreach (var r in type) { Coolite.Ext.Web.TreeNode asyncNode = new Coolite.Ext.Web.TreeNode(); asyncNode.NodeID = r.Infoid.ToString(); asyncNode.Text = r.Infoname; //asyncNode.Icon = Icon.UserEarth; foreach (var i in lavel) { AsyncTreeNode asyncc = new AsyncTreeNode(i.Infoid.ToString(), i.Infoname); //asyncc.Icon = Icon.UserEarth; asyncc.CustomAttributes.Add(new ConfigItem("data", r.Infoid.ToString(), ParameterMode.Value)); asyncNode.Nodes.Add(asyncc); } root.Nodes.Add(asyncNode); } }
private void BuildTree() { tpPerson.Root.Clear(); var dept = dc.Department.First(p => p.Deptnumber == SessionBox.GetUserSession().DeptNumber); Coolite.Ext.Web.TreeNode root = new Coolite.Ext.Web.TreeNode(dept.Deptnumber, dept.Deptname, Icon.UserHome); tpPerson.Root.Add(root); var per = (from v in dc.Vgetpl where v.Operatortag == "YH_fcfk" && v.Moduletag == "YSNewProcess_YHProcess" && v.Unitid == SessionBox.GetUserSession().DeptNumber select new { v.Deptnumber, v.Deptname }).Distinct().OrderBy(p => p.Deptname); foreach (var r in per) { AsyncTreeNode asyncNode = new AsyncTreeNode(r.Deptnumber, r.Deptname); asyncNode.Icon = Icon.UserEarth; root.Nodes.Add(asyncNode); } }
private void BuildTreePlace() { tpPlace.Root.Clear(); var dept = dc.Department.First(p => p.Deptnumber == SessionBox.GetUserSession().DeptNumber); Coolite.Ext.Web.TreeNode root = new Coolite.Ext.Web.TreeNode(dept.Deptnumber, dept.Deptname, Icon.HouseStar); tpPlace.Root.Add(root); var per = from v in dc.Placeareas where v.Maindeptid == SessionBox.GetUserSession().DeptNumber select new { v.Pareasid, v.Pareasname }; foreach (var r in per) { AsyncTreeNode asyncNode = new AsyncTreeNode(r.Pareasid.ToString(), r.Pareasname); asyncNode.Icon = Icon.HouseKey; root.Nodes.Add(asyncNode); } }
protected void NodeLoad(object sender, NodeLoadEventArgs e) { if (!string.IsNullOrEmpty(e.NodeID)) { System.Data.DataTable dtroot = new DataTable(); if (e.NodeID == "0") { dtroot = GetFather(e.NodeID); } else { dtroot = GetTree(e.NodeID); } foreach (System.Data.DataRow dr in dtroot.Rows) { //核心 if (dr["isleaf"].ToString().Trim() == "0") { AsyncTreeNode asyncNode = new AsyncTreeNode(); asyncNode.Text = dr["name"].ToString().Trim(); asyncNode.NodeID = dr["structid"].ToString().Trim(); asyncNode.SingleClickExpand = true; asyncNode.Checked = ThreeStateBool.False; e.Nodes.Add(asyncNode); } else { Ext.Net.TreeNode treeNode = new Ext.Net.TreeNode(); treeNode.Text = dr["name"].ToString().Trim(); treeNode.NodeID = dr["structid"].ToString().Trim(); treeNode.Leaf = true; treeNode.Qtip = dr["structid"].ToString().Trim() + "_" + dr["name"].ToString().Trim(); treeNode.Checked = ThreeStateBool.False; treeNode.Icon = Icon.ControlBlankBlue; e.Nodes.Add(treeNode); } } } }
public string NodeLoad(string nodeId) { try { var nodes = new TreeNodeCollection(); int?parentId = null; if (int.TryParse(nodeId, out var parseParentId)) { parentId = parseParentId; } var obj = cat_DepartmentServices.GetAll(parentId, null, null, null, false, null, null, null); foreach (var item in obj) { var asyncNode = new AsyncTreeNode { Text = item.Name, NodeID = item.Id.ToString(), Icon = Icon.House }; asyncNode.CustomAttributes.Add(new ConfigItem("Name", item.Name, ParameterMode.Value)); asyncNode.CustomAttributes.Add(new ConfigItem("ShortName", item.ShortName, ParameterMode.Value)); asyncNode.CustomAttributes.Add(new ConfigItem("Order", item.Order.ToString(), ParameterMode.Value)); asyncNode.CustomAttributes.Add(new ConfigItem("IsPrimary", item.IsPrimary ? "<img src='/Resource/Images/check.png'>" : "<img src='/Resource/Images/uncheck.gif'>", ParameterMode.Value)); asyncNode.CustomAttributes.Add(new ConfigItem("IsLocked", item.IsLocked ? "<img src='/Resource/Images/check.png'>" : "<img src='/Resource/Images/uncheck.gif'>", ParameterMode.Value)); asyncNode.Expanded = true; nodes.Add(asyncNode); } return(nodes.ToJson()); } catch (Exception ex) { Dialog.ShowError(ex.Message); return(null); } }
private void BuildTree() { tpZY.Root.Clear(); Coolite.Ext.Web.TreeNode root = new Coolite.Ext.Web.TreeNode(); root.Text = "-1"; root.NodeID = "辨识单元"; tpZY.Root.Add(root); StringBuilder strSql = new StringBuilder(); strSql.Append(string.Format("select * from CS_BASEINFOSET where FID={0} order by INFOID", PublicMethod.ReadXmlReturnNode("ZY", this))); DataTable dt = OracleHelper.Query(strSql.ToString()).Tables[0]; foreach (DataRow r in dt.Rows) { //Coolite.Ext.Web.TreeNode asyncNode = new Coolite.Ext.Web.TreeNode(); AsyncTreeNode asyncNode = new AsyncTreeNode(); asyncNode.Text = r["INFONAME"].ToString(); asyncNode.NodeID = "z" + r["INFOID"].ToString(); //AddGZRW_Temp(asyncNode.Nodes, r["INFOID"].ToString()); //AddGZRW(asyncNode.Nodes, r["INFOID"].ToString()); root.Nodes.Add(asyncNode); } }
private void BuildTreeHaz() { tpHaz.Root.Clear(); Coolite.Ext.Web.TreeNode root = new Coolite.Ext.Web.TreeNode(); root.NodeID = "-1"; root.Text = "辨识单元"; tpHaz.Root.Add(root); var type = from t in dc.CsBaseinfoset where t.Fid == int.Parse(PublicMethod.ReadXmlReturnNode("ZY", this)) orderby t.Infoid ascending select new { t.Infoid, t.Infoname }; foreach (var r in type) { AsyncTreeNode asyncNode = new AsyncTreeNode(); asyncNode.Text = r.Infoname; asyncNode.NodeID = "z" + r.Infoid.ToString(); root.Nodes.Add(asyncNode); } }
private Coolite.Ext.Web.TreeNodeCollection LoadTree(Coolite.Ext.Web.TreeNodeCollection nodes) { if (nodes == null) { nodes = new Coolite.Ext.Web.TreeNodeCollection(); }//根节点为null时 tpPerson.Root.Clear(); Coolite.Ext.Web.TreeNode root = new Coolite.Ext.Web.TreeNode(); if (cbbJctype.SelectedItem.Value == "2") { var dept = dc.Department.First(p => p.Deptnumber == "000000000"); root = new Coolite.Ext.Web.TreeNode(dept.Deptnumber, dept.Deptname, Icon.UserHome); tpPerson.Root.Add(root); var per = (from d in dc.Department where //d.Deptnumber.Substring(0, 4) == "1303" //&& (d.Deptnumber.Substring(7) == "00" || d.Deptlevel == "正科级") //&& d.Visualfield == 3 select new { d.Deptnumber, d.Deptname }).OrderBy(p => p.Deptname); foreach (var r in per) { AsyncTreeNode asyncNode = new AsyncTreeNode(r.Deptnumber, r.Deptname); asyncNode.Icon = Icon.UserEarth; root.Nodes.Add(asyncNode); } //局端排查人 var person = from p in dc.Person from d in dc.Department where p.Areadeptid == d.Deptnumber && p.Visualfield == 100//返回空结构 select new { p.Personnumber, p.Name, d.Deptname }; SelectedStore.DataSource = person; SelectedStore.DataBind(); } else { var dept = dc.Department.First(p => p.Deptnumber == SessionBox.GetUserSession().DeptNumber); root = new Coolite.Ext.Web.TreeNode(dept.Deptnumber, dept.Deptname, Icon.UserHome); tpPerson.Root.Add(root); var per = (from v in dc.Vgetpl where v.Operatortag == "YH_fcfk" && v.Moduletag == "HiddenDanage_HDprocess" && v.Unitid == SessionBox.GetUserSession().DeptNumber select new { v.Deptnumber, v.Deptname }).Distinct().OrderBy(p => p.Deptname); foreach (var r in per) { AsyncTreeNode asyncNode = new AsyncTreeNode(r.Deptnumber, r.Deptname); asyncNode.Icon = Icon.UserEarth; root.Nodes.Add(asyncNode); } //排查人初始绑定 var person = (from pl in dc.Vgetpl where pl.Moduletag == "YSNewProcess_YHProcess" && pl.Operatortag == "YH_fcfk" && pl.Unitid == SessionBox.GetUserSession().DeptNumber && pl.Personnumber == SessionBox.GetUserSession().PersonNumber select new { pl.Personnumber, pl.Name, pl.Deptname }).Distinct(); if (person.Where(p => p.Personnumber == SessionBox.GetUserSession().PersonNumber).Count() > 0) { cbbPerson.SelectedItem.Value = SessionBox.GetUserSession().PersonNumber; var person1 = person.Where(p => p.Personnumber == SessionBox.GetUserSession().PersonNumber); SelectedStore.DataSource = person1; SelectedStore.DataBind(); } } return(nodes); }