Exemple #1
0
            public override TreeJSONBase BuildTreeNode(DataRow dr)
            {
                ReportListJSONBase node = new ReportListJSONBase();

                node.text    = dr["rep_name"].ToString();
                node.phid    = dr["phid"].ToString();
                node.leaf    = (dr["isleaf"].ToString() == "1");
                node.bustype = dr["rep_code"].ToString();
                node.id      = dr["phid"].ToString();
                node.src     = dr["rep_src"].ToString();

                if (dr["isleaf"].ToString() == "1")
                {
                    node.url = "RW/DesignFrame/ReportView?rep_src=" + node.src + "&rep_id=" + node.phid + "&rep_code=" + node.bustype;
                }

                return(node);
            }
Exemple #2
0
        /// <summary>
        /// 避免id重复,重新处理树节点的id
        /// </summary>
        /// <param name="dt"></param>
        private void DealId(ReportListJSONBase node)
        {
            if (node.leaf)
            {
                node.id += "1" + node.src;
            }
            else
            {
                node.id += "0" + node.src;
            }

            if (node.children != null && node.children.Count > 0)
            {
                foreach (ReportListJSONBase childNode in node.children)
                {
                    DealId(childNode);
                }
            }
        }
Exemple #3
0
            public override TreeJSONBase BuildTreeNode(DataRow dr)
            {
                ReportListJSONBase node = new ReportListJSONBase();

                node.text = dr["rep_name"].ToString();
                node.phid = dr["phid"].ToString();
                node.name = dr["rep_name"].ToString();
                node.leaf = (dr["isleaf"].ToString() == "1");
                node.code = dr["rep_code"].ToString();
                node.id   = dr["phid"].ToString();
                node.pid  = dr["pid"].ToString();

                if (dr["isleaf"].ToString() == "1")
                {
                    string phid = node.phid.Substring(0, node.phid.Length - 1);
                    string page = dr["page"] == DBNull.Value?"":dr["page"].ToString();
                    node.url = "RW/DesignFrame/ReportView?rep_src=0&rep_id=" + phid + "&rep_code=" + node.code + "&page=" + page;
                }

                return(node);
            }