Exemplo n.º 1
0
 /// <summary>
 /// 返回当前类别名称
 /// </summary>
 /// <param name="category_id">类别ID</param>
 /// <returns>String</returns>
 protected string get_category_title(int category_id, string default_value)
 {
     BLL.category bll = new BLL.category();
     if (bll.Exists(category_id))
     {
         return bll.GetTitle(category_id);
     }
     return default_value;
 }
Exemplo n.º 2
0
 /// <summary>
 /// 返回当前类别名称
 /// </summary>
 /// <param name="category_id">类别ID</param>
 /// <returns>String</returns>
 protected string get_category_title(int category_id, string default_value)
 {
     BLL.category bll = new BLL.category();
     if (bll.Exists(category_id))
     {
         return(bll.GetTitle(category_id));
     }
     return(default_value);
 }
Exemplo n.º 3
0
 /// <summary>
 /// 递归找到父节点
 /// </summary>
 private void LoopChannelMenu(StringBuilder strTxt, string urlKey, int category_id)
 {
     BLL.category bll = new BLL.category();
     int parentId = bll.GetParentId(category_id);
     if (parentId > 0)
     {
         this.LoopChannelMenu(strTxt, urlKey, parentId);
     }
     strTxt.Append("&nbsp;&gt;&nbsp;<a href=\"" + linkurl(urlKey, category_id, 1) + "\">" + bll.GetTitle(category_id) + "</a>");
 }
Exemplo n.º 4
0
        //protected void btnSave_Click(object sender, EventArgs e)
        //{
        //    Model.article_comment model = new Model.article_comment();
        //    //HttpCookie cook = Request.Cookies["WEBUSERID"];
        //    string cook = Utils.GetCookie("WEBUSERID").ToString();
        //    if (cook == null)
        //    {
        //        this.Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('請先登入');window.location.href='login_vip.aspx'</script>");
        //    }
        //    else
        //    {
        //        //ids = cook.Value;
        //    }
        //    string Content = Request.Form["txtContent"];

        //    model.content = DTcms.Common.Utils.ToHtml(Content);
        //    model.article_id = id;
        //    model.user_ip = DTcms.Common.DTRequest.GetIP();
        //    BLL.article_comment bll = new BLL.article_comment();
        //    bll.Add(model);
        //    this.Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('送出成功');window.location.href='productview.aspx?id=" + id + "&mid=2'</script>");
        //}
        #endregion


        #region 獲取分區標題
        public string GetUserArea(int ID)
        {
            string Name = string.Empty;

            if (ID != 0)
            {
                int          CataID = ID;
                BLL.category CATA   = new BLL.category();
                Name = CATA.GetTitle(CataID);
            }
            return(Name);
        }
Exemplo n.º 5
0
        public string GetCategory(string CID)
        {
            string cataName = string.Empty;

            if (!string.IsNullOrEmpty(CID))
            {
                int          ID     = Utils.StringToNum(CID);
                BLL.category bllcat = new BLL.category();
                cataName = bllcat.GetTitle(ID);
            }
            return(cataName);
        }
Exemplo n.º 6
0
        void list()
        {
            BLL.category bll       = new BLL.category();
            string       CatList   = string.Empty;
            string       FirstName = bll.GetTitle(PartentID);
            string       keyWords  = string.Empty;

            // CatList = "<h3><a href='Search.aspx?Pcid=" + PartentID + "&mid=" + channel_id + "&Catacid=" + PartentID + "'>" + FirstName + "</a></h3>";
            CatList = "<h3>" + FirstName + "</h3>";
            if (!string.IsNullOrEmpty(Request.QueryString["key"]) && Request.QueryString["key"] != "請輸入商品名稱")
            {
                keyWords = Request.QueryString["key"];
            }
            DataTable dt = bll.GetNextList(this.PartentID, channel_id, keyWords);

            if (dt != null)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    int    pID        = Utils.StringToNum(dt.Rows[i]["ID"].ToString());
                    string SecondName = dt.Rows[i]["title"].ToString();
                    CatList += "<h1><a href='Search.aspx?Pcid=" + PartentID + "&mid=" + channel_id + "&Catacid=" + pID + "'>" + SecondName + "</a></h1>";
                    DataTable dt1 = bll.GetList(pID, channel_id);
                    if (dt1 != null)
                    {
                        for (int j = 0; j < dt1.Rows.Count; j++)
                        {
                            pID = Utils.StringToNum(dt1.Rows[j]["ID"].ToString());
                            string ThreeName = dt1.Rows[j]["title"].ToString();
                            CatList += "<h2><a href='Search.aspx?Pcid=" + PartentID + "&mid=" + channel_id + "&Catacid=" + pID + "'>" + ThreeName + "</a></h2>";
                        }
                    }
                }
            }
            HtmlList.InnerHtml = CatList;
        }
Exemplo n.º 7
0
        /// <summary>
        /// 递归找到父节点
        /// </summary>
        private void LoopChannelMenu(StringBuilder strTxt, string urlKey, int category_id)
        {
            BLL.category bll      = new BLL.category();
            int          parentId = bll.GetParentId(category_id);

            if (parentId > 0)
            {
                this.LoopChannelMenu(strTxt, urlKey, parentId);
            }
            strTxt.Append("&nbsp;&gt;&nbsp;<a href=\"" + linkurl(urlKey, category_id, 1) + "\">" + bll.GetTitle(category_id) + "</a>");
        }