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 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()); }
public string GetMenuById(int aid) { try { Ext.Net.TreeNodeCollection collect = new Ext.Net.TreeNodeCollection(); Ext.Net.TreeNode root = InitRoot(); List <SystemMenuWrapper> menus = SystemMenuWrapper.GetSystemMenusByApplication(aid); foreach (SystemMenuWrapper menu in menus) { SystemMenuWrapper pMenu = menu.ParentMenuID; if (pMenu == null) { LinqTree(menus, root, 0); break; } } collect.Add(root); ResourceManager.AjaxSuccess = true; return(collect.ToJson()); } catch (Exception ex) { ResourceManager.AjaxSuccess = false; ResourceManager.AjaxErrorMessage = string.Format(ex.Message); return(""); } }
public string CreateTreeNodes() { try { var nodes = new Ext.Net.TreeNodeCollection(); var root = new Ext.Net.TreeNode(); root.Text = "ColumnNames"; root.NodeID = "root_0"; root.Icon = Icon.House; root.Leaf = false; root.Expanded = true; root.SingleClickExpand = true; var reportSettingEntity = new BSetting(); var lscUsers = UserData.LscUsers; foreach (var lscUser in lscUsers) { if (lscUser.AlarmSoundFiterItem == null) { continue; } var node = new Ext.Net.TreeNode(); node.Text = lscUser.LscName; node.NodeID = lscUser.LscID.ToString(); node.Icon = Icon.House; node.CustomAttributes.Add(new ConfigItem("SpUID", lscUser.UID, ParameterMode.Value)); node.CustomAttributes.Add(new ConfigItem("SpDisconnect", lscUser.AlarmSoundFiterItem.SpDisconnect.ToString(), ParameterMode.Value)); node.CustomAttributes.Add(new ConfigItem("AL1Enabled", lscUser.AlarmSoundFiterItem.AL1Enabled.ToString(), ParameterMode.Value)); node.CustomAttributes.Add(new ConfigItem("AL2Enabled", lscUser.AlarmSoundFiterItem.AL2Enabled.ToString(), ParameterMode.Value)); node.CustomAttributes.Add(new ConfigItem("AL3Enabled", lscUser.AlarmSoundFiterItem.AL3Enabled.ToString(), ParameterMode.Value)); node.CustomAttributes.Add(new ConfigItem("AL4Enabled", lscUser.AlarmSoundFiterItem.AL4Enabled.ToString(), ParameterMode.Value)); node.CustomAttributes.Add(new ConfigItem("SpDevFilter", lscUser.AlarmSoundFiterItem.SpDevFilter, ParameterMode.Value)); node.CustomAttributes.Add(new ConfigItem("SpNodeFilter", lscUser.AlarmSoundFiterItem.SpNodeFilter, ParameterMode.Value)); node.CustomAttributes.Add(new ConfigItem("SpLoop", lscUser.AlarmSoundFiterItem.SpLoop.ToString(), ParameterMode.Value)); node.CustomAttributes.Add(new ConfigItem("SpArea2", lscUser.AlarmSoundFiterItem.SpArea2.ToString(), ParameterMode.Value)); node.CustomAttributes.Add(new ConfigItem("SpArea3", lscUser.AlarmSoundFiterItem.SpArea3.ToString(), ParameterMode.Value)); node.CustomAttributes.Add(new ConfigItem("SpStation", lscUser.AlarmSoundFiterItem.SpStation.ToString(), ParameterMode.Value)); node.CustomAttributes.Add(new ConfigItem("SpDevice", lscUser.AlarmSoundFiterItem.SpDevice.ToString(), ParameterMode.Value)); node.CustomAttributes.Add(new ConfigItem("SpNode", lscUser.AlarmSoundFiterItem.SpNode.ToString(), ParameterMode.Value)); node.CustomAttributes.Add(new ConfigItem("SpALDesc", lscUser.AlarmSoundFiterItem.SpALDesc.ToString(), ParameterMode.Value)); node.Leaf = true; root.Nodes.Add(node); } nodes.Add(root); return(nodes.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 CreateTreeNodes() { try { var nodes = new Ext.Net.TreeNodeCollection(); var root = new Ext.Net.TreeNode(); root.Text = "ColumnNames"; root.NodeID = "old_root_0"; root.Icon = Icon.TextColumns; root.Leaf = false; root.Expanded = true; root.SingleClickExpand = true; if (LscsComboBox.SelectedItem != null) { var ids = WebUtility.ItemSplit(LscsComboBox.SelectedItem.Value); if (ids.Length == 2) { var lscId = Int32.Parse(ids[0]); var groupId = Int32.Parse(ids[1]); var userData = UserData; var lscUser = userData.LscUsers.Find(lui => { return(lui.LscID == lscId); }); if (lscUser != null) { for (int i = 0; i < lscUser.ActiveValuesFiterItem.Count; i++) { var node = new Ext.Net.TreeNode(); node.Text = lscUser.ActiveValuesFiterItem[i].ColName; node.NodeID = String.Format("old_node_{0}", i); node.Icon = Icon.TableColumn; node.CustomAttributes.Add(new ConfigItem("filterItem", lscUser.ActiveValuesFiterItem[i].FilterItem, ParameterMode.Value)); node.CustomAttributes.Add(new ConfigItem("filterType", ((int)lscUser.ActiveValuesFiterItem[i].FilterType).ToString(), ParameterMode.Value)); node.CustomAttributes.Add(new ConfigItem("vNodeType", ((int)lscUser.ActiveValuesFiterItem[i].NodeType).ToString(), ParameterMode.Value)); node.CustomAttributes.Add(new ConfigItem("devName", lscUser.ActiveValuesFiterItem[i].DevName, ParameterMode.Value)); node.CustomAttributes.Add(new ConfigItem("isNew", Boolean.FalseString, ParameterMode.Value)); node.Leaf = true; node.SingleClickExpand = true; root.Nodes.Add(node); } } } } nodes.Add(root); return(nodes.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 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 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()); }
public string AddTreeNode(int i) { try { var nodes = new Ext.Net.TreeNodeCollection(); var node = new Ext.Net.TreeNode(); node.Text = String.Format("新增列{0}", i); node.NodeID = String.Format("new_node_{0}", i); node.Icon = Icon.TableColumnAdd; node.CustomAttributes.Add(new ConfigItem("filterType", ((int)EnmAlarmFiterType.AlarmDesc).ToString(), ParameterMode.Value)); node.CustomAttributes.Add(new ConfigItem("filterItem", "未定义", ParameterMode.Value)); node.CustomAttributes.Add(new ConfigItem("isNew", Boolean.TrueString, ParameterMode.Value)); node.Leaf = true; node.SingleClickExpand = true; nodes.Add(node); return(nodes.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 void RaiseAjaxPostBackEvent(string eventArgument, ParameterCollection extraParams) { bool success = true; string msg = null; Response response = new Response(); try { if (eventArgument.IsEmpty()) { throw new ArgumentNullException("eventArgument"); } XmlNode xmlData = this.SubmitConfig; string data = null; if (xmlData != null) { XmlNode serviceNode = xmlData.SelectSingleNode("config/serviceParams"); if (serviceNode != null) { data = serviceNode.InnerText; } } switch (eventArgument) { case "nodeload": NodeLoadEventArgs e = new NodeLoadEventArgs(extraParams); PageTreeLoader loader = (PageTreeLoader)this.Loader.Primary; loader.OnNodeLoad(e); TreeNodeCollection nodes = e.Nodes; success = e.Success; msg = e.ErrorMessage; response.Data = nodes != null?nodes.ToJson() : null; break; case "submit": SubmitEventArgs se = new SubmitEventArgs(extraParams, JSON.Deserialize <SubmittedNode>(data, new CamelCasePropertyNamesContractResolver())); this.OnSubmit(se); break; case "raRename": RemoteRenameEventArgs rr = new RemoteRenameEventArgs(data, extraParams); this.OnRemoteRename(rr); success = rr.Accept; msg = rr.RefusalMessage; break; case "raRemove": RemoteActionEventArgs rrm = new RemoteActionEventArgs(data, extraParams); this.OnRemoteRemove(rrm); success = rrm.Accept; msg = rrm.RefusalMessage; break; case "raInsert": case "raAppend": RemoteAppendEventArgs ra = new RemoteAppendEventArgs(eventArgument == "raInsert", data, extraParams); this.OnRemoteAppend(ra); success = ra.Accept; msg = ra.RefusalMessage; break; case "raMove": RemoteMoveEventArgs rm = new RemoteMoveEventArgs(data, extraParams); this.OnRemoteMove(rm); success = rm.Accept; msg = rm.RefusalMessage; break; } } catch (Exception ex) { success = false; msg = this.IsDebugging ? ex.ToString() : ex.Message; if (this.ResourceManager.RethrowAjaxExceptions) { throw; } } response.Success = success; response.Message = msg; ResourceManager.ServiceResponse = response; }
public string GetTreeNodes(string searchfilters) { TreeNodeCollection nodes = new TreeNodeCollection(); TreeNode root = new TreeNode(); root.Text = "root"; root.Icon = Icon.Folder; nodes.Add(root); //if (menus == null || menus.Count == 0) // return nodes; List<SPCodeWrapper> allcodes = null; Dictionary<string, string> search = null; if (!string.IsNullOrEmpty(searchfilters)) { search = JSON.Deserialize<Dictionary<string, string>>(searchfilters); } int? channelID = null; int? clientID = null; string mo = string.Empty; string spnumber = string.Empty; if (search != null) { if (!string.IsNullOrEmpty(search["ChannelID"])) { channelID = Convert.ToInt32(search["ChannelID"]); } if (!string.IsNullOrEmpty(search["ClientID"])) { clientID = Convert.ToInt32(search["ClientID"]); } if (!string.IsNullOrEmpty(search["Mo"])) { mo = search["Mo"]; } if (!string.IsNullOrEmpty(search["SpNumber"])) { spnumber = search["SpNumber"]; } } if(ChannelID!=null) { allcodes = SPCodeWrapper.FindAllByChannelIDAndClientIDAndMoAndSpNumber(ChannelID.Id, null, mo, spnumber); } else { allcodes = SPCodeWrapper.FindAllByChannelIDAndClientIDAndMoAndSpNumber(channelID, clientID, mo, spnumber); } for (int i = 0; i < allcodes.Count; i++) { if (allcodes[i].GetParentCode(allcodes) == allcodes[i]) { TreeNode mainNode = new TreeNode(); mainNode.Text = allcodes[i].MoCode; mainNode.NodeID = "nod" + allcodes[i].Id.ToString(); mainNode.Icon = Icon.Script; mainNode.CustomAttributes.Add(new ConfigItem("MoCode", allcodes[i].MoCode, ParameterMode.Value)); mainNode.CustomAttributes.Add(new ConfigItem("ChannelName", allcodes[i].ChannelID_Name, ParameterMode.Value)); mainNode.CustomAttributes.Add(new ConfigItem("ChannelID", allcodes[i].ChannelID.Id.ToString(), ParameterMode.Value)); mainNode.CustomAttributes.Add(new ConfigItem("AssignedClientName", allcodes[i].AssignedClientName, ParameterMode.Value)); mainNode.CustomAttributes.Add(new ConfigItem("CodeID", allcodes[i].Id.ToString(), ParameterMode.Value)); mainNode.CustomAttributes.Add(new ConfigItem("Disable", allcodes[i].IsDiable.ToString(), ParameterMode.Value)); GenerateSubTreeNode(mainNode, allcodes[i], allcodes); root.Nodes.Add(mainNode); } } return nodes.ToJson(); }
public string GetTreeNodes(string searchfilters) { TreeNodeCollection nodes = new TreeNodeCollection(); TreeNode root = new TreeNode(); root.Text = "root"; root.Icon = Icon.Folder; nodes.Add(root); //if (menus == null || menus.Count == 0) // return nodes; List <SPCodeWrapper> allcodes = null; Dictionary <string, string> search = null; if (!string.IsNullOrEmpty(searchfilters)) { search = JSON.Deserialize <Dictionary <string, string> >(searchfilters); } int? channelID = null; int? clientID = null; string mo = string.Empty; string spnumber = string.Empty; if (search != null) { if (!string.IsNullOrEmpty(search["ChannelID"])) { channelID = Convert.ToInt32(search["ChannelID"]); } if (!string.IsNullOrEmpty(search["ClientID"])) { clientID = Convert.ToInt32(search["ClientID"]); } if (!string.IsNullOrEmpty(search["Mo"])) { mo = search["Mo"]; } if (!string.IsNullOrEmpty(search["SpNumber"])) { spnumber = search["SpNumber"]; } } if (ChannelID != null) { allcodes = SPCodeWrapper.FindAllByChannelIDAndClientIDAndMoAndSpNumber(ChannelID.Id, null, mo, spnumber); } else { allcodes = SPCodeWrapper.FindAllByChannelIDAndClientIDAndMoAndSpNumber(channelID, clientID, mo, spnumber); } for (int i = 0; i < allcodes.Count; i++) { if (allcodes[i].GetParentCode(allcodes) == allcodes[i]) { TreeNode mainNode = new TreeNode(); mainNode.Text = allcodes[i].MoCode; mainNode.NodeID = "nod" + allcodes[i].Id.ToString(); mainNode.Icon = Icon.Script; mainNode.CustomAttributes.Add(new ConfigItem("MoCode", allcodes[i].MoCode, ParameterMode.Value)); mainNode.CustomAttributes.Add(new ConfigItem("ChannelName", allcodes[i].ChannelID_Name, ParameterMode.Value)); mainNode.CustomAttributes.Add(new ConfigItem("ChannelID", allcodes[i].ChannelID.Id.ToString(), ParameterMode.Value)); mainNode.CustomAttributes.Add(new ConfigItem("AssignedClientName", allcodes[i].AssignedClientName, ParameterMode.Value)); mainNode.CustomAttributes.Add(new ConfigItem("CodeID", allcodes[i].Id.ToString(), ParameterMode.Value)); mainNode.CustomAttributes.Add(new ConfigItem("Disable", allcodes[i].IsDiable.ToString(), ParameterMode.Value)); GenerateSubTreeNode(mainNode, allcodes[i], allcodes); root.Nodes.Add(mainNode); } } return(nodes.ToJson()); }
public string RefreshMenu() { Ext.Net.TreeNodeCollection nodes = this.LoadFortuneGroup(null); return(nodes.ToJson()); }
public string RefreshMenu() { Ext.Net.TreeNodeCollection nodes = this.BuildTree(null); return(nodes.ToJson()); }
public string OnLineUserNodeLoad(string nodeID, string netID) { Ext.Net.TreeNodeCollection nodes = new Ext.Net.TreeNodeCollection(); if (nodeID.Equals("0") && netID.Equals("0")) { var enterprises = base.EnterpriseService.GetAllEnterprises(); foreach (var item in enterprises) { if (item.Published) { AsyncTreeNode asyncNode = new AsyncTreeNode(); asyncNode.Text = item.EntName; asyncNode.NodeID = "Enterprise_" + item.EntId.ToString(); asyncNode.IconCls = "root"; asyncNode.Expanded = true; asyncNode.SingleClickExpand = true; asyncNode.CustomAttributes.Add(new ConfigItem("NetID", item.EntId.ToString())); nodes.Add(asyncNode); } } } else if (nodeID.IndexOf("Department_") >= 0 || nodeID.IndexOf("Enterprise_") >= 0) { int departmentID = 0; if (nodeID.IndexOf("Department_") >= 0) { int.TryParse(nodeID.Replace("Department_", ""), out departmentID); } int enterpriseID = 0; int.TryParse(netID, out enterpriseID); var departments = base.EnterpriseService.GetDepartmentByParentID(enterpriseID, departmentID); var allUsers = this.OnlineUserService.GetRegisteredUsersOnline(); foreach (var item in departments) { AsyncTreeNode asyncNode = new AsyncTreeNode(); asyncNode.Text = item.DepName; asyncNode.NodeID = "Department_" + item.DepartmentID.ToString(); asyncNode.Expanded = true; asyncNode.SingleClickExpand = true; asyncNode.CustomAttributes.Add(new ConfigItem("NetID", netID)); nodes.Add(asyncNode); } if (departmentID != 0) { var users = allUsers.Where(p => p.AssociatedCustomer.SCustomerInfo.DepartmentID.Equals(departmentID)); foreach (var user in users) { Ext.Net.TreeNode treeNode = new Ext.Net.TreeNode(); treeNode.Text = user.AssociatedCustomer.SCustomerInfo.FullName; treeNode.NodeID = user.AssociatedCustomer.CustomerGUID.ToString(); treeNode.Listeners.Click.Handler = "window.parent.newTab('PersonInfo" + user.AssociatedCustomer.CustomerGUID.ToString() + "', '" + HozestERP.Common.Utils.CommonHelper.GetStoreLocation() + "ManageSystem/UserAbout.aspx?CustomerID=" + user.AssociatedCustomer.CustomerID.ToString() + "', '" + user.AssociatedCustomer.Username + " 基本信息')"; try { if (user.AssociatedCustomer.SCustomerInfo.Gender.CodeName.Equals("男")) { treeNode.IconCls = "U01"; } else { treeNode.IconCls = "U11"; } } catch { treeNode.IconCls = "U01"; } treeNode.Leaf = true; nodes.Add(treeNode); } } } return(nodes.ToJson()); }