コード例 #1
0
 private void CreaMenuHijo(int idMenu, Node menuPadre)
 {
   try
   {
     IList<co_ca_menu> listMenuHijos = new bf_ca_menu().GetData(new co_ca_menu { id_menupadre = idMenu,men_activo = TiposBases.EstadoRegistro.ACT});
     if (listMenuHijos.Any())
     {
       foreach (co_ca_menu hijo in listMenuHijos)
       {
         Node nodeMenuHijo = new Node { Text = hijo.men_nombre, IconCls = "#Application" };
         menuPadre.Children.Add(nodeMenuHijo);
         IList<co_ca_menu> listMenuHijoHijo = new bf_ca_menu().GetData(new co_ca_menu { id_menupadre = hijo.id_menu });
         if (listMenuHijoHijo.Any())
         {
           CreaMenuHijo(hijo.id_menu, nodeMenuHijo);
         }
         else
         {
           nodeMenuHijo.Leaf = true;
         }
       }
     }
   }
   catch (Exception ex)
   {
     Mensajes.Error(ex.Message);
   }
 }
コード例 #2
0
        // public event TreeStoreBase.ReadDataEventHandler RightReadData;

        //private void _treePanelLeft_Submit(object sender, SubmitEventArgs e)
        //{
        //    List<SubmittedNode> children = e.RootNode.Children;
        //    foreach (SubmittedNode node in children)
        //    {
        //        Ext.Net.Node node2 = new Ext.Net.Node
        //        {
        //            NodeID = node.NodeID,
        //            Text = node.Text,
        //            Leaf = true
        //        };
        //        this._treePanelRight.GetRootNode().InsertChild(0, node2);
        //        this._treePanelLeft.GetNodeById(node.NodeID).Remove();
        //        this._selectedIds.Add(ConvertHelper.ToInt32(node.NodeID));
        //    }
        //}

        //private void _treePanelRight_Submit(object sender, SubmitEventArgs e)
        //{
        //    List<SubmittedNode> children = e.RootNode.Children;
        //    foreach (SubmittedNode node in children)
        //    {
        //        Ext.Net.Node node2 = new Ext.Net.Node
        //        {
        //            NodeID = node.NodeID,
        //            Text = node.Text,
        //            Leaf = true
        //        };
        //        this._treePanelLeft.GetRootNode().InsertChild(0, node2);
        //        this._treePanelRight.GetNodeById(node.NodeID).Remove();
        //        this._selectedIds.Remove(ConvertHelper.ToInt32(node.NodeID));
        //    }
        //}

        //private void _treeStoreLeft_ReadData(object sender, NodeLoadEventArgs e)
        //{
        //    if (this.LeftReadData != null)
        //    {
        //        this.LeftReadData(sender, e);
        //    }
        //}

        //private void _treeStoreRight_ReadData(object sender, NodeLoadEventArgs e)
        //{
        //    if (this.RightReadData != null)
        //    {
        //        this.RightReadData(sender, e);
        //        foreach (Ext.Net.Node node in e.Nodes)
        //        {
        //            this._selectedIds.Add(ConvertHelper.ToInt32(node.NodeID));
        //        }
        //    }
        //}

        //public void AddSelected()
        //{
        //    MoveNode(this._treePanelLeft, this._treePanelRight);
        //}

        //private void btnAddSelected_DirectClick(object sender, DirectEventArgs e)
        //{
        //    this.MoveNode(this._treePanelLeft, this._treePanelRight);
        //}

        //private void btnRemoveSelected_DirectClick(object sender, DirectEventArgs e)
        //{
        //    this.MoveNode(this._treePanelRight, this._treePanelLeft);
        //}

        /// <summary>
        /// 获取已选择的记录
        /// </summary>
        /// <returns></returns>
        //public int[] GetSelected(bool clearCahce = true)
        //{
        //    int[] numArray = this._selectedIds.ToArray();
        //    if (clearCahce)
        //    {
        //        this.Context.Cache.Remove("_selectedIds");
        //    }
        //    return numArray;
        //}

        private void InitTreePanel(TreePanel treePanel, TreeStore treeStore, Model model)
        {
            treePanel.RootVisible  = false;
            treePanel.AutoDataBind = true;
            Ext.Net.Parameter parameters = new Ext.Net.Parameter
            {
                Name  = "id",
                Value = "record.data.id",
                Mode  = ParameterMode.Raw
            };
            var view = new Ext.Net.TreeView();

            view.Plugins.Add(new TreeViewDragDrop()
            {
                AppendOnly = true
            });
            treePanel.View.Add(view);
            //treePanel.DirectEvents.ItemDblClick.ExtraParams.Add(parameters);
            //treePanel.DirectEvents.ItemDblClick.EventMask.ShowMask = true;
            //treePanel.DirectEvents.ItemDblClick.EventMask.Msg = "正在添加";
            treeStore.AutoDataBind = true;
            treeStore.AutoLoad     = true;
            model.Fields.Add(new ModelField("Id", ModelFieldType.Int));
            model.Fields.Add(new ModelField("Name", ModelFieldType.String));
            treeStore.Model.Add(model);
            treePanel.Store.Add(treeStore);
            Ext.Net.Node item = new Ext.Net.Node
            {
                NodeID = "0",
                Text   = "根"
            };
            treeStore.Root.Add(item);
            Add(treePanel);
        }
コード例 #3
0
        private void BuildTree1(Ext.Net.NodeCollection nodes)
        {
            if (nodes == null)
            {
                nodes = new Ext.Net.NodeCollection();
            }
            Ext.Net.Node root = new Ext.Net.Node();
            root.Text     = "排班选单";
            root.Expanded = true;
            nodes.Add(root);

            string[] GroupName  = { "本周排班", "双周预约排班", "双周预约排班打印", "固定排班", "排班查询" };
            Icon[]   icon_array = { Icon.User, Icon.User, Icon.Report, Icon.Table, Icon.User };
            for (int i = 0; i < GroupName.Length; i++)
            {
                Ext.Net.Node groupNode = new Ext.Net.Node()
                {
                    Text   = GroupName[i],
                    NodeID = (i + 1).ToString(),
                    Icon   = icon_array[i],
                    Cls    = "large-font",
                    Leaf   = true
                };
                root.Children.Add(groupNode);
            }
            TreePanel1.Render();
        }
コード例 #4
0
        private void BuildTree1(Ext.Net.NodeCollection nodes)
        {
            if (nodes == null)
            {
                nodes = new Ext.Net.NodeCollection();
            }
            Ext.Net.Node root = new Ext.Net.Node();
            root.Text     = "处方模版";
            root.Expanded = true;
            nodes.Add(root);

            string[] GroupName = new string[3] {
                "医嘱用药模板", "血管通路用药模板", "血管通路耗材组合"
            };
            for (int i = 0; i < GroupName.Length; i++)
            {
                Ext.Net.Node groupNode = new Ext.Net.Node()
                {
                    Text   = GroupName[i],
                    NodeID = (i + 1).ToString(),
                    Icon   = Icon.Star,
                    Cls    = "large-font",
                    Leaf   = true
                };
                root.Children.Add(groupNode);
            }
            TreePanel1.Render();
        }
コード例 #5
0
        private void BuildTree1(Ext.Net.NodeCollection nodes)
        {
            if (nodes == null)
            {
                nodes = new Ext.Net.NodeCollection();
            }
            Ext.Net.Node root = new Ext.Net.Node();
            root.Text     = "库存管理";
            root.Expanded = true;
            nodes.Add(root);

            string[] GroupName  = { "库存表", "每日病患材料单", "领料单", "退料单", "耗材使用统计", "进货明细" };
            Icon[]   icon_array = { Icon.Book, Icon.Report, Icon.Report, Icon.Report, Icon.Report, Icon.Report };
            for (int i = 0; i < GroupName.Length; i++)
            {
                Ext.Net.Node groupNode = new Ext.Net.Node()
                {
                    Text   = GroupName[i],
                    NodeID = (i + 1).ToString(),
                    Icon   = icon_array[i],
                    Cls    = "large-font",
                    Leaf   = true
                };
                root.Children.Add(groupNode);
            }
            TreePanel1.Render();
        }
コード例 #6
0
ファイル: TreeBuilder.cs プロジェクト: EliasTous/ERP
        internal NodeCollection BuildPayrollTree(NodeCollection nodes)
        {
            if (nodes == null)
            {
                nodes = new Ext.Net.NodeCollection();
            }



            Ext.Net.Node rootParent = BuildRootParentNode("rootParent", Resources.Common.Payroll, true);
            Ext.Net.Node timeAt     = BuildParentNode("standard", Resources.Common.Payroll, true, rootParent);

            Ext.Net.Node gen = BuildLeafNode("gen", Resources.Common.GeneratePayroll, "Group", true, timeAt);
            FillConfigItem(gen, "gen", "PayrollGeneration.aspx", Resources.Common.GeneratePayroll, "icon-Employees", "1");
            Ext.Net.Node LeavePayment = BuildLeafNode("LeavePayments", Resources.Common.LeavePayment, "Group", true, timeAt);

            FillConfigItem(LeavePayment, "LeavePayments", "LeavePayments.aspx", Resources.Common.LeavePayment, "icon-Employees", "1");


            Ext.Net.Node finalSettlement = BuildLeafNode("FinalSettlements", Resources.Common.FinalSettlements, "Group", true, timeAt);

            FillConfigItem(finalSettlement, "FinalSettlements", "FinalSettlements.aspx", Resources.Common.FinalSettlements, "icon-Employees", "1");

            Ext.Net.Node BenefitAcquisition = BuildLeafNode("BenefitAcquisition", Resources.Common.BenefitAcquisition, "Group", true, timeAt);

            FillConfigItem(BenefitAcquisition, "BenefitAcquisition", "BenefitAcquisitions.aspx", Resources.Common.BenefitAcquisition, "icon-Employees", "1");



            nodes.Add(rootParent);
            return(nodes);
        }
コード例 #7
0
 private void InitTreePanel(TreePanel treePanel, TreeStore treeStore, Model model)
 {
     treePanel.RootVisible  = false;
     treePanel.AutoDataBind = true;
     Ext.Net.Parameter parameters = new Ext.Net.Parameter
     {
         Name  = "id",
         Value = "record.data.id",
         Mode  = ParameterMode.Raw
     };
     treePanel.DirectEvents.ItemDblClick.ExtraParams.Add(parameters);
     treePanel.DirectEvents.ItemDblClick.EventMask.ShowMask = true;
     treePanel.DirectEvents.ItemDblClick.EventMask.Msg      = "正在添加";
     treeStore.AutoDataBind = true;
     treeStore.AutoLoad     = true;
     model.Fields.Add(new ModelField("Id", ModelFieldType.Int));
     model.Fields.Add(new ModelField("Name", ModelFieldType.String));
     treeStore.Model.Add(model);
     treeStore.Proxy.Add(new PageProxy());
     treePanel.Store.Add(treeStore);
     Ext.Net.Node item = new Ext.Net.Node
     {
         NodeID   = "0",
         Text     = "根",
         Expanded = true
     };
     treeStore.Root.Add(item);
     Add(treePanel);
 }
コード例 #8
0
        public string GetNodes(string node)
        {
            NodeCollection nodes = new NodeCollection(false);

            if (!string.IsNullOrEmpty(node))
            {
                for (int i = 1; i < 6; i++)
                {
                    Node asyncNode = new Node();
                    asyncNode.Text = node + i;
                    asyncNode.NodeID = node + i;
                    nodes.Add(asyncNode);
                }

                for (int i = 6; i < 11; i++)
                {
                    Node treeNode = new Node();
                    treeNode.Text = node + i;
                    treeNode.NodeID = node + i;
                    treeNode.Leaf = true;
                    nodes.Add(treeNode);
                }
            }

            return nodes.ToJson();
        }
コード例 #9
0
        private void BuildTree1(Ext.Net.NodeCollection nodes)
        {
            if (nodes == null)
            {
                nodes = new Ext.Net.NodeCollection();
            }
            Ext.Net.Node root = new Ext.Net.Node();
            root.Text     = "血透信息";
            root.Expanded = true;
            nodes.Add(root);

            string[] GroupName = new string[7] {
                "血管通路", "透析处方", "血压测量", "透析充分性", "抗凝剂", "干体重", "合用其他透析模式"
            };
            for (int i = 0; i < GroupName.Length; i++)
            {
                Ext.Net.Node groupNode = new Ext.Net.Node()
                {
                    Text   = GroupName[i],
                    NodeID = (i + 1).ToString(),
                    Icon   = Icon.Star,
                    Cls    = "large-font",
                    Leaf   = true
                };
                root.Children.Add(groupNode);
            }
            TreePanel1.Render();
        }
コード例 #10
0
        private void BuildTree2(Ext.Net.NodeCollection nodes)
        {
            if (nodes == null)
            {
                nodes = new Ext.Net.NodeCollection();
            }
            Ext.Net.Node root = new Ext.Net.Node();
            root.Text     = "血液透析";
            root.Expanded = true;
            nodes.Add(root);

            string[] GroupName  = new string[] { "植管记录", "回诊记录", "腹膜炎记录", "感染记录及追踪", "护理评估", "随访记录" };
            Icon[]   icon_array = new Icon[] { Icon.Star, Icon.Star, Icon.Star, Icon.Star, Icon.Star, Icon.Star, Icon.Star };
            for (int i = 0; i < GroupName.Length; i++)
            {
                Ext.Net.Node groupNode = new Ext.Net.Node()
                {
                    Text   = GroupName[i],
                    NodeID = (i + 1).ToString(),
                    Icon   = icon_array[i],
                    Cls    = "large-font",
                    Leaf   = true
                };
                root.Children.Add(groupNode);
            }
            TreePanel2.Render();
        }
