Beispiel #1
0
        protected Model.channel channelModel   = new Model.channel();          //分类的实体

        /// <summary>
        /// 重写虚方法,此方法将在Init事件前执行
        /// </summary>
        protected override void ShowPage()
        {
            category_id = DTRequest.GetQueryInt("category_id");
            call_index  = Utils.SafeXXS(DTRequest.GetQueryString("call_index"));

            BLL.article_category bll = new BLL.article_category();
            model.title = "所有类别";
            if (category_id > 0) //如果ID获取到,将使用ID
            {
                if (!bll.Exists(category_id))
                {
                    HttpContext.Current.Response.Redirect(linkurl("error"));
                    return;
                }
                model = bll.GetModel(category_id);
            }
            else if (!string.IsNullOrEmpty(call_index)) //否则检查设置的别名
            {
                if (!bll.Exists(call_index))
                {
                    HttpContext.Current.Response.Redirect(linkurl("error"));
                    return;
                }
                model = bll.GetModel(call_index);
                //赋值类别ID
                category_id = model.id;
            }
            //判断SEO标题
            if (string.IsNullOrEmpty(model.seo_title) || "" == model.seo_title)
            {
                model.seo_title = model.title;
            }
            //获取频道内容
            channelModel = new BLL.channel().GetModel(model.channel_id);
        }
Beispiel #2
0
        /// <summary>
        /// 重写虚方法,此方法将在Init事件前执行
        /// </summary>
        protected override void ShowPage()
        {
            page        = DTRequest.GetQueryInt("page", 1);
            category_id = DTRequest.GetQueryInt("category_id");
            strorder    = DTRequest.GetQueryString("strorder");
            keyword     = DTRequest.GetQueryString("keyword");
            flag        = DTRequest.GetQueryString("flag");
            if (string.IsNullOrEmpty(flag))
            {
                flag = "default";
            }

            if (string.IsNullOrEmpty(strorder) || strorder == "default")
            {
                strorder  = "default";
                str_order = "sort_id asc,add_time desc";
            }
            else
            {
                switch (strorder)
                {
                case "moneya":
                    str_order = "sell_price asc";
                    break;

                case "moneyd":
                    str_order = "sell_price desc";
                    break;
                }
            }

            BLL.article_category bll = new BLL.article_category();
            model.title = "所有信息";
            if (category_id > 0) //如果ID获取到,将使用ID
            {
                if (bll.Exists(category_id))
                {
                    model = bll.GetModel(category_id);
                }
                parent_category_id = model.parent_id;

                if (bll.Exists(parent_category_id))
                {
                    parent_category_title = bll.GetModel(parent_category_id).title;
                }
            }



            //if (hot_search.Contains(","))
            //{
            //    for (int i = 0; i < hot_search.Split(',').Length; i++)
            //    {

            //    }
            //}
        }
Beispiel #3
0
        protected int totalcount; //OUT数据总数

        #endregion Fields

        #region Methods

        /// <summary>
        /// 重写虚方法,此方法将在Init事件前执行
        /// </summary>
        protected override void ShowPage()
        {
            page = DTRequest.GetQueryInt("page", 1);
            category_id = DTRequest.GetQueryInt("category_id");
            strorder = DTRequest.GetQueryString("strorder");
            keyword = DTRequest.GetQueryString("keyword");
            flag = DTRequest.GetQueryString("flag");
            if (string.IsNullOrEmpty(flag))
            {
                flag = "default";
            }

            if (string.IsNullOrEmpty(strorder) || strorder == "default")
            {
                strorder = "default";
                str_order = "sort_id asc,add_time desc";
            }
            else
            {
                switch (strorder)
                {
                    case "moneya":
                        str_order = "sell_price asc";
                        break;
                    case "moneyd":
                        str_order = "sell_price desc";
                        break;
                }
            }

            BLL.article_category bll = new BLL.article_category();
            model.title = "所有信息";
            if (category_id > 0) //如果ID获取到,将使用ID
            {
                if (bll.Exists(category_id))
                    model = bll.GetModel(category_id);
                parent_category_id = model.parent_id;

                if (bll.Exists(parent_category_id))
                {
                    parent_category_title = bll.GetModel(parent_category_id).title;
                }
            }

            //if (hot_search.Contains(","))
            //{
            //    for (int i = 0; i < hot_search.Split(',').Length; i++)
            //    {

            //    }
            //}
        }
        /// <summary>
        /// 重写虚方法,此方法将在Init事件前执行
        /// </summary>
        protected override void ShowPage()
        {
            page         = DTRequest.GetQueryInt("page", 1);
            category_id  = DTRequest.GetQueryInt("category_id");
            category_ids = DTRequest.GetQueryString("category_ids");
            if (category_id > 0) //如果ID获取到,将使用ID
            {
                var bll = new BLL.article_category();
                if (bll.Exists(category_id))
                {
                    category = bll.GetModel(category_id);
                }
            }
            else if (!string.IsNullOrWhiteSpace(category_ids))
            {
                var firstCategoryId = Convert.ToInt32(category_ids.Split(',')[0]);
                var bll             = new BLL.article_category();
                if (bll.Exists(firstCategoryId))
                {
                    category = bll.GetModel(firstCategoryId);
                }
            }

            var articleId = DTRequest.GetQueryInt("articleId");

            if (articleId != 0)
            {
                var context = new Agp2pDataContext();
                article        = context.dt_article.Single(a => a.id == articleId);
                article.click += 1;
                context.SubmitChanges();
            }
        }
