Exemplo n.º 1
0
        private void bindParentMenu()
        {
            ddrParent.Items.Clear();
            BLL.ed_node deptBll = new BLL.ed_node();
            DataTable   dt      = deptBll.GetList("parentId=0 order by orders asc").Tables[0];

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                ddrParent.Items.Add(new ListItem(dt.Rows[i]["title"].ToString(), dt.Rows[i]["Id"].ToString()));
                DataTable dt2 = deptBll.GetList("parentId=" + dt.Rows[i]["id"].ToString() + "   order by orders desc").Tables[0];
                for (int j = 0; j < dt2.Rows.Count; j++)
                {
                    ddrParent.Items.Add(new ListItem("┣" + dt2.Rows[j]["title"].ToString(), dt2.Rows[j]["Id"].ToString()));
                }
            }
            ddrParent.Items.Insert(0, new ListItem("根栏目", "0"));
        }
Exemplo n.º 2
0
        public static string getNodeUrl(string nodeId)
        {
            BLL.ed_node nBll   = new BLL.ed_node();
            string      result = "";

            Model.ed_node model = nBll.GetModel(int.Parse(nodeId));
            if (model.url == "0")
            {
                result = "javascript:void(0)";
            }
            else
            {
                if (!string.IsNullOrEmpty(model.url))
                {
                    result = model.url;
                }
                else
                {
                    if (model.types.ToString() == StatusHelper.Node_Type_Page)
                    {
                        result = "/node.aspx?id=" + model.ID;
                    }
                    else if (model.types.ToString() == StatusHelper.Node_Type_News)
                    {
                        result = "/newsList.aspx?id=" + model.ID;
                    }
                    else if (model.types.ToString() == StatusHelper.Node_Type_Product)
                    {
                        result = "/productList.aspx?id=" + model.ID;
                    }
                    else if (model.types.ToString() == StatusHelper.Node_Type_Media)
                    {
                        result = "/mediaList.aspx?id=" + model.ID;
                    }
                    else
                    {
                        result = "/error.aspx";
                    }
                }
            }

            return(result);
        }