コード例 #11
0
        public NodeCollection BuildEmployeeFilesTree(NodeCollection nodes)
        {
            if (nodes == null)
            {
                nodes = new Ext.Net.NodeCollection();
            }



            Ext.Net.Node rootParent    = BuildRootParentNode("rootParent", Resources.Common.EmployeeFiles, true);
            Ext.Net.Node employees     = BuildParentNode("rootParent_Employee", Resources.Common.Employee, true, rootParent);
            Ext.Net.Node employeesLeaf = BuildLeafNode("rootParent_Employee_Leaf", Resources.Common.EmployeeLeaf, "Group", true, employees);
            FillConfigItem(employeesLeaf, "manageemployees", "Employees.aspx", Resources.Common.EmployeeLeaf, "icon-Employees", "1");
            Ext.Net.Node sponsors              = BuildLeafNode("rootParent_Employee_Sponsors", Resources.Common.Sponsors, "Group", true, employees);
            Ext.Net.Node allowanceTypes        = BuildLeafNode("rootParent_Employee_allowance", Resources.Common.AllowanceTypes, "Group", true, employees);
            Ext.Net.Node certificateLevels     = BuildLeafNode("rootParent_Employee_certificate", Resources.Common.CertificateLevels, "Group", true, employees);
            Ext.Net.Node trainingTypes         = BuildLeafNode("rootParent_Employee_trainingTypes", Resources.Common.TrainingTypes, "Group", true, employees);
            Ext.Net.Node EntitlementDeductions = BuildLeafNode("rootParent_Employee_EntitlementDeductions", Resources.Common.EntitlementDeduction, "Group", true, employees);
            FillConfigItem(sponsors, "sponsors", "Sponsors.aspx", Resources.Common.Sponsors, "icon-Employees", "1");
            FillConfigItem(allowanceTypes, "allowanceTypes", "AllowanceTypes.aspx", Resources.Common.AllowanceTypes, "icon-Employees", "1");
            FillConfigItem(certificateLevels, "certificateLevels", "CertificateLevels.aspx", Resources.Common.CertificateLevels, "icon-Employees", "1");
            FillConfigItem(trainingTypes, "trainingTypes", "TrainingTypes.aspx", Resources.Common.TrainingTypes, "icon-Employees", "1");
            FillConfigItem(EntitlementDeductions, "entitlementDeductions", "EntitlementDeductions.aspx", Resources.Common.EntitlementDeduction, "icon-Employees", "1");


            nodes.Add(rootParent);
            return(nodes);
        }
コード例 #12
0
        private void BuildTree1(Ext.Net.NodeCollection nodes)
        {
            if (nodes == null)
            {
                nodes = new Ext.Net.NodeCollection();
            }
            Ext.Net.Node root = new Ext.Net.Node();
            root.Text     = "设备管理";
            root.Expanded = true;
            nodes.Add(root);

            string[] GroupName  = { "人员档案", "人员肝炎指标", "人员疫苗接种", "设备档案", "设备保养纪录", "透析中心信息" };
            Icon[]   icon_array = { Icon.User, Icon.User, Icon.User, Icon.Table, Icon.TableGear, Icon.TableGear };
            for (int i = 0; i < GroupName.Length; i++)
            {
                Ext.Net.Node groupNode = new Ext.Net.Node()
                {
                    Text   = GroupName[i],
                    NodeID = (i + 1).ToString(),
                    Icon   = icon_array[i],
                    Cls    = "large-font",
                    Leaf   = true
                };
                root.Children.Add(groupNode);
            }
            TreePanel1.Render();
        }
コード例 #13
0
        public void onLoad()
        {
            Node nRoot = new Node();
            nRoot.Text = "MEXICO";
            nRoot.NodeID = "MX";
            nRoot.Expanded = false;

            //1. Obtener los Municipios
            List<Estado> lEstado = EstadoBusiness.ObtenerEstados();

            //2. Armar el arbol de hijos
            foreach (Estado st in lEstado)
            {
                Node nEstado = new Node();
                nEstado.Text = st.Descripcion;
                nEstado.NodeID = st.ID;
                nEstado.Expanded = false;

                List<Municipio> lMunicipios = MunicipioBusiness.ObtenerMunicipiosPorEstado(st.ID);
                foreach (Municipio mun in lMunicipios)
                {
                    Node nMun = new Node();
                    nMun.Text = mun.Descripcion;
                    nMun.NodeID = mun.ID;

                    nEstado.Children.Add(nMun);

                }
                nRoot.Children.Add(nEstado);
            }
            tpCodigosPostales.Root.Add(nRoot);
        }
コード例 #14
0
        private void creatNodeRuntime(string text, string nodeId, string parentNode, string icon = "Link", string url = "TestPage.aspx")
        {
            if (icon == "")
            {
                //In DB allow null in checked so handel null value in code
                icon = "Link";
            }
            if (url == "")
            {
                //In DB allow null in checked so handel null value in code
                url = "TestPage.aspx";
            }

            //make a node
            Ext.Net.Node node = new Ext.Net.Node()
            {
                Text   = text,
                NodeID = nodeId,
                Icon   = (Icon)System.Enum.Parse(typeof(Icon), icon),
                Leaf   = true
            };
            ///make One Or More custom attributes.
            var attrs = new[]
            {
                new ConfigItem("url", url, ParameterMode.Value)
                //new ConfigItem("NodeRights","NiNewNode",ParameterMode.Value)
            };

            ///add to node the custom attributes.
            node.CustomAttributes.AddRange(attrs);
            //pull leaf nodes to already made tree.
            this.TreePanelMain.GetNodeById(parentNode).InsertChild(0, node);
        }
コード例 #15
0
    /// <summary>
    /// 获取部门树
    /// </summary>
    /// <param name="nodes"></param>
    /// <returns></returns>
    private Ext.Net.NodeCollection buildTree(Ext.Net.NodeCollection nodes)
    {
        if (nodes == null)
        {
            nodes = new Ext.Net.NodeCollection();
        }
        Ext.Net.Node root = new Ext.Net.Node();
        root.Text = "Root";
        nodes.Add(root);
        IList <SsbDept> subDeptList = deptManager.GetEntityList(new SsbDept()
        {
            ParentId = 0
        });

        buildTree(root, subDeptList);
        root.Leaf = root.Children.Count == 0;
        if (!root.Leaf)
        {
            foreach (var node in root.Children)
            {
                if (!node.Leaf)
                {
                    node.Expanded = true;
                }
            }
        }
        return(nodes);
    }
コード例 #16
0
ファイル: TreeBuilder.cs プロジェクト: EliasTous/ERP
        internal NodeCollection BuildHelp(NodeCollection nodes)
        {
            if (nodes == null)
            {
                nodes = new Ext.Net.NodeCollection();
            }



            Ext.Net.Node  rootParent = BuildRootParentNode("rootParent", Resources.Common.SelfService, true);
            Ext.Net.Node  ss         = BuildParentNode("standard", Resources.Common.SelfService, true, rootParent);
            DirectoryInfo info       = new DirectoryInfo(HttpContext.Current.Server.MapPath("~/Help"));
            var           files      = info.GetFiles("*.pdf");
            int           i          = 0;

            foreach (var item in files)
            {
                Ext.Net.Node temp = BuildLeafNode("help" + i.ToString(), item.Name, "Group", true, ss);
                FillConfigItem(temp, "help" + i.ToString(), "HelpBrowser.aspx?file=" + item.Name, Resources.Common.Letters, "icon-Employees", "1");
            }


            nodes.Add(rootParent);
            return(nodes);
        }
コード例 #17
0
 private void CargarMenuPadre()
 {
   try
   {
     Node root = new Node { Text = "Menus" };
     treeMenu.Root.Add(root);
     IList<co_ca_menu> listMenu = new bf_ca_menu().GetData(new co_ca_menu { id_menupadre = -1,men_activo = TiposBases.EstadoRegistro.ACT});
     if (listMenu.Any())
     {
       foreach (co_ca_menu menuPadre in listMenu)
       {
         IList<co_ca_menu> listMenuHijos = new bf_ca_menu().GetData(new co_ca_menu { id_menupadre = menuPadre.id_menu });
         if (listMenuHijos.Any())
         {
           Node nodeMenuPadre = new Node { Text = menuPadre.men_nombre, IconCls = "#Application" };
           root.Children.Add(nodeMenuPadre);
           CreaMenuHijo(menuPadre.id_menu, nodeMenuPadre);
         }
       }
     }
   }
   catch (Exception ex)
   {
     Mensajes.Error(ex.Message);
   }
 }
コード例 #18
0
        internal NodeCollection BuildTimeManagementTree(NodeCollection nodes)
        {
            if (nodes == null)
            {
                nodes = new Ext.Net.NodeCollection();
            }



            Ext.Net.Node rootParent = BuildRootParentNode("rootParent", Resources.Common.Company, true);
            Ext.Net.Node timeAt     = BuildParentNode("rootParent_TA", Resources.Common.TimeAttendance, true, rootParent);
            Ext.Net.Node leaveMgmt  = BuildParentNode("rootParent_LM", Resources.Common.LeaveManagement, true, rootParent);

            Ext.Net.Node vs        = BuildLeafNode("rootParent_LM_VS", Resources.Common.VacationSchedules, "Group", true, leaveMgmt);
            Ext.Net.Node lt        = BuildLeafNode("rootParent_LM_LT", Resources.Common.LeaveTypes, "Group", true, leaveMgmt);
            Ext.Net.Node dts       = BuildLeafNode("rootParent_TA_DT", Resources.Common.DayTypes, "Group", true, timeAt);
            Ext.Net.Node ad        = BuildLeafNode("rootParent_TA_AD", Resources.Common.AttendanceDay, "Group", true, timeAt);
            Ext.Net.Node sc        = BuildLeafNode("rootParent_TA_SC", Resources.Common.AttendanceSchedule, "Group", true, timeAt);
            Ext.Net.Node ca        = BuildLeafNode("rootParent_TA_CA", Resources.Common.WorkingCalendars, "Group", true, timeAt);
            Ext.Net.Node bm        = BuildLeafNode("rootParent_TA_BM", Resources.Common.BiometricDevices, "Group", true, timeAt);
            Ext.Net.Node ro        = BuildLeafNode("rootParent_TA_RO", Resources.Common.Routers, "Group", true, timeAt);
            Ext.Net.Node dashboard = BuildLeafNode("rootParent_TA_dshboard", Resources.Common.Dashboard, "Group", true, timeAt);
            FillConfigItem(vs, "vacationSchedules", "VacationSchedules.aspx", Resources.Common.VacationSchedules, "icon-Employees", "1");
            FillConfigItem(lt, "lt", "LeaveTypes.aspx", Resources.Common.LeaveTypes, "icon-Employees", "1");
            FillConfigItem(dts, "dayTypes", "DayTypes.aspx", Resources.Common.DayTypes, "icon-Employees", "1");
            FillConfigItem(sc, "schedules", "Schedules.aspx", Resources.Common.AttendanceSchedule, "icon-Employees", "1");
            FillConfigItem(ca, "calendars", "WorkingCalendars.aspx", Resources.Common.WorkingCalendars, "icon-Employees", "1");
            FillConfigItem(bm, "bm", "BiometricDevices.aspx", Resources.Common.BiometricDevices, "icon-Employees", "1");
            FillConfigItem(ro, "ro", "Routers.aspx", Resources.Common.Routers, "icon-Employees", "1");
            FillConfigItem(ad, "ad", "TimeAttendanceView.aspx", Resources.Common.AttendanceDay, "icon-Employees", "1");
            FillConfigItem(dashboard, "dashboard", "Dashboard.aspx", Resources.Common.Dashboard, "icon-Employees", "1");
            nodes.Add(rootParent);
            return(nodes);
        }
コード例 #19
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/json";
            string nodeId = context.Request["node"];

            if (!string.IsNullOrEmpty(nodeId))
            {
                NodeCollection nodes = new NodeCollection(false);

                for (int i = 1; i < 6; i++)
                {
                    Node asyncNode = new Node();
                    asyncNode.Text = nodeId + i;
                    asyncNode.NodeID = nodeId + i;
                    nodes.Add(asyncNode);
                }

                for (int i = 6; i < 11; i++)
                {
                    Node node = new Node();
                    node.Text = nodeId + i;
                    node.NodeID = nodeId + i;
                    node.Leaf = true;
                    nodes.Add(node);
                }

                context.Response.Write(nodes.ToJson());
                context.Response.End();
            }
        }
コード例 #20
0
ファイル: TreeBuilder.cs プロジェクト: EliasTous/ERP
 private Node BuildRootParentNode(string ID, string Label, bool isExpanded)
 {
     Ext.Net.Node rootParent = new Ext.Net.Node();
     rootParent.Text     = Label;
     rootParent.NodeID   = ID;
     rootParent.Expanded = isExpanded;
     return(rootParent);
 }
コード例 #21
0
 private void SetNode(Ext.Net.Node nNode, string sText, string sDataPath, string sNodeID, Ext.Net.Node nFather)
 {
     nNode.Text     = sText;
     nNode.DataPath = sDataPath;
     nNode.NodeID   = sNodeID;
     nNode.Cls      = "large-font";
     nFather.Children.Add(nNode);
 }