Beispiel #5
0
 /// <summary>
 /// 返回当前类别名称
 /// </summary>
 /// <param name="category_id">类别ID</param>
 /// <returns>String</returns>
 protected string get_category_title(int category_id, string default_value)
 {
     BLL.article_category bll = new BLL.article_category();
     if (bll.Exists(category_id))
     {
         return(bll.GetTitle(category_id));
     }
     return(default_value);
 }
Beispiel #6
0
 /// <summary>
 /// 返回当前类别名称
 /// </summary>
 /// <param name="category_id">类别ID</param>
 /// <returns>String</returns>
 protected string get_category_title(int category_id, string default_value)
 {
     BLL.article_category bll = new BLL.article_category();
     if (bll.Exists(category_id))
     {
         return bll.GetTitle(category_id);
     }
     return default_value;
 }
Beispiel #7
0
        protected int totalcount; //OUT数据总数

        #endregion Fields

        #region Methods

        /// <summary>
        /// 重写虚方法,此方法将在Init事件前执行
        /// </summary>
        protected override void ShowPage()
        {
            page = MXRequest.GetQueryInt("page", 1);
            category_id = MXRequest.GetQueryInt("category_id");
            BLL.article_category bll = new BLL.article_category();
            model.title = "所有信息";
            if (category_id > 0) //如果ID获取到,将使用ID
            {
                if (bll.Exists(category_id))
                    model = bll.GetModel(category_id);
            }
        }
        public Model.site_channel channelModel = new Model.site_channel();     //分类的实体

        protected override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            base.OnActionExecuting(filterContext);
            category_id = DTRequest.GetQueryInt("category_id");
            call_index  = Utils.SafeXXS(DTRequest.GetQueryString("call_index"));
            action      = DTRequest.GetQueryString("action");

            BLL.article_category bll = new BLL.article_category();
            model.title = "所有类别";
            if (category_id > 0) //如果ID获取到,将使用ID
            {
                if (!bll.Exists(category_id))
                {
                    Response.Redirect(linkurl("error"));
                    return;
                }
                model = bll.GetModel(category_id);
            }
            else if (!string.IsNullOrEmpty(call_index)) //否则检查设置的别名
            {
                if (!bll.Exists(call_index))
                {
                    Response.Redirect(linkurl("error"));
                    return;
                }
                model = bll.GetModel(call_index);
                //赋值类别ID
                category_id = model.id;
            }
            //判断SEO标题
            if (string.IsNullOrEmpty(model.seo_title) || "" == model.seo_title)
            {
                model.seo_title = model.title;
            }
            //获取频道内容
            channelModel = new BLL.site_channel().GetModel(model.channel_id);

            ViewBag.ChannelModel = channelModel;
            ViewBag.model        = model;
        }
 /// <summary>
 /// 重写虚方法,此方法将在Init事件前执行
 /// </summary>
 protected override void ShowPage()
 {
     page        = MXRequest.GetQueryInt("page", 1);
     category_id = MXRequest.GetQueryInt("category_id");
     BLL.article_category bll = new BLL.article_category();
     model.title = "所有信息";
     if (category_id > 0) //如果ID获取到,将使用ID
     {
         if (bll.Exists(category_id))
         {
             model = bll.GetModel(category_id);
         }
     }
 }
Beispiel #10
0
 /// <summary>
 /// OnInit事件,让频道名称变量先赋值
 /// </summary>
 void article_list_Init(object sender, EventArgs e)
 {
     page        = DTRequest.GetQueryInt("page", 1);
     category_id = DTRequest.GetQueryInt("category_id");
     BLL.article_category bll = new BLL.article_category();
     model.title = "所有分类";
     if (category_id > 0) //如果ID获取到,将使用ID
     {
         if (bll.Exists(category_id))
         {
             model = bll.GetModel(category_id);
             if (!string.IsNullOrEmpty(model.link_url))
             {
                 HttpContext.Current.Response.Redirect(model.link_url);
             }
         }
     }
 }