예제 #1
0
        private void RptBind(int _channel_id, int _category_id, string _strWhere, string _orderby)
        {
            this.page = DTRequest.GetQueryInt("page", 1);
            if (this.category_id > 0)
            {
                this.ddlCategoryId.SelectedValue = _category_id.ToString();
            }
            this.ddlProperty.SelectedValue = this.property;
            this.txtKeywords.Text          = this.keywords;
            Rain.BLL.article article = new Rain.BLL.article();
            switch (this.prolistview)
            {
            case "Txt":
                this.rptList2.Visible    = false;
                this.rptList1.DataSource = (object)article.GetList(_channel_id, _category_id, this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
                this.rptList1.DataBind();
                break;

            default:
                this.rptList1.Visible    = false;
                this.rptList2.DataSource = (object)article.GetList(_channel_id, _category_id, this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
                this.rptList2.DataBind();
                break;
            }
            this.txtPageNum.Text       = this.pageSize.ToString();
            this.PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, Utils.CombUrlTxt("article_list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}&page={4}", _channel_id.ToString(), _category_id.ToString(), this.keywords, this.property, "__id__"), 8);
        }
예제 #2
0
파일: article_show.cs 프로젝트: Hcq/Rain
        protected string get_prevandnext_article(
            string urlkey,
            int type,
            string defaultvalue,
            int callIndex)
        {
            string str1 = type == -1 ? "<" : ">";

            Rain.BLL.article article    = new Rain.BLL.article();
            string           empty      = string.Empty;
            string           str2       = " and category_id=" + (object)this.model.category_id;
            string           filedOrder = type == -1 ? "id desc" : "id asc";
            DataSet          list       = article.GetList(1, "channel_id=" + (object)this.model.channel_id + " " + str2 + " and status=0 and Id" + str1 + (object)this.id, filedOrder);

            if (list == null || list.Tables[0].Rows.Count <= 0)
            {
                return(defaultvalue);
            }
            if (callIndex == 1 && !string.IsNullOrEmpty(list.Tables[0].Rows[0]["call_index"].ToString()))
            {
                return("<a href=\"" + this.linkurl(urlkey, (object)list.Tables[0].Rows[0]["call_index"].ToString()) + "\">" + list.Tables[0].Rows[0]["title"] + "</a>");
            }
            return("<a href=\"" + this.linkurl(urlkey, (object)list.Tables[0].Rows[0]["id"].ToString()) + "\">" + list.Tables[0].Rows[0]["title"] + "</a>");
        }