コード例 #22
0
ファイル: TreeBuilder.cs プロジェクト: EliasTous/ERP
        public NodeCollection BuildEmployeeFilesTree(NodeCollection nodes)
        {
            if (nodes == null)
            {
                nodes = new Ext.Net.NodeCollection();
            }



            Ext.Net.Node rootParent    = BuildRootParentNode("rootParent", Resources.Common.EmployeeFiles, true);
            Ext.Net.Node employees     = BuildParentNode("rootParent_Employee", Resources.Common.Employee, true, rootParent);
            Ext.Net.Node employeesLeaf = BuildLeafNode("rootParent_Employee_Leaf", Resources.Common.EmployeeLeaf, "Vcard", true, employees);
            //   Ext.Net.Node casesList = BuildLeafNode("rootParent_Cases_List", Resources.Common.CaseManagement, "Group", true, employees);
            Ext.Net.Node loansList       = BuildLeafNode("rootParent_Loans_List", Resources.Common.Loans, "MoneyDelete", true, employees);
            Ext.Net.Node EmployeePenalty = BuildLeafNode("rootParent_Employee_Penalty", Resources.Common.EmployeePenalty, "UserRed", true, employees);

            //       Ext.Net.Node assetAllowance = BuildLeafNode("rootParent_Employee_AssetAllowance", Resources.Common.AssetAllowances, "UserStar", true, employees);
            //Ext.Net.Node employeeComplaint = BuildLeafNode("rootParent_Employee_EmployeeComplaint", Resources.Common.EmployeeComplaints, "UserComment", true, employees);
            // Ext.Net.Node tasksList = BuildLeafNode("rootParent_Tasks_List", Resources.Common.Tasks, "Group", true, employees);
            // FillConfigItem(casesList, "Cases", "Cases.aspx", Resources.Common.Cases, "icon-Employees", "1");
            FillConfigItem(loansList, "Loans", "LoanRequests.aspx", Resources.Common.Loans, "icon-Employees", "1");
            //    FillConfigItem(EmployeePenalty, "EmployeePenalty", "EmployeePenalties.aspx", Resources.Common.EmployeePenalty, "icon-Employees", "1");
            //          FillConfigItem(assetAllowance, "assetAllowances", "AssetAllowances.aspx", Resources.Common.AssetAllowances, "icon-Employees", "1");
            FillConfigItem(employeesLeaf, "manageemployees", "Employees.aspx", Resources.Common.EmployeeLeaf, "icon-Employees", "1");
            //  FillConfigItem(employeeComplaint, "employeeComplaints", "EmployeeComplaints.aspx", Resources.Common.EmployeeComplaints, "icon-Employees", "1");
            // FillConfigItem(tasksList, "Tasks", "Tasks.aspx", Resources.Common.Tasks, "icon-Employees", "1");

            //Ext.Net.Node setup = BuildParentNode("rootParent_setup", Resources.Common.Setup, false, rootParent);
            //Ext.Net.Node sponsors = BuildLeafNode("rootParent_Employee_Sponsors", Resources.Common.Sponsors, "Group", true, setup);
            ////Ext.Net.Node allowanceTypes = BuildLeafNode("rootParent_Employee_allowance", Resources.Common.AllowanceTypes, "Group", true, setup);
            //Ext.Net.Node certificateLevels = BuildLeafNode("rootParent_Employee_certificate", Resources.Common.CertificateLevels, "Group", true, setup);
            //Ext.Net.Node relationshipTypes = BuildLeafNode("rootParent_Employee_relationship", Resources.Common.RelationshipTypes, "Group", true, setup);

            //Ext.Net.Node EntitlementDeductions = BuildLeafNode("rootParent_Employee_EntitlementDeductions", Resources.Common.EntitlementDeduction, "Group", true, setup);
            //Ext.Net.Node DocumentTypes = BuildLeafNode("rootParent_Employee_DocumentTypes", Resources.Common.DocumentTypes, "Group", true, setup);
            //Ext.Net.Node SalaryChangeReasons = BuildLeafNode("rootParent_Employee_SalaryChangeReason", Resources.Common.SalaryChangeReasons, "Group", true, setup);
            //Ext.Net.Node AssetCategories = BuildLeafNode("rootParent_Employee_AssetCategories", Resources.Common.AssetCategories, "Group", true, setup);
            //Ext.Net.Node BonusTypes = BuildLeafNode("rootParent_Employee_BonusTypes", Resources.Common.BonusTypes, "Group", true, setup);
            //Ext.Net.Node CheckTypes = BuildLeafNode("rootParent_Employee_CheckType", Resources.Common.CheckTypes, "Group", true, setup);


            // FillConfigItem(sponsors, "sponsors", "Sponsors.aspx", Resources.Common.Sponsors, "icon-Employees", "1");
            ////FillConfigItem(allowanceTypes, "allowanceTypes", "AllowanceTypes.aspx", Resources.Common.AllowanceTypes, "icon-Employees", "1");
            //FillConfigItem(certificateLevels, "certificateLevels", "CertificateLevels.aspx", Resources.Common.CertificateLevels, "icon-Employees", "1");
            //FillConfigItem(relationshipTypes, "relationshipTypes", "RelationshipTypes.aspx", Resources.Common.RelationshipTypes, "icon-Employees", "1");

            //FillConfigItem(EntitlementDeductions, "entitlementDeductions", "EntitlementDeductions.aspx", Resources.Common.EntitlementDeduction, "icon-Employees", "1");
            //FillConfigItem(DocumentTypes, "documentTypes", "DocumentTypes.aspx", Resources.Common.DocumentTypes, "icon-Employees", "1");
            //FillConfigItem(SalaryChangeReasons, "salaryChangeReasons", "SalaryChangeReasons.aspx", Resources.Common.SalaryChangeReasons, "icon-Employees", "1");
            //FillConfigItem(AssetCategories, "assetCategories", "AssetCategories.aspx", Resources.Common.AssetCategories, "icon-Employees", "1");
            //FillConfigItem(BonusTypes, "bonusTypes", "BonusTypes.aspx", Resources.Common.BonusTypes, "icon-Employees", "1");
            //FillConfigItem(CheckTypes, "checkTypes", "CheckTypes.aspx", Resources.Common.CheckTypes, "icon-Employees", "1");



            nodes.Add(rootParent);
            return(nodes);
        }
コード例 #23
0
 private Node BuildParentNode(string ID, string Label, bool isExpanded, Ext.Net.Node parentNode)
 {
     Ext.Net.Node node = new Ext.Net.Node();
     node.Text     = Label;
     node.NodeID   = ID;
     node.Expanded = isExpanded;
     parentNode.Children.Add(node);
     return(node);
 }
コード例 #24
0
        private Node BuildLeafNode(string ID, string Label, string icon, bool isExpanded, Ext.Net.Node parentNode)
        {
            Ext.Net.Node node = new Ext.Net.Node();
            node.Text   = Label;
            node.NodeID = ID;

            node.Icon       = (Icon)Enum.Parse(typeof(Icon), icon);
            node.Expandable = isExpanded;
            node.Leaf       = true;
            parentNode.Children.Add(node);
            return(node);
        }
コード例 #25
0
ファイル: TreeBuilder.cs プロジェクト: EliasTous/ERP
        internal NodeCollection BuildSelftService(NodeCollection nodes)
        {
            if (nodes == null)
            {
                nodes = new Ext.Net.NodeCollection();
            }



            Ext.Net.Node rootParent = BuildRootParentNode("rootParent", Resources.Common.SelfService, true);
            Ext.Net.Node ss         = BuildParentNode("standard", Resources.Common.SelfService, true, rootParent);

            Ext.Net.Node pi = BuildLeafNode("pi", Resources.Common.PersonalInfo, "PagePortraitShot", true, ss);
            //Ext.Net.Node at = BuildLeafNode("at", Resources.Common.Attendance, "Group", true, ss);
            Ext.Net.Node lv = BuildLeafNode("lv", Resources.Common.Leaves, "UserGo", true, ss);
            Ext.Net.Node ln = BuildLeafNode("ln", Resources.Common.Loan, "MoneyDelete", true, ss);
            //Ext.Net.Node sl = BuildLeafNode("sl", Resources.Common.Salary, "Group", true, ss);
            //   Ext.Net.Node lt = BuildLeafNode("lt", Resources.Common.Letters, "EmailLink", true, ss);
            //  Ext.Net.Node AA = BuildLeafNode("AA", Resources.Common.AssetAllowancesSelfService, "UserStar", true, ss);
            //  Ext.Net.Node CO = BuildLeafNode("CO", Resources.Common.EmployeeComplaintsSelfServices, "UserComment", true, ss);
            Ext.Net.Node DS            = BuildLeafNode("DS", Resources.Common.DailySchedule, "UserComment", true, ss);
            Ext.Net.Node TVSS          = BuildLeafNode("TVSS", Resources.Common.timeVariations, "UserComment", true, ss);
            Ext.Net.Node TASS          = BuildLeafNode("TASS", Resources.Common.TimeAttendance, "UserComment", true, ss);
            Ext.Net.Node PY            = BuildLeafNode("PY", Resources.Common.Payroll, "UserComment", true, ss);
            Ext.Net.Node TimeApprovals = BuildLeafNode("TimeApprovals", Resources.Common.TimeApprovalsSelfService, "UserComment", true, ss);
            Ext.Net.Node AL            = BuildLeafNode("AL", Resources.Common.AssetLoans, "UserComment", true, ss);
            Ext.Net.Node RP            = BuildLeafNode("RP", Resources.Common.ChangePassword, "UserComment", true, ss);
            Ext.Net.Node TR            = BuildLeafNode("TR", Resources.Common.PendingTransfers, "ArrowSwitchBluegreen", true, ss);
            Ext.Net.Node LRP           = BuildLeafNode("LRP", Resources.Common.leaveReplacementApproval, "UserComment", true, ss);



            //  FillConfigItem(lt, "LettersSelfServices", "LettersSelfServices.aspx", Resources.Common.Letters, "icon-Employees", "1");
            FillConfigItem(pi, "MyInfos", "Myinfos.aspx", Resources.Common.PersonalInfo, "icon-Employees", "1");
            FillConfigItem(lv, "LeaveRequestsSelfService", "LeaveRequestsSelfServices.aspx", Resources.Common.LeaveRequests, "icon-Employees", "1");
            FillConfigItem(ln, "LoanSelfService", "LoanSelfServices.aspx", Resources.Common.Loan, "icon-Employees", "1");
            //     FillConfigItem(AA, "AssetAllowanceSelfService", "AssetAllowanceSelfServices.aspx", Resources.Common.AssetAllowancesSelfService, "icon-Employees", "1");
            //    FillConfigItem(CO, "EmployeeComplaintsSelfService", "EmployeeComplaintSelfServices.aspx", Resources.Common.EmployeeComplaintsSelfServices, "icon-Employees", "1");
            FillConfigItem(DS, "DailyScheduleSelfServices", "DailyScheduleSelfServices.aspx", Resources.Common.DailySchedule, "icon-Employees", "1");
            FillConfigItem(TVSS, "TimeVariationSelfServices", "TimeVariationSelfServices.aspx", Resources.Common.timeVariations, "icon-Employees", "1");
            FillConfigItem(TASS, "TimeAttendanceViewSelfServices", "TimeAttendanceView.aspx?_fromSelfService=true", Resources.Common.TimeAttendance, "icon-Employees", "1");
            FillConfigItem(PY, "PayrollsSelfServices", "PayrollGenerationSelfServices.aspx", Resources.Common.Payroll, "icon-Employees", "1");
            FillConfigItem(RP, "SelfServiceResetPasswords", "SelfServiceResetPasswords.aspx", Resources.Common.ChangePassword, "icon-Employees", "1");
            FillConfigItem(TimeApprovals, "TimeApprovalsSelfServices", "TimeApprovalsSelfServices.aspx", Resources.Common.TimeApprovalsSelfService, "icon-Employees", "1");
            FillConfigItem(TR, "TR", "SSTransfers.aspx", Resources.Common.PendingTransfers, "ArrowSwitchBluegreen", "1");
            FillConfigItem(AL, "AL", "AssetLoans.aspx", Resources.Common.AssetLoans, "icon-Employees", "1");
            FillConfigItem(LRP, "LRP", "LeaveReplacementApprovals.aspx", Resources.Common.leaveReplacementApproval, "icon-Employees", "1");


            nodes.Add(rootParent);
            return(nodes);
        }
コード例 #26
0
 private void AddNode(Ext.Net.Node nf, string sText, string sDataPath, string sNodeID)
 {
     Ext.Net.Node rN = new Ext.Net.Node()
     {
         Text     = sText,
         DataPath = sDataPath,
         NodeID   = sNodeID,
         Icon     = Icon.Report,
         Cls      = "large-font",
         Leaf     = true
     };
     nf.Children.Add(rN);
 }
コード例 #27
0
ファイル: TreeBuilder.cs プロジェクト: EliasTous/ERP
 private Node BuildParentNode(string ID, string Label, bool isExpanded, Ext.Net.Node parentNode, string icon = "")
 {
     Ext.Net.Node node = new Ext.Net.Node();
     node.Text   = Label;
     node.NodeID = ID;
     if (icon != "")
     {
         node.Icon = (Icon)Enum.Parse(typeof(Icon), icon);
     }
     node.Expanded = isExpanded;
     parentNode.Children.Add(node);
     return(node);
 }
コード例 #28
0
 private void _treePanelRight_Submit(object sender, SubmitEventArgs e)
 {
     List<SubmittedNode> children = e.RootNode.Children;
     foreach (SubmittedNode node in children)
     {
         Ext.Net.Node node2 = new Ext.Net.Node
         {
             NodeID = node.NodeID,
             Text = node.Text,
             Leaf = true
         };
         this._treePanelLeft.GetRootNode().InsertChild(0, node2);
         this._treePanelRight.GetNodeById(node.NodeID).Remove();
         this._selectedIds.Remove(ConvertHelper.ToInt32(node.NodeID));
     }
 }
コード例 #29
0
ファイル: TreeBuilder.cs プロジェクト: EliasTous/ERP
        internal NodeCollection BuildAdminTemplates(NodeCollection nodes)
        {
            if (nodes == null)
            {
                nodes = new Ext.Net.NodeCollection();
            }


            Ext.Net.Node rootParent           = BuildRootParentNode("rootParent", Resources.Common.AdministrationAffairs, true);
            Ext.Net.Node adminTemplates       = BuildParentNode("rootParent_CS", Resources.Common.AdministrationAffairs, true, rootParent);
            Ext.Net.Node adminBusiness        = BuildParentNode("rootParent_BP", Resources.Common.adminBusinessPartner, true, rootParent);
            Ext.Net.Node adminDocument        = BuildParentNode("rootParent_DC", Resources.Common.Documents, true, rootParent);
            Ext.Net.Node adminAssetManagement = BuildParentNode("rootParent_AS", Resources.Common.AssetManagement, true, rootParent);



            Ext.Net.Node templatesLeave          = BuildLeafNode("admintemplates_root", Resources.Common.AdminTemplates, "Photos", true, adminTemplates);
            Ext.Net.Node businessPartnerCategory = BuildLeafNode("BusinessPartnerCategories", Resources.Common.BusinessPartnerCategory, "Building", true, adminBusiness);
            Ext.Net.Node businessPartner         = BuildLeafNode("businessPartneres", Resources.Common.BusinessPartner, "Building", true, adminBusiness);
            Ext.Net.Node DocumentCategory        = BuildLeafNode("DocumentCategories", Resources.Common.DocumentCategory, "Building", true, adminDocument);
            Ext.Net.Node DocumentNavigation      = BuildLeafNode("DocumentNavigation", Resources.Common.OpenDocuments, "Building", true, adminDocument);
            Ext.Net.Node Document = BuildLeafNode("AdminDocuments", Resources.Common.Documents, "Building", true, adminDocument);
            Ext.Net.Node Asset    = BuildLeafNode("AssetManagementAssets", Resources.Common.Assets, "Building", true, adminAssetManagement);
            Ext.Net.Node AssetManagementPurchaseOrder = BuildLeafNode("AssetManagementPurchaseOrders", Resources.Common.PurchaseOrders, "Building", true, adminAssetManagement);
            Ext.Net.Node AssetManagementOnboarding    = BuildLeafNode("AssetManagementOnboarding", Resources.Common.Onboarding, "Building", true, adminAssetManagement);
            Ext.Net.Node AssetManagementloan          = BuildLeafNode("AssetManagementloan", Resources.Common.Loan, "Building", true, adminAssetManagement);
            Ext.Net.Node AdminDepts = BuildLeafNode("admindepts", Resources.Common.AdminDepts, "Building", true, adminDocument);

            FillConfigItem(templatesLeave, "admintemplates_root", "AdminTemplates.aspx", Resources.Common.AdminTemplates, "icon-Employees", "1");
            FillConfigItem(businessPartnerCategory, "BusinessPartnerCategories", "BusinessPartnerCategories.aspx", Resources.Common.BusinessPartnerCategory, "icon-Employees", "1");
            FillConfigItem(businessPartner, "businessPartneres", "BusinessPartneres.aspx", Resources.Common.BusinessPartner, "icon-Employees", "1");
            FillConfigItem(DocumentCategory, "DocumentCategories", "DocumentCategories.aspx", Resources.Common.DocumentCategory, "icon-Employees", "1");
            FillConfigItem(Document, "AdminDocuments", "AdminDocuments.aspx", Resources.Common.Documents, "icon-Employees", "1");
            FillConfigItem(DocumentNavigation, "DocumentNavigation", "AdminDocNav.aspx", Resources.Common.OpenDocuments, "icon-Employees", "1");
            FillConfigItem(Asset, "AssetManagementAssets", "AssetManagementAssets.aspx", Resources.Common.Assets, "icon-Employees", "1");
            FillConfigItem(AssetManagementPurchaseOrder, "AssetManagementPurchaseOrders", "AssetManagementPurchaseOrders.aspx", Resources.Common.PurchaseOrders, "icon-Employees", "1");
            FillConfigItem(AssetManagementOnboarding, "AssetManagementOnboarding", "AssetManagementOnboardings.aspx", Resources.Common.Onboarding, "icon-Employees", "1");
            FillConfigItem(AssetManagementloan, "AssetManagementloan", "AssetManagementloans.aspx", Resources.Common.Loan, "icon-Employees", "1");
            FillConfigItem(AdminDepts, "admindepts", "AdminDepts.aspx", Resources.Common.AdminDepts, "icon-Employees", "1");



            nodes.Add(rootParent);


            return(nodes);
        }
