Ejemplo n.º 1
0
    private void RptBind()
    {
        TPortalClass.JpCommon JpCommon2 = new TPortalClass.JpCommon();
        if (this.Request.QueryString["cid"] != null)
            this.pis_cid = JpCommon2.queryString2StrID(this.Request.QueryString["cid"].ToString(), 9);

        TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle();
        string ls_where = " and cid like '" + pis_cid + "%' ";
        string ls_order = " order by pubtime desc";
        DataTable dt = JpArticle.SearchdocsByKey(ls_where, ls_order, 1, 3);
        DataTable tempTable = dt.Clone();
        //在现有的DatatTable增加一列
        DataColumn col = new DataColumn("showTime", typeof(String));
        //将列添加到DataTable中去
        tempTable.Columns.Add(col);
        //循环  对DataTable重新赋值
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            DataRow dr = tempTable.NewRow();
            for (int j = 0; j < dt.Columns.Count; j++)
            {
                dr[tempTable.Columns[j].ColumnName] = dt.Rows[i][j];
            }
            //获得间隔的时间
            dr["showTime"] = JpCommon.DateDiff(DateTime.Now, Convert.ToDateTime(dt.Rows[i]["crtime"].ToString()));
            tempTable.Rows.Add(dr);
        }
        rptList.DataSource = tempTable;
        rptList.DataBind();
        this.pis_totalCount = JpArticle.SearchdocsByKeyNum(ls_where);
    }
Ejemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
     if (this.Request.QueryString["cid"] != null)
         this.pis_cid = JpCommon.queryString2StrID(this.Request.QueryString["cid"].ToString(), 9);
     string ls_where = " and cid like '" + pis_cid + "%' and sfzwd='否' ";
     TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle();
     this.pis_totalCount = JpArticle.SearchdocsByKeyNum(ls_where);
 }
Ejemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     JpCommon JpCommon = new JpCommon();
     if (this.Request.QueryString["cid"] != null)
     {
         this.txtcid.Value = this.Request.QueryString["cid"].ToString();
         this.pis_cid = JpCommon.queryString2StrID(this.Request.QueryString["cid"].ToString(), 9);
     }
     string ls_where = " and cid = '" + this.txtcid.Value + "'  and sfzwd='是'";
     JpArticle JpArticle = new JpArticle();
     this.pis_totalCount = JpArticle.SearchdocsByKeyNum(ls_where);
 }
Ejemplo n.º 4
0
    private void RptBind()
    {
        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
        if (this.Request.QueryString["cid"] != null)
            this.pis_cid = JpCommon.queryString2StrID(this.Request.QueryString["cid"].ToString(),9);

        TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle();
        string ls_where = " and cid like '" + pis_cid + "%' ";
        string ls_order = " order by pubtime desc";
        DataTable dt = JpArticle.SearchdocsByKey(ls_where, ls_order, 1, 4);
        rptList.DataSource = dt;
        rptList.DataBind();
        this.pis_totalCount = JpArticle.SearchdocsByKeyNum(ls_where);
    }
Ejemplo n.º 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (this.Request.QueryString["aid"] != null)
     {
         pis_aid = this.Request.QueryString["aid"].ToString();
     }
     if (this.Request.QueryString["cid"] != null)
     {
         pis_cid = this.Request.QueryString["cid"].ToString();
     }
     string ls_where = " and cid = '" + pis_cid + "' and zwdid=" + pis_aid + " and sfzwd='否' ";
     JpArticle JpArticle = new JpArticle();
     this.pis_totalCount = JpArticle.SearchdocsByKeyNum(ls_where);
 }