Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         KingTop.BLL.SysManage.ModuleNode nodeObj = new KingTop.BLL.SysManage.ModuleNode();
         DataTable dt = nodeObj.GetList("LISTBYNODECODE", KingTop.Common.Utils.getOneParams(NodeCode));
         if (dt.Rows.Count > 0)
         {
             OutUrl = dt.Rows[0]["LinkUrl"].ToString();
         }
     }
 }
Ejemplo n.º 2
0
        //通过NodeCode和SiteID获取Nodeid
        private string GetNodeId()
        {
            string strResult = string.Empty;

            KingTop.BLL.SysManage.ModuleNode bll = new KingTop.BLL.SysManage.ModuleNode();
            DataTable dt = bll.GetModeNodeFromCache();

            DataRow[] dr = dt.Select("NodeCode='" + NodeCode + "' and webSiteID=" + SiteID);
            if (dr.Length > 0)
            {
                strResult = dr[0]["NodeID"].ToString();
            }
            return(strResult);
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string publishtype = KingTop.WEB.BasePage.PublishType;

            DataTable dt = new DataTable();

            if (KingTop.Common.AppCache.IsExist("PublishNodeCache"))
            {
                dt = (DataTable)KingTop.Common.AppCache.Get("PublishNodeCache");
            }
            else
            {
                KingTop.BLL.SysManage.ModuleNode bll = new KingTop.BLL.SysManage.ModuleNode();
                dt = bll.Publish_GetNodeFromCache();
            }

            dt2 = dt.Copy();        //将缓存的table复制到新table中,否则以下合并列时会影响缓存table

            if (publishtype == "0") //如果是动态,则将datatable中的subdomain复制到linkUrl
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    string url = dt.Rows[i]["subdomain"].ToString();
                    if (url.IndexOf("?") == -1)
                    {
                        url = url + "?nc=" + dt.Rows[i]["NodeCode"].ToString();
                    }
                    else if (url.IndexOf("nc=") == -1)
                    {
                        url = url + "&nc=" + dt.Rows[i]["NodeCode"].ToString();
                    }
                    dt2.Rows[i]["linkUrl"] = url;
                }
            }

            DataRow[] dr = dt2.Select("ParentNode='101'", " NodelOrder ASC");
            Repeater1.DataSource = dr;
            Repeater1.DataBind();
        }
Ejemplo n.º 4
0
        public string GetURLByNode(string nodeCode)
        {
            string    re = "/";
            DataTable dt;

            if (KingTop.Common.AppCache.IsExist("PublishNodeCache"))
            {
                dt = (DataTable)KingTop.Common.AppCache.Get("PublishNodeCache");
            }
            else
            {
                KingTop.BLL.SysManage.ModuleNode bll = new KingTop.BLL.SysManage.ModuleNode();
                dt = bll.Publish_GetNodeFromCache();
            }
            DataRow[] dr = dt.Select("NodeCode='" + nodeCode + "'");

            if (dr.Length > 0)
            {
                if (PublishType == "0")
                {
                    re = dr[0]["subdomain"].ToString();
                    if (re.IndexOf("?") == -1) //如果没有带参数,则加参数
                    {
                        re = re + "?nc=" + nodeCode;
                        return(re);
                    }
                    if (re.IndexOf("nc=") == -1) //有参数,但是没有nodecode,则加上
                    {
                        re = re + "&nc=" + nodeCode;
                    }
                }
                else
                {
                    re = dr[0]["linkUrl"].ToString();
                }
            }
            return(re);
        }