コード例 #30
0
        public IEnumerable <Ext.Net.Node> GetRolePrivilegeNodes(int _roleId)
        {
            List <Ext.Net.Node> list = new List <Ext.Net.Node>();
            var rolePrivileges       = this._privilegeBase.GetRolePrivileges(_roleId);

            foreach (Xinchen.PrivilegeManagement.DTO.Privilege privilege in rolePrivileges)
            {
                Ext.Net.Node item = new Ext.Net.Node
                {
                    NodeID = privilege.Id.ToString(),
                    Text   = privilege.Description,
                    Leaf   = true
                };
                list.Add(item);
            }
            return(list);
        }
コード例 #31
0
        public List <Ext.Net.Node> GetPrivilegeNodes()
        {
            List <Ext.Net.Node> list = new List <Ext.Net.Node>();
            IList <Xinchen.PrivilegeManagement.DTO.Privilege> privileges = this._privilegeBase.GetPrivileges();

            foreach (Xinchen.PrivilegeManagement.DTO.Privilege privilege in privileges)
            {
                Ext.Net.Node item = new Ext.Net.Node
                {
                    NodeID = privilege.Id.ToString(),
                    Text   = privilege.Description,
                    Leaf   = true
                };
                list.Add(item);
            }
            return(list);
        }
コード例 #32
0
        private void _treePanelRight_Submit(object sender, SubmitEventArgs e)
        {
            List <SubmittedNode> children = e.RootNode.Children;

            foreach (SubmittedNode node in children)
            {
                Ext.Net.Node node2 = new Ext.Net.Node
                {
                    NodeID = node.NodeID,
                    Text   = node.Text,
                    Leaf   = true
                };
                this._treePanelLeft.GetRootNode().InsertChild(0, node2);
                this._treePanelRight.GetNodeById(node.NodeID).Remove();
                this._selectedIds.Remove(ConvertHelper.ToInt32(node.NodeID));
            }
        }
コード例 #33
0
        private void BuildTree1(Ext.Net.NodeCollection nodes)
        {
            if (nodes == null)
            {
                nodes = new Ext.Net.NodeCollection();
            }
            Ext.Net.Node root = new Ext.Net.Node();
            root.Text     = "基本资料表";
            root.Expanded = true;
            nodes.Add(root);

            if (Hospital == "Hospital_Alasamo")
            {
                string[] GroupName = { "基本资料", "病史", "体格检查", "实验室检查", "诊断", "打印", "用药纪录", "季度小结" };
                for (int i = 0; i < GroupName.Length; i++)
                {
                    Ext.Net.Node groupNode = new Ext.Net.Node()
                    {
                        Text   = GroupName[i],
                        NodeID = (i + 1).ToString(),
                        Icon   = Icon.Star,
                        Cls    = "large-font",
                        Leaf   = true
                    };
                    root.Children.Add(groupNode);
                }
            }
            else
            {
                string[] GroupName = { "基本资料", "病史", "体格检查", "实验室检查", "诊断", "打印", "用药纪录" };
                for (int i = 0; i < GroupName.Length; i++)
                {
                    Ext.Net.Node groupNode = new Ext.Net.Node()
                    {
                        Text   = GroupName[i],
                        NodeID = (i + 1).ToString(),
                        Icon   = Icon.Star,
                        Cls    = "large-font",
                        Leaf   = true
                    };
                    root.Children.Add(groupNode);
                }
            }

            TreePanel1.Render();
        }
コード例 #34
0
 private void AddChild(Ext.Net.Node nn, string ss, string st, string sg, int ii, DataTable dt)
 {
     if (dt.Rows.Count > 0)
     {
         for (int i = 0; i < dt.Rows.Count; i++)
         {
             Ext.Net.Node cnode = null;
             if (ss.Equals("PD") || ss.Equals("DDD") || ss.Equals("MR") || ss.Equals("DQ"))
             {
                 cnode = new Ext.Net.Node()
                 {
                     Text   = dt.Rows[i]["C2"].ToString(),
                     NodeID = ss + i.ToString(),
                     Icon   = Icon.Page,
                     Cls    = "blue-large-font",
                     Leaf   = true
                 };
             }
             else
             {
                 cnode = new Ext.Net.Node()
                 {
                     Text   = dt.Rows[i]["C1"].ToString(),
                     NodeID = ss + i.ToString(),
                     Icon   = Icon.Page,
                     Cls    = "blue-large-font",
                     Leaf   = true
                 };
             }
             nn.Children.Add(cnode);
         }
     }
     else
     {
         Ext.Net.Node cnode = new Ext.Net.Node()
         {
             Text   = "无检验纪录",
             NodeID = ss + "_" + "NEW",
             Icon   = Icon.PageWhite,
             Cls    = "blue-large-font",
             Leaf   = true
         };
         nn.Children.Add(cnode);
     }
     nn.Expanded = true;
 }
コード例 #35
0
        public IEnumerable <Ext.Net.Node> GetUserRoleNodes(int _userId)
        {
            List <Ext.Net.Node> list = new List <Ext.Net.Node>();
            var userRoles            = this._privilegeBase.GetUserRoles(_userId);

            foreach (Xinchen.PrivilegeManagement.DTO.Role role in userRoles)
            {
                Ext.Net.Node item = new Ext.Net.Node
                {
                    NodeID = role.Id.ToString(),
                    Text   = role.Name,
                    Leaf   = true
                };
                list.Add(item);
            }
            return(list);
        }
コード例 #36
0
        public string GenerarNodo(string strNodoID)
        {
            //1. Obtener las colonias del siguiente nivel
            List<Colonia> lColonias = ColoniaBusiness.ObtenerColoniasPorMunicipio(strNodoID);
            NodeCollection ncNivel = new NodeCollection();

            //2. Armar el arbol de hijos
            foreach (Colonia col in lColonias)
            {
                Node nCol = new Node();
                nCol.Text = col.Descripcion;
                nCol.NodeID = col.ID;
                nCol.Expanded = false;
                nCol.Expandable = false;
                ncNivel.Add(nCol);
            }
            //3. Regresar los nodos
            return ncNivel.ToJson();
        }
コード例 #37
0
ファイル: TreeBuilder.cs プロジェクト: EliasTous/ERP
        public NodeCollection BuildCaseManagementTree(NodeCollection nodes)
        {
            if (nodes == null)
            {
                nodes = new Ext.Net.NodeCollection();
            }



            Ext.Net.Node rootParent = BuildRootParentNode("rootParent", Resources.Common.CaseManagement, true);
            Ext.Net.Node Cases      = BuildParentNode("rootParent_cases", Resources.Common.Cases, true, rootParent);
            Ext.Net.Node CaseLeaf   = BuildLeafNode("rootParent_casesLeaf", Resources.Common.CasesLeaf, "User", true, Cases);
            //FillConfigItem(CaseLeaf, "manageCaseManagement", "CM.aspx", Resources.Common.CasesLeaf, "icon-CaseManagement", "1");



            nodes.Add(rootParent);
            return(nodes);
        }
コード例 #38
0
ファイル: NodeProxy.cs プロジェクト: emayk/Ext.NET.Pro
 /// <summary>
 /// Replaces one child node in this node with another.
 /// </summary>
 /// <param name="newChild">The replacement node</param>
 /// <param name="oldChild">The node to replace</param>
 public virtual void ReplaceChild(Node newChild, NodeProxy oldChild)
 {
     this.Call("replaceChild", new JRawValue(newChild.ToScript()), new JRawValue(oldChild.NodeInstance));
 }
コード例 #39
0
ファイル: Privilege.cs プロジェクト: dusdong/BaseComponent
 public IEnumerable<Ext.Net.Node> GetUserRoleNodes(int _userId)
 {
     List<Ext.Net.Node> list = new List<Ext.Net.Node>();
     var userRoles = this._privilegeBase.GetUserRoles(_userId);
     foreach (Xinchen.PrivilegeManagement.DTO.Role role in userRoles)
     {
         Ext.Net.Node item = new Ext.Net.Node
         {
             NodeID = role.Id.ToString(),
             Text = role.Name,
             Leaf = true
         };
         list.Add(item);
     }
     return list;
 }
コード例 #40
0
ファイル: Privilege.cs プロジェクト: dusdong/BaseComponent
 public IEnumerable<Ext.Net.Node> GetRolePrivilegeNodes(int _roleId)
 {
     List<Ext.Net.Node> list = new List<Ext.Net.Node>();
     var rolePrivileges = this._privilegeBase.GetRolePrivileges(_roleId);
     foreach (Xinchen.PrivilegeManagement.DTO.Privilege privilege in rolePrivileges)
     {
         Ext.Net.Node item = new Ext.Net.Node
         {
             NodeID = privilege.Id.ToString(),
             Text = privilege.Description,
             Leaf = true
         };
         list.Add(item);
     }
     return list;
 }
コード例 #41
0
        // public event TreeStoreBase.ReadDataEventHandler RightReadData;

        //private void _treePanelLeft_Submit(object sender, SubmitEventArgs e)
        //{
        //    List<SubmittedNode> children = e.RootNode.Children;
        //    foreach (SubmittedNode node in children)
        //    {
        //        Ext.Net.Node node2 = new Ext.Net.Node
        //        {
        //            NodeID = node.NodeID,
        //            Text = node.Text,
        //            Leaf = true
        //        };
        //        this._treePanelRight.GetRootNode().InsertChild(0, node2);
        //        this._treePanelLeft.GetNodeById(node.NodeID).Remove();
        //        this._selectedIds.Add(ConvertHelper.ToInt32(node.NodeID));
        //    }
        //}

        //private void _treePanelRight_Submit(object sender, SubmitEventArgs e)
        //{
        //    List<SubmittedNode> children = e.RootNode.Children;
        //    foreach (SubmittedNode node in children)
        //    {
        //        Ext.Net.Node node2 = new Ext.Net.Node
        //        {
        //            NodeID = node.NodeID,
        //            Text = node.Text,
        //            Leaf = true
        //        };
        //        this._treePanelLeft.GetRootNode().InsertChild(0, node2);
        //        this._treePanelRight.GetNodeById(node.NodeID).Remove();
        //        this._selectedIds.Remove(ConvertHelper.ToInt32(node.NodeID));
        //    }
        //}

        //private void _treeStoreLeft_ReadData(object sender, NodeLoadEventArgs e)
        //{
        //    if (this.LeftReadData != null)
        //    {
        //        this.LeftReadData(sender, e);
        //    }
        //}

        //private void _treeStoreRight_ReadData(object sender, NodeLoadEventArgs e)
        //{
        //    if (this.RightReadData != null)
        //    {
        //        this.RightReadData(sender, e);
        //        foreach (Ext.Net.Node node in e.Nodes)
        //        {
        //            this._selectedIds.Add(ConvertHelper.ToInt32(node.NodeID));
        //        }
        //    }
        //}

        //public void AddSelected()
        //{
        //    MoveNode(this._treePanelLeft, this._treePanelRight);
        //}

        //private void btnAddSelected_DirectClick(object sender, DirectEventArgs e)
        //{
        //    this.MoveNode(this._treePanelLeft, this._treePanelRight);
        //}

        //private void btnRemoveSelected_DirectClick(object sender, DirectEventArgs e)
        //{
        //    this.MoveNode(this._treePanelRight, this._treePanelLeft);
        //}

        /// <summary>
        /// 获取已选择的记录
        /// </summary>
        /// <returns></returns>
        //public int[] GetSelected(bool clearCahce = true)
        //{
        //    int[] numArray = this._selectedIds.ToArray();
        //    if (clearCahce)
        //    {
        //        this.Context.Cache.Remove("_selectedIds");
        //    }
        //    return numArray;
        //}

        private void InitTreePanel(TreePanel treePanel, TreeStore treeStore, Model model)
        {
            treePanel.RootVisible = false;
            treePanel.AutoDataBind = true;
            Ext.Net.Parameter parameters = new Ext.Net.Parameter
            {
                Name = "id",
                Value = "record.data.id",
                Mode = ParameterMode.Raw
            };
            var view = new Ext.Net.TreeView();
            view.Plugins.Add(new TreeViewDragDrop()
            {
                AppendOnly = true
            });
            treePanel.View.Add(view);
            //treePanel.DirectEvents.ItemDblClick.ExtraParams.Add(parameters);
            //treePanel.DirectEvents.ItemDblClick.EventMask.ShowMask = true;
            //treePanel.DirectEvents.ItemDblClick.EventMask.Msg = "正在添加";
            treeStore.AutoDataBind = true;
            treeStore.AutoLoad = true;
            model.Fields.Add(new ModelField("Id", ModelFieldType.Int));
            model.Fields.Add(new ModelField("Name", ModelFieldType.String));
            treeStore.Model.Add(model);
            treePanel.Store.Add(treeStore);
            Ext.Net.Node item = new Ext.Net.Node
            {
                NodeID = "0",
                Text = "根"
            };
            treeStore.Root.Add(item);
            Add(treePanel);
        }
