Beispiel #1
0
 /// <summary>
 /// 栏目URL
 public string Url(string _key,int _id)
 {
     string _url = string.Empty;
     Model.contents.article model = new BLL.contents.article().GetModel(_id);
     if (model != null)
     {
         _url = new BasePage().linkurl(_key, model.category_id,_id);
     }
     return _url.ToString();
 }
Beispiel #2
0
 /// <summary>
 /// 栏目URL
 public string Url(int category_id)
 {
     string _url = string.Empty;
     BLL.contents.article_category bll = new BLL.contents.article_category();
     DataTable dt = bll.GetList(0, "class_list like '%," + category_id + ",%'", "class_layer desc, sort_id asc,id desc").Tables[0];
     if (dt.Rows.Count > 0 && dt.Rows != null)
     {
         if (!string.IsNullOrEmpty(dt.Rows[0]["link_url"].ToString()))
         {
             _url = dt.Rows[0]["link_url"].ToString();
         }
         else
         {
             if (bll.GetModel(category_id).model_id != 0)
             {
                 string _key1 = BasePage.pageUrl(bll.GetModel(category_id).model_id);
                 _url = new BasePage().linkurl(_key1, category_id);
             }
             else
             {
                 string _key = BasePage.pageUrl(Convert.ToInt32(dt.Rows[0]["model_id"]));
                 string _category_id = dt.Rows[0]["id"].ToString();
                 _url = new BasePage().linkurl(_key, _category_id);
             }
         }
     }
     return _url.ToString();
 }