コード例 #42
0
    private Ext.Net.NodeCollection BuildTree(Ext.Net.NodeCollection nodes)
    {
        if (nodes == null)
        {
            nodes = new Ext.Net.NodeCollection();
        }
        Ext.Net.Node root = new Ext.Net.Node();
        root.Text = "Root";
        nodes.Add(root);

        int depid = 0, tem = 0;
        if (common.IntSafeConvert(cmbdept.SelectedItem.Value) > 0)
        {
            depid = common.IntSafeConvert(cmbdept.SelectedItem.Value);
        }
        string year = cmbyear.SelectedItem.Value ?? DateTime.Now.Year.ToString();

            string month = cmbmonth.SelectedItem.Value ?? DateTime.Now.Month.ToString();
            month = month.Length == 1 ? "0" + month : month;
            string yearMonth = year + "-" + month;

            string precmb = (common.IntSafeConvert(month) - 1).ToString();
            precmb = precmb.Length == 1 ? "0" + precmb : precmb;
            string preYearMonth = year + "-" + precmb;
            //yearMonth = "2015-02";
            //preYearMonth = "2015-01";
            //DataTable dtpiidTable = ExecuteNewLogic.GetDtPiidList(depid, yearMonth, tem);
            //DataTable predtpiidTable = ExecuteNewLogic.GetDtPiidList(depid, preYearMonth, tem);

            // DataTable dt = BG_PayIncomeLogic.GetDtPayIncomeByPIID(tem);
            DataTable dt = ExecuteNewLogic.GetDtAllPiidList(depid, yearMonth, preYearMonth);
            if (dt.Rows.Count == 0)
            {
                X.Msg.Alert("系统提示", "本月没有执行相关数据").Show();
                root.EmptyChildren = true;
                return nodes;
            }
            DataTable dtroot = dt.DefaultView.ToTable("dtroot", true, new string[] { "PIID", "ParentPIEcoSubName" });
            string piidList = "";
            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    int piid = common.IntSafeConvert(dt.Rows[i]["ChildID"]);
                    piidList += piid + ",";
                }

            }
            piidList = piidList.TrimEnd(',');
            DataTable dtcashier = ExecuteNewLogic.GetCashierData(depid, yearMonth, piidList);
            DataTable pMoney = ExecuteNewLogic.GetReceiptsData(depid, preYearMonth, piidList, 0);
            DataTable pMoney1 = ExecuteNewLogic.GetReceiptsData(depid, preYearMonth, piidList, 1);
            DataTable pMoney2 = ExecuteNewLogic.GetReceiptsData(depid, preYearMonth, piidList, 2);
            DataTable rpMoney = ExecuteNewLogic.GetReceiptsData(depid, yearMonth, piidList, 0);
            DataTable rpMoney1 = ExecuteNewLogic.GetReceiptsData(depid, yearMonth, piidList, 1);
            DataTable rpMoney2 = ExecuteNewLogic.GetReceiptsData(depid, yearMonth, piidList, 2);
            DataTable totalMon = ExecuteNewLogic.GetBudgetAllocationData(depid, year, piidList);
            DataTable newTable = new DataTable();
            newTable.Columns.Add("PIID");
            newTable.Columns.Add("ChildID");
            newTable.Columns.Add("PIEcoSubName");
            newTable.Columns.Add("totalMon");
            newTable.Columns.Add("BQMon");
            newTable.Columns.Add("CashierBalance");
            newTable.Columns.Add("PMoney");
            newTable.Columns.Add("PMoney1");
            newTable.Columns.Add("PMoney2");
            newTable.Columns.Add("RpMoney");
            newTable.Columns.Add("RpMoney1");
            newTable.Columns.Add("RpMoney2");
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DataRow drRow = newTable.NewRow();
                int piid = common.IntSafeConvert(dt.Rows[i]["ChildID"]);
                if (dtcashier.Rows.Count > 0)
                {
                    DataRow[] dtca = dtcashier.Select("piid=" + piid);
                    if (dtca.Length > 0)
                    {
                        drRow["BQMon"] = dtca[0]["BQMon"];
                        drRow["CashierBalance"] = dtca[0]["CashierBalance"];
                    }
                }
                if (rpMoney.Rows.Count > 0)
                {
                    DataRow[] dtrp = rpMoney.Select("piid=" + piid);
                    if (dtrp.Length > 0)
                    {
                        drRow["RpMoney"] = dtrp[0]["RpMoney"];
                    }
                }
                if (rpMoney1.Rows.Count > 0)
                {
                    DataRow[] dtrp1 = rpMoney1.Select("piid=" + piid);
                    if (dtrp1.Length > 0)
                    {
                        drRow["RpMoney1"] = dtrp1[0]["RpMoney"];
                    }
                }
                if (rpMoney2.Rows.Count > 0)
                {
                    DataRow[] dtrp2 = rpMoney2.Select("piid=" + piid);
                    if (dtrp2.Length > 0)
                    {
                        drRow["RpMoney2"] = dtrp2[0]["RpMoney"];
                    }
                }
                if (pMoney.Rows.Count > 0)
                {
                    {
                        DataRow[] dtp = pMoney.Select("piid=" + piid);
                        if (dtp.Length > 0)
                            drRow["PMoney"] = dtp[0]["RpMoney"];
                    }
                }
                if (pMoney1.Rows.Count > 0)
                {
                    DataRow[] dtp1 = pMoney1.Select("piid=" + piid);
                    if (dtp1.Length > 0)
                    {
                        drRow["PMoney1"] = dtp1[0]["RpMoney"];
                    }
                }
                if (pMoney2.Rows.Count > 0)
                {
                    DataRow[] dtp2 = pMoney2.Select("piid=" + piid);
                    if (dtp2.Length > 0)
                    {
                        drRow["PMoney2"] = dtp2[0]["RpMoney"];
                    }
                }
                if (totalMon.Rows.Count > 0)
                {
                    DataRow[] dttotalMon = totalMon.Select("piid=" + piid);
                    if (dttotalMon.Length > 0)
                    {
                        drRow["totalMon"] = dttotalMon[0]["total"];
                    }
                }
                drRow["PIEcoSubName"] = dt.Rows[i]["PIEcoSubName"].ToString();
                drRow["ChildID"] = dt.Rows[i]["ChildID"].ToString();
                drRow["PIID"] = dt.Rows[i]["PIID"].ToString();
                newTable.Rows.Add(drRow);
            }

            for (int i = 0; i < dtroot.Rows.Count; i++)
            {
                Node newNode = new Node();
                string piid = dtroot.Rows[i]["piid"].ToString();
                newNode.NodeID = piid;
                newNode.Text = dtroot.Rows[i]["ParentPIEcoSubName"].ToString();
                newNode.Icon = Icon.Folder;
                decimal BQMon = 0, CashierBalance = 0, PMoney = 0, PMoney1 = 0, PMoney2 = 0, RpMoney = 0, RpMoney1 = 0, RpMoney2 = 0, total = 0;
                DataRow[] drrowsleaf = newTable.Select("PIID=" + piid);
                if (drrowsleaf.Length > 0)
                {
                    for (int j = 0; j < drrowsleaf.Length; j++)
                    {
                        Node nodenew = new Node();
                        nodenew.NodeID = drrowsleaf[j]["ChildID"].ToString();
                        nodenew.Text = drrowsleaf[j]["PIEcoSubName"].ToString();
                        //nodenew.CustomAttributes.Add(new ConfigItem("PIID",drRows[j]["PIEcoSubName"].ToString(), ParameterMode.Value));
                        //nodenew.CustomAttributes.Add(new ConfigItem("PIEcoSubName",drRows[j]["PIEcoSubName"].ToString(), ParameterMode.Value));
                        nodenew.CustomAttributes.Add(new ConfigItem("BQMon", drrowsleaf[j]["BQMon"].ToString(), ParameterMode.Value));
                        nodenew.CustomAttributes.Add(new ConfigItem("CashierBalance", drrowsleaf[j]["CashierBalance"].ToString(), ParameterMode.Value));
                        nodenew.CustomAttributes.Add(new ConfigItem("PMoney", drrowsleaf[j]["PMoney"].ToString(), ParameterMode.Value));
                        nodenew.CustomAttributes.Add(new ConfigItem("PMoney1 ", drrowsleaf[j]["PMoney1"].ToString(), ParameterMode.Value));
                        nodenew.CustomAttributes.Add(new ConfigItem("PMoney2 ", drrowsleaf[j]["PMoney2"].ToString(), ParameterMode.Value));
                        nodenew.CustomAttributes.Add(new ConfigItem("RpMoney ", drrowsleaf[j]["RpMoney"].ToString(), ParameterMode.Value));
                        nodenew.CustomAttributes.Add(new ConfigItem("RpMoney1 ", drrowsleaf[j]["RpMoney1"].ToString(), ParameterMode.Value));
                        nodenew.CustomAttributes.Add(new ConfigItem("RpMoney2 ", drrowsleaf[j]["RpMoney2"].ToString(), ParameterMode.Value)); nodenew.CustomAttributes.Add(new ConfigItem("totalMon ", drrowsleaf[j]["totalMon"].ToString(), ParameterMode.Value));
                        nodenew.Leaf = true;
                        nodenew.Icon = Icon.Anchor;
                        newNode.Children.Add(nodenew);
                        BQMon += ParToDecimal.ParToDel(drrowsleaf[j]["BQMon"].ToString());
                        CashierBalance += ParToDecimal.ParToDel(drrowsleaf[j]["CashierBalance"].ToString());
                        PMoney += ParToDecimal.ParToDel(drrowsleaf[j]["PMoney"].ToString());
                        PMoney1 += ParToDecimal.ParToDel(drrowsleaf[j]["PMoney1"].ToString());
                        PMoney2 += ParToDecimal.ParToDel(drrowsleaf[j]["PMoney2"].ToString());
                        RpMoney += ParToDecimal.ParToDel(drrowsleaf[j]["RpMoney"].ToString());
                        RpMoney1 += ParToDecimal.ParToDel(drrowsleaf[j]["RpMoney1"].ToString());
                        RpMoney2 += ParToDecimal.ParToDel(drrowsleaf[j]["RpMoney2"].ToString());
                        total += ParToDecimal.ParToDel(drrowsleaf[j]["totalMon"].ToString());
                    }
                }
                else
                {
                    newNode.EmptyChildren = true;
                }
                newNode.CustomAttributes.Add(new ConfigItem("BQMon", BQMon.ToString(), ParameterMode.Value));
                newNode.CustomAttributes.Add(new ConfigItem("CashierBalance", CashierBalance.ToString(), ParameterMode.Value));
                newNode.CustomAttributes.Add(new ConfigItem("PMoney", PMoney.ToString(), ParameterMode.Value));
                newNode.CustomAttributes.Add(new ConfigItem("PMoney1 ", PMoney1.ToString(), ParameterMode.Value));
                newNode.CustomAttributes.Add(new ConfigItem("PMoney2 ", PMoney2.ToString(), ParameterMode.Value));
                newNode.CustomAttributes.Add(new ConfigItem("RpMoney ", RpMoney.ToString(), ParameterMode.Value));
                newNode.CustomAttributes.Add(new ConfigItem("RpMoney1 ", RpMoney1.ToString(), ParameterMode.Value));
                newNode.CustomAttributes.Add(new ConfigItem("RpMoney2 ", RpMoney2.ToString(), ParameterMode.Value));
                newNode.CustomAttributes.Add(new ConfigItem("totalMon ", total.ToString(), ParameterMode.Value));
                root.Children.Add(newNode);
            }

        return nodes;
    }
コード例 #43
0
        public static NodeCollection GetChapters()
        {
            var example1 = new Node
                               {
                                   NodeID = "HelloWorld",
                                   Text = "Hello World (Ext JS)",
                                   Href = "/Kapitel1/HelloWorld",
                                   Icon = Icon.World,
                                   Leaf = true
                               };

            var example2 = new Node
                               {
                                   NodeID = "HelloWorldNet",
                                   Text = "Hello World (Ext.NET)",
                                   Href = "/Kapitel1/HelloWorldNet",
                                   Icon = Icon.World,
                                   Leaf = true
                               };

            var example3 = new Node
            {
                NodeID = "Class",
                Text = "Ext JS Klasse",
                Href = "/Kapitel2/Class",
                Icon = Icon.World,
                Leaf = true
            };

            var example4 = new Node
            {
                NodeID = "Inheritence",
                Text = "Ext JS Vererbung",
                Href = "/Kapitel2/Inheritence",
                Icon = Icon.World,
                Leaf = true
            };

            var example5 = new Node
            {
                NodeID = "Mixins",
                Text = "Ext JS Mixins",
                Href = "/Kapitel2/Mixins",
                Icon = Icon.World,
                Leaf = true
            };

            /*
            var example5b = new Node
            {
                NodeID = "Mixins2",
                Text = "Ext JS Mixins - Labelable",
                Href = "/Kapitel2/Mixins2",
                Icon = Icon.World,
                Leaf = true
            };
            */

            var example6 = new Node
            {
                NodeID = "Store",
                Text = "Store (Ext JS)",
                Href = "/Kapitel4/Store",
                Icon = Icon.World,
                Leaf = true
            };

            var example7 = new Node
            {
                NodeID = "StoreNet",
                Text = "Store (Ext.NET)",
                Href = "/Kapitel4/StoreNet",
                Icon = Icon.World,
                Leaf = true
            };

            var exampleHelp = new Node
            {
                NodeID = "Help",
                Text = "WebApi Help Page",
                Href = "/help",
                Icon = Icon.Information,
                Leaf = true
            };

            var example8 = new Node
            {
                NodeID = "Grid",
                Text = "Grid (Ext JS)",
                Href = "/Kapitel4/Grid",
                Icon = Icon.World,
                Leaf = true
            };

            var example9 = new Node
            {
                NodeID = "GridNet",
                Text = "Grid (Ext.NET)",
                Href = "/Kapitel4/GridNet",
                Icon = Icon.World,
                Leaf = true
            };

            var jsFiddleHelloWorld = new Node
            {
                NodeID = "jsFiddle_helloWorld",
                Text = "jsFiddle: Hello World ",
                Href = "http://jsfiddle.net/gh/get/extjs/4.2/JohannesHoppe/ExtJsKochbuch/tree/master/examples/FiddleHelloWorld",
                Icon = Icon.WeatherCloud,
                Leaf = true
            };

            var jsFiddleNet = new Node
            {
                NodeID = "jsFiddle_grid",
                Text = "jsFiddle: Grid ",
                Href = "http://jsfiddle.net/gh/get/extjs/4.2/JohannesHoppe/ExtJsKochbuch/tree/master/examples/FiddleGrid",
                Icon = Icon.WeatherCloud,
                Leaf = true
            };

            var extNetDemo = new Node
            {
                NodeID = "extNetDemo",
                Text = "Ext.Net Demo ",
                Href = "/ExtNet",
                Icon = Icon.Information,
                Leaf = true
            };

            /*
            var chat = new Node
            {
                NodeID = "chat",
                Text = "Teilnehmer-Chat",
                Href = "http://chatroll.com/embed/chat/ext-js-kochbuch?id=i3JL4RMYjAJ&platform=html&w=$0",
                Icon = Icon.Information,
                Leaf = true
            };
            */

            var kapitel1 = new Node { Text = "Kapitel 1" };
            var kapitel2 = new Node { Text = "Kapitel 2" };
            var kapitel4 = new Node { Text = "Kapitel 4" };
            var chapterX = new Node { Text = "Playground" };

            kapitel1.Children.AddRange(new[] { example1, example2 });
            kapitel2.Children.AddRange(new[] { example3, example4, example5, exampleHelp });
            kapitel4.Children.AddRange(new[] { example6, example7, example8, example9 });
            chapterX.Children.AddRange(new[] { jsFiddleHelloWorld, jsFiddleNet, extNetDemo /*, chat */ });

            var nodes = new NodeCollection
                            {
                                kapitel1,
                                kapitel2,
                                kapitel4,
                                chapterX
                            };
            return nodes;
        }
    private Ext.Net.NodeCollection BuildTree(Ext.Net.NodeCollection nodes)
    {
        if (nodes == null)
        {
            nodes = new Ext.Net.NodeCollection();
        }
        Ext.Net.Node root = new Ext.Net.Node();
        root.Text = "Root";
        nodes.Add(root);

        int depid = 0, tem = 0;
        if (common.IntSafeConvert(cmbdept.SelectedItem.Value) > 0)
        {
            depid = common.IntSafeConvert(cmbdept.SelectedItem.Value);
        }
        string year = cmbyear.SelectedItem.Value ?? DateTime.Now.Year.ToString();

            DataTable dt = ExecuteNewLogic.GetDtAllPiidListyear(depid, year);
            if (dt.Rows.Count==0)
            {
                X.Msg.Alert("系统提示", "本月没有执行相关数据").Show();
                root.EmptyChildren = true;
                return nodes;
            }
            DataTable dtroot = dt.DefaultView.ToTable("dtroot", true, new string[] { "PIID", "ParentPIEcoSubName" });
            string piidList = "";
            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    int piid = common.IntSafeConvert(dt.Rows[i]["ChildID"]);
                    piidList += piid + ",";
                }

            }
            piidList = piidList.TrimEnd(',');
            DataTable dtcashier = ExecuteNewLogic.GetCashierDatayear(depid, year, piidList);
            DataTable RpMoney = ExecuteNewLogic.GetReceiptsDatayear(depid, year, piidList, 2);
            DataTable totalMon = ExecuteNewLogic.GetBudgetAllocationData(depid, year, piidList);
            DataTable newTable = new DataTable();
            newTable.Columns.Add("PIID");
            newTable.Columns.Add("ChildID");
            newTable.Columns.Add("PIEcoSubName");
            newTable.Columns.Add("totalMon");
            newTable.Columns.Add("BQMon");
            newTable.Columns.Add("RpMoney");
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DataRow drRow = newTable.NewRow();
                int piid = common.IntSafeConvert(dt.Rows[i]["ChildID"]);
                if (dtcashier.Rows.Count > 0)
                {
                    DataRow[] dtca = dtcashier.Select("piid=" + piid);
                    if (dtca.Length > 0)
                    {
                        drRow["BQMon"] = dtca[0]["BQMon"];
                        //drRow["CashierBalance"] = dtca[0]["CashierBalance"];
                    }
                }
                if (RpMoney.Rows.Count > 0)
                {
                    DataRow[] dtp2 = RpMoney.Select("piid=" + piid);
                    if (dtp2.Length > 0)
                    {
                        drRow["RpMoney"] = dtp2[0]["RpMoney"];
                    }
                }
                if (totalMon.Rows.Count > 0)
                {
                    DataRow[] dttotalMon = totalMon.Select("piid=" + piid);
                    if (dttotalMon.Length > 0)
                    {
                        drRow["totalMon"] = dttotalMon[0]["total"];
                    }
                }
                drRow["PIEcoSubName"] = dt.Rows[i]["PIEcoSubName"].ToString();
                drRow["ChildID"] = dt.Rows[i]["ChildID"].ToString();
                drRow["PIID"] = dt.Rows[i]["PIID"].ToString();
                newTable.Rows.Add(drRow);
            }

            for (int i = 0; i < dtroot.Rows.Count; i++)
            {
                Node newNode = new Node();
                string piid = dtroot.Rows[i]["piid"].ToString();
                newNode.NodeID = piid;
                newNode.Text = dtroot.Rows[i]["ParentPIEcoSubName"].ToString();
                newNode.Icon = Icon.Folder;
               // newNode.Leaf = true;
                decimal BQMond = 0, RpMoneyd = 0, totalMond = 0;
                DataRow[] drrowsleaf = newTable.Select("PIID=" + piid);
                if (drrowsleaf.Length > 0)
                {
                    NodeCollection nc=new NodeCollection();
                    for (int j = 0; j < drrowsleaf.Length; j++)
                    {
                        Node nodenew = new Node();
                        nodenew.NodeID = drrowsleaf[j]["ChildID"].ToString();
                        nodenew.Text = drrowsleaf[j]["PIEcoSubName"].ToString();
                        //nodenew.CustomAttributes.Add(new ConfigItem("PIID",drRows[j]["PIEcoSubName"].ToString(), ParameterMode.Value));
                        //nodenew.CustomAttributes.Add(new ConfigItem("PIEcoSubName",drRows[j]["PIEcoSubName"].ToString(), ParameterMode.Value));
                        nodenew.CustomAttributes.Add(new ConfigItem("BQMon", drrowsleaf[j]["BQMon"].ToString(), ParameterMode.Value));
                        nodenew.CustomAttributes.Add(new ConfigItem("RpMoney ", drrowsleaf[j]["RpMoney"].ToString(), ParameterMode.Value));
                        nodenew.CustomAttributes.Add(new ConfigItem("totalMon ", drrowsleaf[j]["totalMon"].ToString(), ParameterMode.Value));
                        nodenew.Leaf = true;
                        nodenew.Icon = Icon.Anchor;
                        nc.Add(nodenew);

                        BQMond += ParToDecimal.ParToDel(drrowsleaf[j]["BQMon"].ToString());
                        RpMoneyd += ParToDecimal.ParToDel(drrowsleaf[j]["RpMoney"].ToString());
                        totalMond += ParToDecimal.ParToDel(drrowsleaf[j]["totalMon"].ToString());
                    }
                    newNode.CustomAttributes.Add(new ConfigItem("BQMon", BQMond.ToString(), ParameterMode.Value));
                    newNode.CustomAttributes.Add(new ConfigItem("RpMoney ", RpMoneyd.ToString(), ParameterMode.Value));
                    newNode.CustomAttributes.Add(new ConfigItem("totalMon ", totalMond.ToString(), ParameterMode.Value));

                    root.Children.Add(newNode);
                    newNode.Children.AddRange(nc);
                }
                else
                {
                    newNode.EmptyChildren = true;
                }
            }

        return nodes;
    }
コード例 #45
0
 private void InitTreePanel(TreePanel treePanel, TreeStore treeStore, Model model)
 {
     treePanel.RootVisible = false;
     treePanel.AutoDataBind = true;
     Ext.Net.Parameter parameters = new Ext.Net.Parameter
     {
         Name = "id",
         Value = "record.data.id",
         Mode = ParameterMode.Raw
     };
     treePanel.DirectEvents.ItemDblClick.ExtraParams.Add(parameters);
     treePanel.DirectEvents.ItemDblClick.EventMask.ShowMask = true;
     treePanel.DirectEvents.ItemDblClick.EventMask.Msg = "正在添加";
     treeStore.AutoDataBind = true;
     treeStore.AutoLoad = true;
     model.Fields.Add(new ModelField("Id", ModelFieldType.Int));
     model.Fields.Add(new ModelField("Name", ModelFieldType.String));
     treeStore.Model.Add(model);
     treeStore.Proxy.Add(new PageProxy());
     treePanel.Store.Add(treeStore);
     Ext.Net.Node item = new Ext.Net.Node
     {
         NodeID = "0",
         Text = "根",
         Expanded = true
     };
     treeStore.Root.Add(item);
     Add(treePanel);
 }
コード例 #46
0
        private static NodeCollection BuildAreasLevel()
        {
            string path = HttpContext.Current.Server.MapPath(ExamplesModel.ExamplesRoot);
            DirectoryInfo root = new DirectoryInfo(path);
            DirectoryInfo[] folders = root.GetDirectories();
            folders = ExamplesModel.SortFolders(root, folders);

            NodeCollection nodes = new NodeCollection(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");

                string iconCls = string.IsNullOrEmpty(cfg.IconCls) ? "" : cfg.IconCls;
                Node node = null;
                var index = folder.Name.IndexOf('_');

                if (cfg.MainGroup || index < 0)
                {
                    node = new Node();
                    node.NodeID = BaseControl.GenerateID();
                    node.Text = folder.Name.Replace("_", " ");

                    nodes.Add(node);

                    node.IconCls = iconCls;
                    if (ExamplesModel.IsNew(folder.FullName))
                    {
                        node.CustomAttributes.Add(new ConfigItem("isNew", "true", ParameterMode.Raw));
                    }
                }
                else
                {
                    var mainGroupName = folder.Name.Substring(0, index);
                    node = nodes.FirstOrDefault(n => n.Text == mainGroupName);

                    if (node == null)
                    {
                        node = new Node();
                        node.NodeID = BaseControl.GenerateID();
                        node.Text = mainGroupName;
                        nodes.Add(node);
                    }

                    if (iconCls.IsNotEmpty())
                    {
                        node.IconCls = iconCls;
                    }

                    if (ExamplesModel.IsNew(folder.FullName) && !node.CustomAttributes.Contains("isNew"))
                    {
                        node.CustomAttributes.Add(new ConfigItem("isNew", "true", ParameterMode.Raw));
                    }

                    var groupNode = new Node();

                    groupNode.NodeID = BaseControl.GenerateID();
                    groupNode.Text = folder.Name.Substring(index + 1).Replace("_", " ");

                    if (ExamplesModel.IsNew(folder.FullName) && !groupNode.CustomAttributes.Contains("isNew"))
                    {
                        groupNode.CustomAttributes.Add(new ConfigItem("isNew", "true", ParameterMode.Raw));
                    }

                    node.Children.Add(groupNode);
                    node = groupNode;
                }

                ExamplesModel.BuildViewsLevel(folder, node);
            }

            return nodes;
        }
コード例 #47
0
        private static void BuildViewsLevel(DirectoryInfo area, Node areaNode)
        {
            DirectoryInfo[] folders = new DirectoryInfo(area.FullName + "\\Views").GetDirectories();

            folders = ExamplesModel.SortFolders(area, folders);

            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");

                string iconCls = string.IsNullOrEmpty(cfg.IconCls) ? "" : cfg.IconCls;
                Node node = new Node();

                string folderName = folder.Name.Replace("_", " ");

                node.Text = folderName;

                if (ExamplesModel.IsNew(folder.FullName))
                {
                    node.CustomAttributes.Add(new ConfigItem("isNew", "true", ParameterMode.Raw));
                }

                node.IconCls = iconCls;
                string url = string.Concat(ExamplesModel.ApplicationRoot, "/", area.Name, "/", folder.Name, "/");
                node.NodeID = "e" + Math.Abs(url.ToLower().GetHashCode());
                node.Href = url;

                node.Leaf = true;

                areaNode.Children.Add(node);
            }
        }
コード例 #48
0
ファイル: Privilege.cs プロジェクト: dusdong/BaseComponent
        //public List<Xinchen.ExtNetBase.TreePanelEx.Node> GetMenus(int parentId)
        //{
        //    IList<Xinchen.PrivilegeManagement.DTO.Menu> menus = this._privilegeBase.GetMenus(parentId);
        //    List<Xinchen.ExtNetBase.TreePanelEx.Node> list2 = new List<Xinchen.ExtNetBase.TreePanelEx.Node>();
        //    foreach (Xinchen.PrivilegeManagement.DTO.Menu menu in menus)
        //    {
        //        Xinchen.ExtNetBase.TreePanelEx.Node item = new Xinchen.ExtNetBase.TreePanelEx.Node
        //        {
        //            Id = menu.Id,
        //            Name = menu.Name
        //        };
        //        list2.Add(item);
        //    }
        //    return list2;
        //}

        public NodeCollection GetNavigationMenus(int parentId)
        {
            IList<UserMenu> navigationMenus = this._privilegeBase.GetNavigationMenus(parentId);
            var list2 = new NodeCollection();
            foreach (UserMenu menu in navigationMenus)
            {
                string url = menu.Url;
                Ext.Net.Node item = new Ext.Net.Node
                {
                    Text = menu.Name,
                    NodeID = menu.Id.ToString(),
                    Leaf = menu.ChildCount <= 0,
                    Icon = Ext.Net.Icon.Page,
                    Qtip = menu.Description,
                    Expanded = true
                };
                list2.Add(item);
            }
            return list2;
        }
コード例 #49
0
ファイル: TreeGrid.cs プロジェクト: dusdong/BaseComponent
 private void treeStore_ReadData(object sender, NodeLoadEventArgs e)
 {
     IList<Xinchen.ExtNetBase.TreePanelEx.Node> nodeItems = this._nodeHelper.GetNodeItems(Convert.ToInt32(e.ExtraParams["parentId"]));
     foreach (Xinchen.ExtNetBase.TreePanelEx.Node node in nodeItems)
     {
         Ext.Net.Node node2 = new Ext.Net.Node
         {
             Text = node.Name,
             NodeID = node.Id.ToString(),
             Leaf = false,
             AllowDrag = true,
             AllowDrop = true
         };
         ConfigItem item = new ConfigItem
         {
             Name = "Id",
             Value = node2.NodeID
         };
         node.CustomAttributes.Add(item);
         ConfigItem parameters = new ConfigItem
         {
             Name = "Name",
             Value = node2.Text
         };
         ConfigItem item3 = new ConfigItem
         {
             Name = "ParentId",
             Value = node.ParentId.ToString()
         };
         node2.CustomAttributes.Add(parameters);
         node2.CustomAttributes.Add(item3);
         node2.CustomAttributes.AddRange(node.CustomAttributes);
         e.Nodes.Add(node2);
     }
 }
コード例 #50
0
ファイル: TreeGrid.cs プロジェクト: dusdong/BaseComponent
        protected override void OnLoad(EventArgs e)
        {
            if (this._nodeHelper == null)
            {
                _nodeHelper = new NodeHelper(Table);
            }
            TreeStore.Config config = new TreeStore.Config
            {
                NodeParam = "parentId"
            };
            this._treeStore = new TreeStore(config);
            this._treeStore.ID = "_treeStore";
            Model model = new Model
            {
                Fields = { new ModelField("Id", ModelFieldType.String), new ModelField("Name", ModelFieldType.String), new ModelField("ParentId", ModelFieldType.String) }
            };
            model.Fields.AddRange(this._nodeHelper.CustomFields);
            this._treeStore.Model.Add(model);
            this._treeStore.Proxy.Add(new PageProxy());
            this.Store.Add(this._treeStore);
            this._treeStore.ReadData += new TreeStoreBase.ReadDataEventHandler(this.treeStore_ReadData);
            base.RemoteRemove += new TreePanel.RemoteRemoveEventHandler(this.TreePanelEx_RemoteRemove);
            base.RemoteEdit += new TreePanel.RemoteEditEventHandler(this.TreePanelEx_RemoteEdit);
            base.RemoteMove += new TreePanel.RemoteMoveEventHandler(this.TreePanelEx_RemoteMove);
            Ext.Net.Button button = new Ext.Net.Button
            {
                Text = "刷新",
                Handler = "App." + this.ID + ".getStore().load();"
            };
            Toolbar toolbar = new Toolbar();
            toolbar.Items.Add(button);
            this.TopBar.Add(toolbar);
            if (!Ext.Net.X.IsAjaxRequest)
            {
                //base.Listeners.NodeDragOver.Handler = "var recs = dragData.records;var prev=-1;for(var i=0;i<recs.length;i++){var recData=recs[i].data;if(prev==-1){prev=recData.Level;}else{if(prev!=recData.Level){return false;}}}if(targetNode.data.Level>=" + this.Level + ")return false;return true;";
                Parameter parameters = new Parameter
                {
                    Name = "parentId",
                    Value = "arguments[1].data.parentId",
                    Mode = ParameterMode.Raw
                };
                this.RemoteExtraParams.Add(parameters);
                this.On("beforeRemoteAction", new JFunction("Ext.net.Mask.show({ msg : '正在加载' });"));
                JFunction fn = new JFunction("Ext.net.Mask.hide();");
                this.On("remoteActionRefusal", fn);
                this.On("remoteActionException", fn);
                this.On("remoteActionSuccess", fn);
                this.On("remoteEditRefusal", new JFunction("Ext.Msg.alert('失败了')"));
                this._treeStore.On("beforeload", new JFunction("Ext.net.Mask.show({ msg : '正在加载' });"));
                this._treeStore.On("load", new JFunction("Ext.net.Mask.hide();"));
                Ext.Net.Node node = new Ext.Net.Node();
                node.CustomAttributes.Add(new ConfigItem("Id", ""));
                node.CustomAttributes.Add(new ConfigItem("Name", "根"));
                node.NodeID = "0";
                node.Expanded = true;
                node.Text = "根";
                this.Root.Add(node);
                Column column = new Column();
                this.ColumnModel.Columns.Add(column);
                TreeColumn column2 = new TreeColumn();
                this.ColumnModel.Columns.Add(column2);
                ActionColumn column3 = new ActionColumn();
                if (this.EnableRemove)
                {
                    ActionItem item2 = new ActionItem();
                    column3.Items.Add(item2);
                    item2.Icon = Ext.Net.Icon.PageWhiteDelete;
                    item2.Handler = "var record=arguments[5];var tree = App." + this.ID + ";var node = tree.getStore().getNodeById(record.data.Id) || tree.getStore().getNewRecords()[0];Ext.Msg.confirm(\"提示\", \"会删除相关的数据,无法恢复,确认删除?\", function (r) {if (r == \"yes\") {tree.removeNode(node);return;App.direct.RemoveNode(record.data.Id, {success: function (result) {if (result.Success) {node.remove();node.commit();} else {Ext.Msg.alert(\"错误\", result.Message);}},eventMask: {showMask: true,msg: \"正在删除\"}});}});";
                    item2.Tooltip = "删除";
                }
                this.ColumnModel.Columns.Add(column3);
                column.ID = "col1";
                column.DataIndex = "Id";
                column.Width = 50;
                column.Text = "编号";
                column2.ID = "col2";
                column2.DataIndex = "Name";
                column2.Width = 300;
                column2.Text = "名称";
                column3.ID = "col3";
                column3.Text = "操作";
                column3.Width = 60;
                column3.Align = Alignment.Center;
                if (EnableEdit)
                {
                    ActionItem item = new ActionItem();
                    column3.Items.Add(item);
                    item.Icon = Ext.Net.Icon.PageWhiteAdd;
                    item.Handler = "var record=arguments[5]; var tree = App." + this.ID + ";var ep = tree.editingPlugin;var node,store = tree.getStore();if (record.data.Id) {node = store.getNodeById(record.data.Id);}else{node = store.getRootNode();}node.expand(false, function () {node = node.appendChild({Name:'新节点'});setTimeout(function () {ep.startEdit(node, tree.columns[1]);}, 200);});";
                    item.Tooltip = "添加子节点";
                    CellEditing editing = new CellEditing();
                    editing.Listeners.CancelEdit.Handler = " if (e.record.data.Id) {e.record.reject();} else {e.record.remove(true);}";
                    this.Plugins.Add(editing);
                    this.Editor.Add(new TextField());
                    TreeView view = new TreeView();
                    this.View.Add(view);
                    TreeViewDragDrop drop = new TreeViewDragDrop
                    {
                        DragText = "移动到",
                        AppendOnly = true
                    };
                    view.Plugins.Add(drop);
                }
                this.Mode = TreePanelMode.Remote;

            }
            base.OnLoad(e);
        }
コード例 #51
0
ファイル: Desktop.aspx.cs プロジェクト: eliranye/CourseMates
        private Node GetFileStructure(FileItem fs)
        {
            Node root = new Node();
            root.Text = fs.FileName;
            root.NodeID = "Node-" + fs.ID;
            root.Icon = fs.IsFolder ? Icon.Folder : Icon.Report;

            if (fs.SubItems != null)
            {
                if (fs.ID == CourseFiles.RootFolder.ID)
                    root.Expanded = true;

                foreach (FileItem item in fs.SubItems)
                {
                    Node n = GetFileStructure(item);
                    if (n.Children.Count == 0)
                        n.Leaf = true;
                    root.Children.Add(n);
                }
            }
            else
                root.Leaf = true;
            return root;
        }
コード例 #52
0
ファイル: Node.cs プロジェクト: hpj1106/Ext.NET.Community
 void Nodes_AfterItemAdd(Node item)
 {
     item.ParentNode = this;
 }
コード例 #53
0
 /// <summary>
 /// Sets the root node for this store. See also the root config option.
 /// </summary>
 /// <param name="node"></param>
 public virtual void SetRootNode(Node node)
 {
     this.Call("setRootNode", new JRawValue(node.ToScript()));
 }
コード例 #54
0
        private void DataBindNode(Node node, string path)
        {            
            if (!this.IsBoundUsingDataSourceID && (this.DataSource == null))
            {
                return;
            }

            HierarchicalDataSourceView view = this.GetData(path);

            if (view == null)
            {
                throw new InvalidOperationException("DataSource returned a null view");
            }

            IHierarchicalEnumerable enumerable = view.Select();

            if (node != null)
            {
                node.Children.Clear();
            }
            
            if (enumerable != null)
            {
                if (this.IsBoundUsingDataSourceID)
                {
                    SiteMapDataSource siteMapDataSource = this.GetDataSource() as SiteMapDataSource;
                    if (siteMapDataSource != null)
                    {
                        if (this.currentSiteMapNodeDataPath == null)
                        {
                            IHierarchyData currentNodeData = (IHierarchyData)siteMapDataSource.Provider.CurrentNode;
                            if (currentNodeData != null)
                            {
                                this.currentSiteMapNodeDataPath = currentNodeData.Path;
                            }
                            else
                            {
                                this.currentSiteMapNodeDataPath = String.Empty;
                            }
                        }
                    }
                }

                this.DataBindRecursive(node, enumerable);
            }
        }
コード例 #55
0
ファイル: NodeProxy.cs プロジェクト: emayk/Ext.NET.Pro
 /// <summary>
 /// Insert node(s) as the last child node of the root node.
 ///
 /// If the node was previously a child node of another parent node, it will be removed from that node first.
 /// </summary>
 /// <param name="node">The node or Array of nodes to append</param>
 public virtual void AppendChild(Node node)
 {
     this.Call("appendChild", new JRawValue(node.ToScript(false)));
 }
コード例 #56
0
ファイル: Privilege.cs プロジェクト: dusdong/BaseComponent
 public List<Ext.Net.Node> GetPrivilegeNodes()
 {
     List<Ext.Net.Node> list = new List<Ext.Net.Node>();
     IList<Xinchen.PrivilegeManagement.DTO.Privilege> privileges = this._privilegeBase.GetPrivileges();
     foreach (Xinchen.PrivilegeManagement.DTO.Privilege privilege in privileges)
     {
         Ext.Net.Node item = new Ext.Net.Node
         {
             NodeID = privilege.Id.ToString(),
             Text = privilege.Description,
             Leaf = true
         };
         list.Add(item);
     }
     return list;
 }
コード例 #57
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="eventArgument"></param>
        /// <param name="extraParams"></param>
        public void RaiseAjaxPostBackEvent(string eventArgument, ParameterCollection extraParams)
        {
            bool success = true;
            string msg = null;

            StoreResponseData response = new StoreResponseData(true);

            try
            {
                if (eventArgument.IsEmpty())
                {
                    throw new ArgumentNullException("eventArgument");
                }

                //string data = null;
                //JToken parametersToken = null;

                //if (this.DirectConfig != null)
                //{
                //    JToken serviceToken = this.DirectConfig.SelectToken("config.serviceParams", false);

                //    if (serviceToken != null)
                //    {
                //        data = JSON.ToString(serviceToken);
                //    }
                //}

                switch (eventArgument)
                {
                    case "read":
                        if (this.IsBoundUsingDataSourceID)
                        {
                            Node bindNode = new Node();
                            this.DataBindNode(bindNode, extraParams["dataPath"]);
                            response.Data = bindNode.Children.ToJson();
                        }
                        else
                        {
                            NodeLoadEventArgs e = new NodeLoadEventArgs(extraParams);
                            this.OnReadData(e);
                            NodeCollection nodes = e.Nodes;
                            success = e.Success;
                            msg = e.ErrorMessage;
                            response.Data = nodes != null ? nodes.ToJson() : null;
                        }
                        break;
                }
            }
            catch (Exception ex)
            {
                success = false;
                msg = this.IsDebugging ? ex.ToString() : ex.Message;

                if (this.ResourceManager.RethrowAjaxExceptions)
                {
                    throw;
                }
            }

            

            //if (success)
            //{
            //    switch (eventArgument)
            //    {
            //        case "read":

            //            if (this.RequiresDataBinding)
            //            {
            //                this.DataBind();
            //            }

            //            response.Data = this.GetAjaxDataJson();
            //            PageProxy dsp = this.Proxy.Primary as PageProxy;
            //            response.Total = dsp != null ? dsp.Total : -1;
            //            break;
            //    }
            //}
            
            ResourceManager.ServiceResponse = new Response { Data = response.ToString(), Success = success, Message = msg };
        }
コード例 #58
0
ファイル: NodeProxy.cs プロジェクト: emayk/Ext.NET.Pro
 /// <summary>
 /// Inserts the first node before the second node in this nodes childNodes collection.
 /// </summary>
 /// <param name="node">The node to insert</param>
 /// <param name="refNode">The node to insert before</param>
 public virtual void InsertBefore(Node node, NodeProxy refNode)
 {
     this.Call("insertBefore", new JRawValue(node.ToScript()), new JRawValue(refNode.NodeInstance));
 }
コード例 #59
0
        private void DataBindRecursive(Node node, IHierarchicalEnumerable enumerable)
        {            
            int depth = node != null ? (node.Depth + 1) : 0;

            foreach (object item in enumerable)
            {
                IHierarchyData data = enumerable.GetHierarchyData(item);

                string nodeId = "";
                bool leaf = false;
                bool allowDrag = true;
                bool allowDrop = true;
                bool? _checked = null;
                string cls = "";
                bool editable = true;
                bool expandable = false;
                bool expanded = false;
                string href = "#";
                string hrefTarget = "";
                string iconFile = "";
                Icon icon = Icon.None;
                string iconCls = "";
                string qtip = "";
                string qtitle = "";
                string text = ""; 
                ConfigItemCollection customAttributes = null;
                object attributesObject = null;

                string dataMember = String.Empty;                

                dataMember = data.Type;

                NodeBinding level = this.DataBindings.GetBinding(dataMember, depth);

                bool populateOnDemand = level.PopulateOnDemand;

                if (level != null)
                {
                    PropertyDescriptorCollection props = TypeDescriptor.GetProperties(item);
                    
                    string field = level.TextField;
                    if (field.Length > 0)
                    {
                        PropertyDescriptor desc = props.Find(field, true);
                        if (desc != null)
                        {
                            object objData = desc.GetValue(item);
                            if (objData != null)
                            {
                                if (!String.IsNullOrEmpty(level.FormatString))
                                {
                                    text = string.Format(CultureInfo.CurrentCulture, level.FormatString, objData);
                                }
                                else
                                {
                                    text = objData.ToString();
                                }
                            }
                        }
                        else
                        {
                            throw new InvalidOperationException(ServiceMessages.TREESTORE_INVALID_DATA_BINDING.FormatWith(field, "TextField"));
                        }
                    }

                    if (String.IsNullOrEmpty(text))
                    {
                        text = level.Text;
                    }


                    field = level.NodeIDField;
                    if (field.Length > 0)
                    {
                        PropertyDescriptor desc = props.Find(field, true);
                        if (desc != null)
                        {
                            object objData = desc.GetValue(item);
                            if (objData != null)
                            {
                                nodeId = objData.ToString();
                            }
                        }
                        else
                        {
                            throw new InvalidOperationException(ServiceMessages.TREESTORE_INVALID_DATA_BINDING.FormatWith(field, "NodeIDField"));
                        }
                    }
                    else
                    {
                        nodeId = level.NodeID;
                    }

                    field = level.LeafField;
                    if (field.Length > 0)
                    {
                        PropertyDescriptor desc = props.Find(field, true);
                        if (desc != null)
                        {
                            object objData = desc.GetValue(item);
                            if (objData != null)
                            {
                                if (objData is bool)
                                {
                                    leaf = (bool)objData;
                                }
                                else
                                {
                                    if (!bool.TryParse(objData.ToString(), out leaf))
                                    {
                                        throw new InvalidOperationException(ServiceMessages.TREESTORE_INVALID_DATA_BINDING.FormatWith(field, "LeafField"));
                                    }
                                }
                            }
                            else
                            {
                                leaf = level.Leaf;
                            }
                        }
                        else
                        {
                            throw new InvalidOperationException(ServiceMessages.TREESTORE_INVALID_DATA_BINDING.FormatWith(field, "LeafField"));
                        }
                    }
                    else
                    {
                        leaf = level.Leaf;
                    }

                    field = level.AllowDragField;
                    if (field.Length > 0)
                    {
                        PropertyDescriptor desc = props.Find(field, true);
                        if (desc != null)
                        {
                            object objData = desc.GetValue(item);
                            if (objData != null)
                            {
                                if (objData is bool)
                                {
                                    allowDrag = (bool)objData;
                                }
                                else
                                {
                                    if (!bool.TryParse(objData.ToString(), out allowDrag))
                                    {
                                        throw new InvalidOperationException(ServiceMessages.TREESTORE_INVALID_DATA_BINDING.FormatWith(field, "AllowDragField"));
                                    }
                                }
                            }
                            else
                            {
                                allowDrag = level.AllowDrag;
                            }
                        }
                        else
                        {
                            throw new InvalidOperationException(ServiceMessages.TREESTORE_INVALID_DATA_BINDING.FormatWith(field, "AllowDragField"));
                        }
                    }
                    else
                    {
                        allowDrag = level.AllowDrag;
                    }

                    field = level.AllowDropField;
                    if (field.Length > 0)
                    {
                        PropertyDescriptor desc = props.Find(field, true);
                        if (desc != null)
                        {
                            object objData = desc.GetValue(item);
                            if (objData != null)
                            {
                                if (objData is bool)
                                {
                                    allowDrop = (bool)objData;
                                }
                                else
                                {
                                    if (!bool.TryParse(objData.ToString(), out allowDrop))
                                    {
                                        throw new InvalidOperationException(ServiceMessages.TREESTORE_INVALID_DATA_BINDING.FormatWith(field, "AllowDropField"));
                                    }
                                }
                            }
                            else
                            {
                                allowDrop = level.AllowDrop;
                            }
                        }
                        else
                        {
                            throw new InvalidOperationException(ServiceMessages.TREESTORE_INVALID_DATA_BINDING.FormatWith(field, "AllowDropField"));
                        }
                    }
                    else
                    {
                        allowDrop = level.AllowDrop;
                    }

                    field = level.CheckedField;
                    if (field.Length > 0)
                    {
                        PropertyDescriptor desc = props.Find(field, true);
                        if (desc != null)
                        {
                            object objData = desc.GetValue(item);
                            if (objData != null)
                            {
                                if (objData is bool?)
                                {
                                    _checked = (bool?)objData;
                                }
                                else if (objData is bool)
                                {
                                    _checked = (bool)objData;
                                }
                                else
                                {
                                    bool _temp;
                                    if (!bool.TryParse(objData.ToString(), out _temp))
                                    {
                                        throw new InvalidOperationException(ServiceMessages.TREESTORE_INVALID_DATA_BINDING.FormatWith(field, "CheckedField"));
                                    }
                                    _checked = _temp;
                                }
                            }
                            else
                            {
                                _checked = level.Checked;
                            }
                        }
                        else
                        {
                            throw new InvalidOperationException(ServiceMessages.TREESTORE_INVALID_DATA_BINDING.FormatWith(field, "CheckedField"));
                        }
                    }
                    else
                    {
                        _checked = level.Checked;
                    }

                    field = level.ExpandableField;
                    if (field.Length > 0)
                    {
                        PropertyDescriptor desc = props.Find(field, true);
                        if (desc != null)
                        {
                            object objData = desc.GetValue(item);
                            if (objData != null)
                            {
                                if (objData is bool)
                                {
                                    expandable = (bool)objData;
                                }
                                else
                                {
                                    bool _temp;
                                    if (!bool.TryParse(objData.ToString(), out _temp))
                                    {
                                        throw new InvalidOperationException(ServiceMessages.TREESTORE_INVALID_DATA_BINDING.FormatWith(field, "ExpandableField"));
                                    }
                                    expandable = _temp;
                                }
                            }
                            else
                            {
                                expandable = level.Expandable.HasValue ? level.Expandable.Value : false;
                            }
                        }
                        else
                        {
                            throw new InvalidOperationException(ServiceMessages.TREESTORE_INVALID_DATA_BINDING.FormatWith(field, "ExpandableField"));
                        }
                    }
                    else
                    {
                        expandable = level.Expandable.HasValue ? level.Expandable.Value : false;
                    }

                    field = level.EditableField;
                    if (field.Length > 0)
                    {
                        PropertyDescriptor desc = props.Find(field, true);
                        if (desc != null)
                        {
                            object objData = desc.GetValue(item);
                            if (objData != null)
                            {
                                if (objData is bool)
                                {
                                    editable = (bool)objData;
                                }
                                else
                                {
                                    if (!bool.TryParse(objData.ToString(), out editable))
                                    {
                                        throw new InvalidOperationException(ServiceMessages.TREESTORE_INVALID_DATA_BINDING.FormatWith(field, "EditableField"));
                                    }
                                }
                            }
                            else
                            {
                                editable = level.Editable;
                            }
                        }
                        else
                        {
                            throw new InvalidOperationException(ServiceMessages.TREESTORE_INVALID_DATA_BINDING.FormatWith(field, "EditableField"));
                        }
                    }
                    else
                    {
                        editable = level.Editable;
                    }

                    field = level.ExpandedField;
                    if (field.Length > 0)
                    {
                        PropertyDescriptor desc = props.Find(field, true);
                        if (desc != null)
                        {
                            object objData = desc.GetValue(item);
                            if (objData != null)
                            {
                                if (objData is bool)
                                {
                                    expanded = (bool)objData;
                                }
                                else
                                {
                                    if (!bool.TryParse(objData.ToString(), out expanded))
                                    {
                                        throw new InvalidOperationException(ServiceMessages.TREESTORE_INVALID_DATA_BINDING.FormatWith(field, "ExpandedField"));
                                    }
                                }
                            }
                            else
                            {
                                expanded = level.Expanded;
                            }
                        }
                        else
                        {
                            throw new InvalidOperationException(ServiceMessages.TREESTORE_INVALID_DATA_BINDING.FormatWith(field, "ExpandedField"));
                        }
                    }
                    else
                    {
                        expanded = level.Expanded;
                    }

                    field = level.ClsField;
                    if (field.Length > 0)
                    {
                        PropertyDescriptor desc = props.Find(field, true);
                        if (desc != null)
                        {
                            object objData = desc.GetValue(item);
                            if (objData != null)
                            {
                                cls = objData.ToString();
                            }
                        }
                        else
                        {
                            throw new InvalidOperationException(ServiceMessages.TREESTORE_INVALID_DATA_BINDING.FormatWith(field, "ClsField"));
                        }
                    }

                    if (String.IsNullOrEmpty(cls))
                    {
                        cls = level.Cls;
                    }

                    field = level.HrefField;
                    if (field.Length > 0)
                    {
                        PropertyDescriptor desc = props.Find(field, true);
                        if (desc != null)
                        {
                            object objData = desc.GetValue(item);
                            if (objData != null)
                            {
                                href = objData.ToString();
                            }
                        }
                        else
                        {
                            throw new InvalidOperationException(ServiceMessages.TREESTORE_INVALID_DATA_BINDING.FormatWith(field, "HrefField"));
                        }
                    }

                    if (String.IsNullOrEmpty(href))
                    {
                        href = level.Href;
                    }

                    field = level.HrefTargetField;
                    if (field.Length > 0)
                    {
                        PropertyDescriptor desc = props.Find(field, true);
                        if (desc != null)
                        {
                            object objData = desc.GetValue(item);
                            if (objData != null)
                            {
                                hrefTarget = objData.ToString();
                            }
                        }
                        else
                        {
                            throw new InvalidOperationException(ServiceMessages.TREESTORE_INVALID_DATA_BINDING.FormatWith(field, "HrefTargetField"));
                        }
                    }

                    if (String.IsNullOrEmpty(hrefTarget))
                    {
                        hrefTarget = level.HrefTarget;
                    }

                    field = level.IconFileField;
                    if (field.Length > 0)
                    {
                        PropertyDescriptor desc = props.Find(field, true);
                        if (desc != null)
                        {
                            object objData = desc.GetValue(item);
                            if (objData != null)
                            {
                                iconFile = objData.ToString();
                            }
                        }
                        else
                        {
                            throw new InvalidOperationException(ServiceMessages.TREESTORE_INVALID_DATA_BINDING.FormatWith(field, "IconFileField"));
                        }
                    }

                    if (String.IsNullOrEmpty(iconFile))
                    {
                        iconFile = level.IconFile;
                    }

                    field = level.IconClsField;
                    if (field.Length > 0)
                    {
                        PropertyDescriptor desc = props.Find(field, true);
                        if (desc != null)
                        {
                            object objData = desc.GetValue(item);
                            if (objData != null)
                            {
                                iconCls = objData.ToString();
                            }
                        }
                        else
                        {
                            throw new InvalidOperationException(ServiceMessages.TREESTORE_INVALID_DATA_BINDING.FormatWith(field, "IconClsField"));
                        }
                    }

                    if (String.IsNullOrEmpty(iconCls))
                    {
                        iconCls = level.IconCls;
                    }

                    field = level.QtipField;
                    if (field.Length > 0)
                    {
                        PropertyDescriptor desc = props.Find(field, true);
                        if (desc != null)
                        {
                            object objData = desc.GetValue(item);
                            if (objData != null)
                            {
                                qtip = objData.ToString();
                            }
                        }
                        else
                        {
                            throw new InvalidOperationException(ServiceMessages.TREESTORE_INVALID_DATA_BINDING.FormatWith(field, "QtipField"));
                        }
                    }

                    if (String.IsNullOrEmpty(qtip))
                    {
                        qtip = level.Qtip;
                    }

                    field = level.QtitleField;
                    if (field.Length > 0)
                    {
                        PropertyDescriptor desc = props.Find(field, true);
                        if (desc != null)
                        {
                            object objData = desc.GetValue(item);
                            if (objData != null)
                            {
                                qtitle = objData.ToString();
                            }
                        }
                        else
                        {
                            throw new InvalidOperationException(ServiceMessages.TREESTORE_INVALID_DATA_BINDING.FormatWith(field, "QtitleField"));
                        }
                    }

                    if (String.IsNullOrEmpty(qtitle))
                    {
                        qtitle = level.Qtitle;
                    }                    

                    field = level.IconField;
                    if (field.Length > 0)
                    {
                        PropertyDescriptor desc = props.Find(field, true);
                        if (desc != null)
                        {
                            object objData = desc.GetValue(item);
                            if (objData != null)
                            {
                                if (objData is Icon)
                                {
                                    icon = (Icon)objData;
                                }
                                else if (objData is string)
                                {
                                    try
                                    {
                                        icon = (Icon)Enum.Parse(typeof(Icon), objData.ToString(), true);
                                    }
                                    catch
                                    {
                                        throw new InvalidOperationException(ServiceMessages.TREESTORE_INVALID_DATA_BINDING.FormatWith(field, "IconField"));
                                    }
                                }
                                else
                                {
                                    throw new InvalidOperationException(ServiceMessages.TREESTORE_INVALID_DATA_BINDING.FormatWith(field, "IconField"));
                                }
                            }
                        }
                        else
                        {
                            throw new InvalidOperationException(ServiceMessages.TREESTORE_INVALID_DATA_BINDING.FormatWith(field, "IconField"));
                        }
                    }
                    else
                    {
                        icon = level.Icon;
                    }

                    field = level.AttributesField;
                    if (field.Length > 0)
                    {
                        PropertyDescriptor desc = props.Find(field, true);
                        if (desc != null)
                        {
                            object objData = desc.GetValue(item);
                            if (objData != null)
                            {
                                attributesObject = objData;
                            }
                        }
                        else
                        {
                            throw new InvalidOperationException(ServiceMessages.TREESTORE_INVALID_DATA_BINDING.FormatWith(field, "AttributesField"));
                        }
                    }
                    else
                    {
                        attributesObject = level.AttributesObject;
                    }

                    customAttributes = new ConfigItemCollection();
                    customAttributes.AddRange(level.CustomAttributes);                    
                }
                else
                {
                    if (item is INavigateUIData)
                    {
                        INavigateUIData navigateUIData = (INavigateUIData)item;
                        text = navigateUIData.Name;
                        href = navigateUIData.NavigateUrl;
                        customAttributes = new ConfigItemCollection { 
                            new ConfigItem("value", navigateUIData.Value, ParameterMode.Value)
                        };
                        
                        qtip = navigateUIData.Description;
                    }

                    populateOnDemand = false;
                }                

                Node newNode = new Node();
                if (nodeId.IsNotEmpty())
                {
                    newNode.NodeID = nodeId;
                }

                if (text.IsNotEmpty())
                {
                    newNode.Text = text;
                }

                newNode.Leaf = leaf;
                newNode.AllowDrag = allowDrag;
                newNode.AllowDrop = allowDrop;
                newNode.Checked = _checked;
                newNode.Expandable = expandable;
                newNode.Expanded = expanded;

                if (cls.IsNotEmpty())
                {
                    newNode.Cls = cls;
                }

                if (href.IsNotEmpty())
                {
                    newNode.Href = href;
                }

                if (hrefTarget.IsNotEmpty())
                {
                    newNode.HrefTarget = hrefTarget;
                }

                if (iconFile.IsNotEmpty())
                {
                    newNode.IconFile = iconFile;
                }

                if (iconCls.IsNotEmpty())
                {
                    newNode.IconCls = iconCls;
                }

                if (qtip.IsNotEmpty())
                {
                    newNode.Qtip = qtip;
                }

                if (qtitle.IsNotEmpty())
                {
                    newNode.Qtitle = qtitle;
                }

                if (customAttributes != null)
                {
                    newNode.CustomAttributes.AddRange(customAttributes);
                }

                if (attributesObject != null)
                {
                    newNode.AttributesObject = attributesObject;
                }

                if (icon != Icon.None)
                {
                    newNode.Icon = icon;
                }

                if (!newNode.Leaf && populateOnDemand)
                {
                    newNode.DataPath = data.Path;
                }

                if (node == null)
                {
                    this.Root.Add(newNode);
                }
                else
                {
                    node.Children.Add(newNode);
                }                

                if (String.Equals(data.Path, this.currentSiteMapNodeDataPath, StringComparison.OrdinalIgnoreCase))
                {
                    //newNode.Selected = true; //??? may be implemente selected property for the node

                    if (!X.IsAjaxRequest)
                    {
                        Node newNodeParent = newNode.ParentNode;
                        while (newNodeParent != null)
                        {
                            if (newNodeParent.Expanded != true)
                            {
                                newNodeParent.Expanded = true;
                            }

                            newNodeParent = newNodeParent.ParentNode;
                        }
                    }
                }

                if (data.HasChildren && !populateOnDemand)
                {
                    IHierarchicalEnumerable newEnumerable = data.GetChildren();
                    if (newEnumerable != null)
                    {
                        this.DataBindRecursive(newNode, newEnumerable);
                    }
                }
            }
        }
コード例 #60
0
ファイル: NodeProxy.cs プロジェクト: emayk/Ext.NET.Pro
 /// <summary>
 /// Insert a node into this node
 /// </summary>
 /// <param name="index">The zero-based index to insert the node at</param>
 /// <param name="node">The node to insert</param>
 public virtual void InsertChild(int index, Node node)
 {
     this.Call("insertChild", index, new JRawValue(node.ToScript()));
 }