Exemplo n.º 1
0
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
        TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle();
        string ls_tip = "删除成功!";
        for (int i = 0; i < rptList.Items.Count; i++)
        {
            //int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
            string id = ((HiddenField)rptList.Items[i].FindControl("hidId")).Value;
            CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
            if (cb.Checked)
            {
                JpArticle.aid = System.Int32.Parse(id);
                JpArticle.Delete();
            }
        }
        string pageUrl = "";

        pageUrl = JpCommon.CombUrlTxt("list_article_tg.aspx", "page={0}&rnd={1}&cid={2}",
            "" + this.txtPage.Text + "", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtcid.Text + "");

        //写系统日志
        string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
        if (userip == null || userip == "")
        {
            userip = Request.ServerVariables["REMOTE_ADDR"];
        }
        JpCommon.WriteLog(userip, "删除", "批量删除文章记录", Session["uid"].ToString(), Session["uname"].ToString());
        Response.Write("<script>alert('" + ls_tip + "');window.location='" + pageUrl + "';</script>");
    }
Exemplo n.º 2
0
 private void RptBind()
 {
     TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle();
     DataTable dt = JpArticle.SearchTJ(this.txtkssj.Value, this.txtjssj.Value, txtKeywords.Text);
     rptList.DataSource = dt;
     rptList.DataBind();
 }
Exemplo n.º 3
0
 public string RptBind()
 {
     TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
     StringBuilder stringBuilder = new StringBuilder();
     TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle();
     string ls_where = " and cid like '" + pis_cid + "%' and sfzwd='否' ";
     string ls_order = " order by pubtime desc";
     DataTable dt = JpArticle.SearchdocsByKey(ls_where, ls_order, 1, 6);
     int commentCount = 0;
     JpComment jpComment = new JpComment();
     for (int i = 0; i < dt.Rows.Count; i++)
     {
         commentCount = jpComment.GetdocsbyaidAllCount(dt.Rows[i]["aid"].ToString(), pis_cid);
         stringBuilder.Append("<li><a onclick=\"locationDetail('art_detail.aspx?aid=" + dt.Rows[i]["aid"].ToString() + "&cid=" + pis_cid + "','" + locationType + "','1')\">");
         stringBuilder.Append("<img  class=\"scrollLoading\"  src=\"" + dt.Rows[i]["indexdisplaypicpath"].ToString() + "\"><h1>");
         stringBuilder.Append("" + dt.Rows[i]["title"].ToString() + "</h1>");
         stringBuilder.Append("<p class=\"fleft\">" + JpCommon.DateDiff(DateTime.Now, Convert.ToDateTime(dt.Rows[i]["crtime"].ToString())) + "</p><p class=\"fleft\"><span><i class=\"ico-dj\"></i>" + dt.Rows[i]["praiseCount"].ToString() + "</span></p><p class=\"fleft\"><span><i class=\"ico-pl\"></i>" + commentCount + "</span>");
         if (dt.Rows[i]["map_cid"].ToString() != "")
         {
             stringBuilder.Append("<p class=\"fright\"><i class=\"ico-zt\">" + dt.Rows[i]["map_cid"].ToString() + "</i></p>");
         }
         stringBuilder.Append("</a></li>");
     }
     return stringBuilder.ToString();
 }
Exemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string ls_aid = "", ls_cid = "", strType = "", ls_page = "1", la_pagesize = "10";
        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
        //获取参数
        if (this.Request.QueryString["type"] != null)
        {
            strType = this.Request.QueryString["type"].ToString();
        }
        if (this.Request.QueryString["page"] != null)
        {
            ls_page = this.Request.QueryString["page"].ToString();
        }

        if (this.Request.QueryString["cid"] != null)
        {
            ls_cid = this.Request.QueryString["cid"].ToString();
        }
        if (this.Request.QueryString["pagesize"] != null)
        {
            la_pagesize = this.Request.QueryString["pagesize"].ToString();
        }

        JpArticle JpArticle = new JpArticle();
        string ls_where = " and cid = '" + ls_cid + "' ";
        string ls_order = " order by pubtime desc";
        string test = "";
        DataTable dt = JpArticle.SearchdocsByKey(ls_where, ls_order, int.Parse(ls_page), int.Parse(la_pagesize));

        //转换成json格式
        string strJson = JsonConvert.SerializeObject(dt);
        //数据抛出
        Response.Write(strJson);
    }
Exemplo n.º 5
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);
    }
Exemplo n.º 6
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);
 }
Exemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string ls_cid = "", ls_page = "1", la_pagesize = "10";
        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
        if (this.Request.QueryString["cid"] != null)
        {
            ls_cid = JpCommon.queryString2StrID(this.Request.QueryString["cid"].ToString(), 9);
        }
        if (this.Request.QueryString["page"] != null)
        {
            ls_page = JpCommon.Filter(this.Request.QueryString["page"].ToString());
        }
        if (this.Request.QueryString["pagesize"] != null)
        {
            la_pagesize = JpCommon.Filter(this.Request.QueryString["pagesize"].ToString());
        }
        //根据传入的文章栏目ID、页码、页数返回列表信息
        TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle();
        string ls_where = "", ls_order = "";
        ls_where = " and cid like '" + ls_cid + "%' and sfzwd='否' ";
        ls_order = " order by pubtime desc";
        DataTable dt = JpArticle.SearchdocsByKey(ls_where, ls_order, int.Parse(ls_page), int.Parse(la_pagesize));
        //复制一个DataTalbe
        DataTable tempTable = dt.Clone();
        //在现有的DatatTable增加一列
        DataColumn col = new DataColumn("showTime", typeof(String));
        //将列添加到DataTable中去
        tempTable.Columns.Add(col);

        //在现有的DatatTable增加一列
        DataColumn col2 = new DataColumn("commentCount", typeof(String));
        //将列添加到DataTable中去
        tempTable.Columns.Add(col2);

        int commentCount = 0;
        JpComment jpComment = new JpComment();
        //循环  对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];
            }
            DataTable dtComment = jpComment.Getdocsbyaid_ysh(ls_cid, dt.Rows[i]["aid"].ToString());
            commentCount = dtComment.Rows.Count;
            //获得间隔的时间
            dr["showTime"] = JpCommon.DateDiff(DateTime.Now, Convert.ToDateTime(dt.Rows[i]["crtime"].ToString()));
            dr["commentCount"] = commentCount;
            tempTable.Rows.Add(dr);
        }
        //转换成json格式
        string strJson = JsonConvert.SerializeObject(tempTable);
        //数据抛出
        Response.Write(strJson);
    }
Exemplo n.º 8
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);
 }
Exemplo n.º 9
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);
 }
Exemplo n.º 10
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);
    }
Exemplo n.º 11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string ls_aid="",ls_cid="",strType = "", ls_page = "1", la_pagesize = "10";
        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
        //获取参数
        if (this.Request.QueryString["type"] != null)
        {
            strType = this.Request.QueryString["type"].ToString();
        }
        if (this.Request.QueryString["page"] != null)
        {
            ls_page = this.Request.QueryString["page"].ToString();
        }

        if (this.Request.QueryString["cid"] != null)
        {
            ls_cid = this.Request.QueryString["cid"].ToString();
        }
        if (this.Request.QueryString["pagesize"] != null)
        {
            la_pagesize = this.Request.QueryString["pagesize"].ToString();
        }

        JpArticle JpArticle = new JpArticle();
        string ls_where = " and cid = '" + ls_cid + "' ";
        string ls_order = " order by pubtime desc";
        DataTable dt = JpArticle.SearchdocsByKey(ls_where,ls_order, int.Parse(ls_page), int.Parse(la_pagesize));
        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);
        }
        //转换成json格式
        string strJson = JsonConvert.SerializeObject(tempTable);
        //数据抛出
        Response.Write(strJson);
    }
Exemplo n.º 12
0
    public String RptBind()
    {
        StringBuilder stringBuilder = new StringBuilder();
        JpCommon JpCommon = new JpCommon();
        if (this.Request.QueryString["aid"] != null)
        {
            this.pis_aid = JpCommon.queryString2StrID(this.Request.QueryString["aid"].ToString(), 9);
        }

        JpArticle JpArticle = new JpArticle();
        DataTable dt = JpArticle.GetArticleByaid(int.Parse(pis_aid));
        if (dt.Rows.Count > 0)
        {
            pis_cid = dt.Rows[0]["cid"].ToString();
            this.lbljptx.Text = "<h1>\"" + dt.Rows[0]["title"].ToString() + "\"</h1><span><img src=\"" + dt.Rows[0]["indexdisplaypicpath"].ToString() + "\"></span>";
        }

        string ls_where = " and cid = '" + pis_cid + "' and zwdid=" + pis_aid + " and sfzwd='否' ";
        string ls_order = " order by pubtime desc";
        DataTable dt2 = JpArticle.SearchdocsByKey(ls_where, ls_order, 1, 5);
        string strTitle = "";
        if (dt2.Rows.Count > 0)
        {
            for (int i = 0; i < dt2.Rows.Count; i++)
            {
                strTitle = dt2.Rows[i]["title"].ToString();
                if (strTitle.Length > 18)
                {
                    strTitle = strTitle.Substring(0, 18) + "...";
                }
                stringBuilder.Append("<a onclick=\"locationDetail('art_detail.aspx?aid=" + dt2.Rows[i]["aid"].ToString() + "','" + locationType + "','0')\"><li>");
                if (dt2.Rows[i]["indexdisplaypicpath"].ToString() != "")
                {
                    stringBuilder.Append("<img src=\"" + dt2.Rows[i]["indexdisplaypicpath"].ToString() + "\">");
                }
                else
                {
                    stringBuilder.Append("<img src=\"/images/noImg.jpg\">");
                }
                stringBuilder.Append("<h1>");
                stringBuilder.Append("" + strTitle + "</h1><p class=\"fleft\">" + JpCommon.DateDiff(DateTime.Now, Convert.ToDateTime(dt2.Rows[i]["crtime"].ToString())) + "</p></li></a>");
            }
        }

        return stringBuilder.ToString();
    }
Exemplo n.º 13
0
    public string showData()
    {
        StringBuilder stringBuilder = new StringBuilder();
        JpArticle JpArticle = new JpArticle();
        string ls_where = " and cid = '" + this.txtcid.Value + "'  and sfzwd='是'";
        string ls_order = " order by pubtime desc";
        DataTable dt = JpArticle.SearchdocsByKey(ls_where, ls_order, 1, 3);
        JpColumns jpColumns = new JpColumns();
        DataTable dt_column = jpColumns.GetColumnBycid(this.txtcid.Value);
        string strCloumnName = dt_column.Rows[0]["cname"].ToString();
        if (dt.Rows.Count > 0)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {

                string ls_zwdid = dt.Rows[i]["aid"].ToString();
                if (dt.Rows[i]["indexdisplaypicpath"].ToString() != "")
                {
                    stringBuilder.Append("<li><div class='jptx'><a onclick=\"locationDetail('art_detail.aspx?aid=" + dt.Rows[i]["aid"].ToString() + "&cid=" + this.txtcid.Value + "','" + locationType + "','1')\" ><div class='jptxpp'><img src=\"" + dt.Rows[i]["indexdisplaypicpath"].ToString() + "\">");
                }
                else
                {
                    stringBuilder.Append("<li><div class='jptx'><a onclick=\"locationDetail('art_detail.aspx?aid=" + dt.Rows[i]["aid"].ToString() + "&cid=" + this.txtcid.Value + "','" + locationType + "','1')\" ><div class='jptxpp'>" + dt.Rows[i]["title"].ToString() + "");
                }
                stringBuilder.Append("<div class=\"jptxbt\">" + dt.Rows[i]["title"].ToString() + "</div></div></a>");
                string ls_where2 = " and cid = '" + this.txtcid.Value + "' and zwdid='" + ls_zwdid + "' and sfzwd='否' ";
                string ls_order2 = " order by pubtime desc";
                DataTable dt_zwd = JpArticle.SearchdocsByKey(ls_where2, ls_order2, 1, 6);
                if (dt_zwd.Rows.Count > 0)
                {
                    for (int j = 0; j < dt_zwd.Rows.Count; j++)
                    {
                        stringBuilder.Append("<a onclick=\"locationDetail('art_detail.aspx?aid=" + dt_zwd.Rows[j]["aid"].ToString() + "','" + locationType + "','1')\" ><div class=\"jptxsub\"><p>" + dt_zwd.Rows[j]["title"].ToString() + "</p>");
                        if (dt_zwd.Rows[j]["map_cid"].ToString() != "")
                        {
                            stringBuilder.Append("<i class=\"ico-sd\">" + dt_zwd.Rows[j]["map_cid"].ToString() + "</i>");
                        }
                        stringBuilder.Append("</a></div></a>");
                    }
                }
                stringBuilder.Append("</div></li>");
            }
        }
        return stringBuilder.ToString();
    }
Exemplo n.º 14
0
    //静态发布首页和配置的页面
    protected void btnpub1_Click(object sender, EventArgs e)
    {
        try
        {
            TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle();
            JpArticle.PubHtml_Config();

            Response.Write("<script language=javascript>alert('发布成功!');window.location='pubhtml.aspx';</script>");
        }
        catch
        {
            Response.Write("<script language=javascript>alert('发布失败!');window.location='pubhtml.aspx';</script>");
        }
        finally
        {

        }
    }
Exemplo n.º 15
0
 public string getData()
 {
     StringBuilder strShow = new StringBuilder();
     JpArticle jpArticle = new JpArticle();
     DataTable dt = jpArticle.GetBackArticlesByCid(cid);
     for (int i = 0; i < dt.Rows.Count; i++)
     {
         strShow.Append("<a class=\"mui-navigate-right\" href=\"art_audit.aspx?aid=" + dt.Rows[i]["aid"].ToString() + "&cid=" + cid + "&rend=" + System.Guid.NewGuid().ToString() + "\" style=\"color:#000000\" ><li class=\"mui-table-view-cell\">");
         strShow.Append("<div class=\"mui-table\">");
         strShow.Append("<div class=\"mui-table-cell mui-col-xs-10\">");
         strShow.Append("<h4 class=\"mui-ellipsis\">" + dt.Rows[i]["title"].ToString() + "</h4>");
         strShow.Append("<h5>" + dt.Rows[i]["author"].ToString() + "</h5>");
         strShow.Append("<p class=\"mui-h6 mui-ellipsis\">" + dt.Rows[i]["subhead"].ToString() + "</p>");
         strShow.Append("</div>");
         strShow.Append("<div class=\"mui-table-cell mui-col-xs-2 mui-text-right\">");
         strShow.Append("<span class=\"mui-h5\">" + Convert.ToDateTime(dt.Rows[i]["crtime"].ToString()).ToString("HH:mm") + "</span>");
         strShow.Append("</div>");
         strShow.Append("</div>");
         strShow.Append("</li><a>");
     }
     return strShow.ToString();
 }
Exemplo n.º 16
0
    private void RptBind()
    {
        TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle();
        DataTable dt = JpArticle.SearchDC(this.txtkssj.Value, this.txtjssj.Value, txtKeywords.Text);

        //this.totalCount = dt.Rows.Count;
        //DataTable tempTable = dt.Clone();
        //for (int i = (this.page - 1) * this.pageSize; i < this.page * this.pageSize; i++)
        //{
        //    if (i > dt.Rows.Count - 1)
        //        break;

        //    DataRow dr = tempTable.NewRow();
        //    for (int j = 0; j < dt.Columns.Count; j++)
        //    {
        //        dr[dt.Columns[j].ColumnName] = dt.Rows[i][j];
        //    }
        //    tempTable.Rows.Add(dr);
        //}
        rptList.DataSource = dt;
        rptList.DataBind();
    }
Exemplo n.º 17
0
 public string showOldActive()
 {
     StringBuilder stringBuilder = new StringBuilder();
     JpArticle jpArticle = new JpArticle();
     DataTable dt = jpArticle.GetArticlesBycid_tg("009001");
     string strTitle = "";
     string strSummary = "";
     if (dt.Rows.Count > 0)
     {
         for (int i = 0; i < dt.Rows.Count; i++)
         {
             strTitle = dt.Rows[i]["title"].ToString();
             if (strTitle.Length > 20)
             {
                 strTitle = strTitle.Substring(0, 20) + "...";
             }
             strSummary = dt.Rows[i]["summary"].ToString();
             if (strSummary.Length > 20)
             {
                 strSummary = strSummary.Substring(0, 20);
             }
             try
             {
                 stringBuilder.Append("<div class=\"wszw\">" + Convert.ToDateTime(dt.Rows[i]["crtime"].ToString()).ToString("mm:ss") + "</div><div class=\"jptx\">");
             }
             catch
             {
                 stringBuilder.Append("<div class=\"wszw\">00:00</div><div class=\"jptx\">");
             }
             stringBuilder.Append("<a onclick=\"locationDetail('activeOld_detail.aspx?id=" + dt.Rows[i]["aid"].ToString() + "&rend=" + System.Guid.NewGuid().ToString() + "','" + locationType + "','1')\" href=\"javascript:void(0);\" ><div class=\"jptxpp\">");
             stringBuilder.Append("<span><img src=\"" + dt.Rows[i]["indexdisplaypicpath"].ToString() + "\" alt=\"" + strTitle + "\" /></span><div class=\"jptxsub2\"><span>" + strTitle + "</span></div></div>");
             stringBuilder.Append("</div></a>");
             stringBuilder.Append("</div>");
         }
     }
     return stringBuilder.ToString();
 }
Exemplo n.º 18
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (this.Request.QueryString["id"] != null)
     {
         try
         {
             id = Convert.ToInt32(this.Request.QueryString["id"].ToString());
         }
         catch
         {
             id = 1;
         }
     }
     this.lb_type.Text = "往期回顾";
     JpArticle jpArticle = new JpArticle();
     DataTable dt = jpArticle.GetArticleByaid(id);
     HyFileatt HyFileatt = new HyFileatt();
     if (dt.Rows.Count > 0)
     {
         this.lb_time.Text = Convert.ToDateTime(dt.Rows[0]["crtime"].ToString()).ToString("yyyy年MM月dd日");
         this.lb_title.Text = dt.Rows[0]["title"].ToString();
         this.lb_article.Text = dt.Rows[0]["ht_content"].ToString();
     }
 }
Exemplo n.º 19
0
    //批量复制
    protected void btnplfz_Click(object sender, EventArgs e)
    {
        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
        TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle();
        string ls_tip = "批量复制成功!";

        TPortalClass.JpSite JpSite = new TPortalClass.JpSite();
        string ls_html = JpSite.fax;
        string ls_ids = "";
        for (int i = 0; i < rptList.Items.Count; i++)
        {
            int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
            if (ls_ids == "")
            {
                ls_ids = id.ToString();
            }
            else
            {
                ls_ids = ls_ids + "," + id.ToString();
            }
            //string id = ((HiddenField)rptList.Items[i].FindControl("hidId")).Value;
            CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
            if (cb.Checked)
            {
                TPortalClass.JpArticle article = new TPortalClass.JpArticle(id);
                string ls_cids = this.txtcheckcid.Text;
                string[] lv_cids = ls_cids.Split('+');
                for (int j = 0; j < lv_cids.Length; j++)
                {
                    if (lv_cids[j] != "")
                    {
                        JpArticle.cid = lv_cids[j];
                        JpArticle.title = article.title;
                        JpArticle.subhead = article.subhead;
                        JpArticle.ht_content = article.ht_content;
                        JpArticle.summary = article.summary;
                        JpArticle.author = article.author;
                        JpArticle.status = article.status;
                        JpArticle.indexdisplaypicpath = article.indexdisplaypicpath;
                        JpArticle.seotitle = article.seotitle;
                        JpArticle.seokeywords = article.seokeywords;
                        JpArticle.seodescription = article.seodescription;
                        JpArticle.asort = article.asort;
                        JpArticle.iftop = article.iftop;
                        JpArticle.topendtime = article.topendtime;
                        JpArticle.ifindexdisplay = article.ifindexdisplay;
                        JpArticle.ifcomment = article.ifcomment;
                        JpArticle.source = article.source;
                        JpArticle.role_userid = article.role_userid;
                        JpArticle.role_username = article.role_username;
                        JpArticle.input = article.input;
                        JpArticle.GUID = System.Guid.NewGuid().ToString();
                        JpArticle.map_cid = article.map_cid;
                        JpArticle.map_aid = article.map_aid;
                        JpArticle.targettype = article.targettype;
                        JpArticle.endtime = article.endtime;
                        JpArticle.pubtime = article.pubtime;
                        int ls_newaid = JpArticle.Insert();
                        if (ls_ids == "")
                        {
                            ls_ids = ls_newaid.ToString();
                        }
                        else
                        {
                            ls_ids = ls_ids + "," + ls_newaid.ToString();
                        }
                    }
                }
            }
        }
        string pageUrl = "";

        pageUrl = JpCommon.CombUrlTxt("list_article_fb.aspx", "page={0}&rnd={1}&cid={2}",
            "" + this.txtPage.Text + "", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtcid.Text + "");

        if (ls_ids != "")
        {
            //静态发布时使用
            string ls_pubtime = System.DateTime.Now.ToString();
            string ls_endtime = System.DateTime.Now.AddYears(10).ToString();
            if (ls_html == "开启")
            {
                JpArticle.PubAll("," + ls_ids + ",", ls_pubtime, ls_endtime);
            }
            //写系统日志
            string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
            if (userip == null || userip == "")
            {
                userip = Request.ServerVariables["REMOTE_ADDR"];
            }
            JpCommon.WriteLog(userip, "复制", "批量复制文章ID:" + ls_ids, Session["uid"].ToString(), Session["uname"].ToString());
        }
        else
        {
            ls_tip = "批量复制失败!请选中复制源文章和选择目标栏目。";
        }
        Response.Write("<script>alert('" + ls_tip + "');window.location='" + pageUrl + "';</script>");
    }
Exemplo n.º 20
0
    private void RptBind()
    {
        if (this.Request.QueryString["page"] != null)
            this.page = int.Parse(this.Request.QueryString["page"].ToString());
        else
            this.page = 1;

        this.txtKeywords.Text = this.keywords;
        //this.ddlcolname.SelectedValue = this.deptid;
        txtPageNum.Text = this.pageSize.ToString();
        txtPage.Text = this.page.ToString();

        TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle();
        DataTable dt;
        TPortalClass.JpRoleuser JpRoleuser = new TPortalClass.JpRoleuser();
        dt = JpArticle.GetArticlesBycidAnduidAndtitle_tg(this.txtcid.Text, this.Session["uid"].ToString(), txtKeywords.Text);

        this.totalCount = dt.Rows.Count;
        DataTable tempTable = dt.Clone();
        for (int i = (this.page - 1) * this.pageSize; i < this.page * this.pageSize; i++)
        {
            if (i > dt.Rows.Count - 1)
                break;

            DataRow dr = tempTable.NewRow();
            for (int j = 0; j < dt.Columns.Count; j++)
            {
                dr[dt.Columns[j].ColumnName] = dt.Rows[i][j];
            }
            tempTable.Rows.Add(dr);
        }
        rptList.DataSource = tempTable;
        rptList.DataBind();

        //翻页
        //string pageUrl = Utils.CombUrlTxt("list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}&page={4}",
        //        this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property, "__id__");
        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
        //TPortalClass.JpRoleuser JpRoleuser = new TPortalClass.JpRoleuser();
        string pageUrl;
        pageUrl = JpCommon.CombUrlTxt("list_article_tg.aspx", "page={0}&rnd={1}&keywords={2}&cid={3}&input={4}",
            "__id__", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtKeywords.Text + "", "" + this.txtcid.Text + "", "" + this.Session["uid"].ToString() + "");

        PageContent.InnerHtml = JpCommon.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
    }
Exemplo n.º 21
0
    private void DDLDataBind()
    {
        TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle();
        DataTable dt = JpArticle.GetArticlesBycid_tg(this.txtcid.Text);

        ddlwz.DataSource = dt;
        ddlwz.DataTextField = "title";
        ddlwz.DataValueField = "aid";
        ddlwz.DataBind();
    }
Exemplo n.º 22
0
    private void DataPlay()
    {
        if (this.Request.QueryString["op"] != null)
        {
            this.txtop.Value = this.Request.QueryString["op"].ToString();           //新增还是修改
        }
        if (this.Request.QueryString["aid"] != null)
        {
            this.txtaid.Text = this.Request.QueryString["aid"].ToString();           //文章ID
        }
        if (this.Request.QueryString["cid"] != null)
        {
            this.txtcid.Text = this.Request.QueryString["cid"].ToString();           //栏目ID
            if (this.txtcid.Text.Contains(","))
                this.txtcid.Text = this.txtcid.Text.Substring(0, this.txtcid.Text.IndexOf(","));
        }

        TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle();
        //新文档
        if (this.txtop.Value == "add")
        {
            this.txtendtime.Text = System.DateTime.Now.AddYears(10).ToString();
            this.txtpubtime.Text = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            this.txtguid.Text = System.Guid.NewGuid().ToString(); //直接返回字符串类型
            this.txttopendtime.Value = System.DateTime.Now.AddDays(5).ToString("yyyy-MM-dd");
            //this.ddlcolname.SelectedValue = this.cid;

            //根据栏目ID得到栏目名称start
            TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns();
            DataTable dtcols = JpColumns.GetColumnBycid(this.cid);
            this.txtcolname.Text = dtcols.Rows[0]["cname"].ToString();
            //根据栏目ID得到栏目名称end
            this.txtauthor.Text = this.Session["uname"].ToString();
            DataTable dtsort = JpArticle.Getmaxsort();
            if (dtsort.Rows.Count > 0)
            {
                this.txtasort.Text = (System.Int32.Parse(dtsort.Rows[0]["asort"].ToString()) + 2).ToString();
            }
            else
            {
                this.txtasort.Text = "1";
            }
        }
        //旧文档
        if (this.txtop.Value == "modify")
        {
            DataTable dt = JpArticle.GetArticleByaid(System.Int32.Parse(this.txtaid.Text));

            if (dt.Rows.Count > 0)
            {

                this.txtendtime.Text = dt.Rows[0]["endtime"].ToString();
                this.txtpubtime.Text = dt.Rows[0]["pubtime"].ToString();

                //根据栏目ID得到栏目名称start
                TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns();
                DataTable dtcols = JpColumns.GetColumnBycid(dt.Rows[0]["cid"].ToString());
                this.txtcolname.Text = dtcols.Rows[0]["cname"].ToString();
                //根据栏目ID得到栏目名称end

                this.txttitle.Text = dt.Rows[0]["title"].ToString();
                this.txttitle2.Text = dt.Rows[0]["subhead"].ToString();
                this.content1.Value = dt.Rows[0]["ht_content"].ToString();
                this.txtauthor.Text = dt.Rows[0]["author"].ToString();
                this.txtsummary.Text = dt.Rows[0]["summary"].ToString();
                this.txtsummary.Text = dt.Rows[0]["summary"].ToString();
                this.txtseotitle.Text = dt.Rows[0]["seotitle"].ToString();
                this.txtseokeywords.Text = dt.Rows[0]["seokeywords"].ToString();
                this.txtseodescription.Text = dt.Rows[0]["seodescription"].ToString();
                this.txtasort.Text = dt.Rows[0]["asort"].ToString(); ;
                this.txttopendtime.Value = DateTime.Parse(dt.Rows[0]["topendtime"].ToString()).ToString("yyyy-MM-dd");
                this.txtsource.Value = dt.Rows[0]["source"].ToString();
                this.txtguid.Text = dt.Rows[0]["GUID"].ToString();
                this.txtrole_userid.Text = dt.Rows[0]["role_userid"].ToString(); ;
                this.txtrole_username.Text = dt.Rows[0]["role_username"].ToString();
                this.txtpic.Value = dt.Rows[0]["indexdisplaypicpath"].ToString();
                if (dt.Rows[0]["map_cid"].ToString() != "")
                {
                    ddllb.SelectedValue = dt.Rows[0]["map_cid"].ToString();
                }
                if (dt.Rows[0]["indexdisplaypicpath"].ToString() != "")
                {
                    this.lblpic.Text = "<img src='" + dt.Rows[0]["indexdisplaypicpath"].ToString() + "'  onError=\"this.src='/images/nophoto.jpg';\" width=60px height=55px />";
                }
                else
                {
                    this.lblpic.Text = "";
                }
                this.ddlsfzd.SelectedValue = dt.Rows[0]["iftop"].ToString();
                if (dt.Rows[0]["iftop"].ToString() == "1")
                {
                    ls_xs1 = "inline";
                }
                this.ddlsfsyss.SelectedValue = dt.Rows[0]["ifindexdisplay"].ToString();
                if (dt.Rows[0]["ifindexdisplay"].ToString() == "1")
                {
                    ls_xs2 = "inline";
                }
                if (dt.Rows[0]["sfzwd"].ToString() == "否")
                {
                    radlist.SelectedValue = "否";
                    ls_xs3 = "";
                    ddlwz.SelectedValue = dt.Rows[0]["zwdid"].ToString();
                }
            }
        }
    }
Exemplo n.º 23
0
 private void ChkRole()
 {
     //判断权限
     TPortalClass.JpRoles JpRoles = new TPortalClass.JpRoles();
     TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle();
     DataTable dtart;
     if (this.txtop.Value != "add")
     {
         dtart = JpArticle.GetArticleByaid(System.Int32.Parse(this.txtaid.Text));
     }
     else
     {
         dtart = JpArticle.GetArticleByaid(-1);
     }
     //是发布者
     if (this.txtop.Value != "add")
     {
         //旧文档
         if (dtart.Rows[0]["status"].ToString() == "审核")
         {
             btnSave.Visible = true;  //保存按钮
             btnFB.Visible = true;  //发布按钮
         }
         else
         {
             btnSave.Visible = false;  //保存按钮
             btnFB.Visible = false;  //发布按钮
         }
     }
     else
     {   //新文档
         btnSave.Visible = true;
         btnFB.Visible = false;
     }
 }
Exemplo n.º 24
0
    //发布
    protected void btnFB_Click(object sender, EventArgs e)
    {
        if (this.Session["uid"].ToString() == "")
            this.Response.Redirect("../login.aspx");

        string ls_tip = "发布成功!";

        //新文档时
        TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle();
        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
        JpArticle.cid = this.txtcid.Text;
        JpArticle.title = this.txttitle.Text;
        JpArticle.subhead = this.txttitle2.Text;
        JpArticle.ht_content = this.content1.Value;
        if (this.txtsummary.Text == "")
        {
            JpArticle.summary = JpCommon.OutPicGetStr(this.content1.Value, 150);
        }
        else
        {
            JpArticle.summary = this.txtsummary.Text;
        }
        JpArticle.author = this.Session["uname"].ToString();

        JpArticle.status = "发布";
        //JpArticle.ifindexdisplay = "";
        string lsfilename = FileUpload1.FileName;
        string lspath = "";
        string lsurl = "";
        string str_path = "";
        if (lsfilename != "")  //attsize
        {
            //SaveCommon(ls_path, ls_attsize, lsguid);
            //将附件上传到服务器目录下
            lspath = Server.MapPath("~/");//虚拟目录的位置
            lsurl = "/upload/indexpic"; //存放的文件夹
            Directory.CreateDirectory(lspath + "/" + lsurl);
            str_path = lspath + "/" + lsurl + "/" + lsfilename;
            FileUpload1.SaveAs(str_path);
            JpArticle.indexdisplaypicpath = lsurl + "/" + lsfilename;
        }
        else
        {
            this.txtpic.Value = JpCommon.GetImg(this.content1.Value);
            JpArticle.indexdisplaypicpath = this.txtpic.Value;
        }

        if (this.txtseotitle.Text == "")
        {
            JpArticle.seotitle = this.txttitle.Text;
        }
        else
        {
            JpArticle.seotitle = this.txtseotitle.Text;
        }
        if (this.txtseokeywords.Text == "")
        {
            JpArticle.seokeywords = this.txttitle.Text;
        }
        else
        {
            JpArticle.seokeywords = this.txtseokeywords.Text;
        }
        if (this.txtseodescription.Text == "")
        {
            JpArticle.seodescription = JpCommon.OutPicGetStr(this.content1.Value, 150);
        }
        else
        {
            JpArticle.seodescription = this.txtseodescription.Text;
        }
        JpArticle.asort = System.Int32.Parse(this.txtasort.Text);
        JpArticle.iftop = this.ddlsfzd.SelectedValue;
        JpArticle.topendtime = this.txttopendtime.Value;
        JpArticle.ifindexdisplay = this.ddlsfsyss.SelectedValue;
        JpArticle.ifcomment = "0";
        JpArticle.source = this.txtsource.Value;
        JpArticle.role_userid = this.txtrole_userid.Text;
        JpArticle.role_username = this.txtrole_username.Text;
        JpArticle.input = this.Session["uid"].ToString();
        JpArticle.GUID = this.txtguid.Text;
        if (ddllb.SelectedValue != "请选择")
        {
            JpArticle.map_cid = ddllb.SelectedValue;
        }
        else
        {
            JpArticle.map_cid = "";
        }
        JpArticle.map_aid = 0;
        JpArticle.targettype = "";
        JpArticle.hits = 0;
        JpArticle.goodnum = 0;
        if (radlist.SelectedValue == "否")
        {
            JpArticle.sfzwd = radlist.SelectedValue;
            JpArticle.zwdid = ddlwz.SelectedValue;
        }
        else
        {
            JpArticle.sfzwd = radlist.SelectedValue;
            JpArticle.zwdid = "";
        }
        if (this.txtendtime.Text != "")
        {
            JpArticle.endtime = this.txtendtime.Text;
        }
        else
        {
            JpArticle.endtime = System.DateTime.Now.AddYears(10).ToString();
        }
        if (this.txtpubtime.Text != "")
        {
            JpArticle.pubtime = this.txtpubtime.Text;
        }
        else
        {
            JpArticle.pubtime = System.DateTime.Now.ToString();
        }
        if (this.txtop.Value == "add")
        {
            //写系统日志
            string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
            if (userip == null || userip == "")
            {
                userip = Request.ServerVariables["REMOTE_ADDR"];
            }
            JpCommon.WriteLog(userip, "审核新增", "审核新增文章记录[guid:" + this.txtguid.Text + "]", Session["uid"].ToString(), Session["uname"].ToString());

            JpArticle.Insert();
        }
        else
        {
            //写系统日志
            string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
            if (userip == null || userip == "")
            {
                userip = Request.ServerVariables["REMOTE_ADDR"];
            }
            JpCommon.WriteLog(userip, "审核修改", "审核修改组织记录[id:" + this.txtguid.Text + "]", Session["uid"].ToString(), Session["uname"].ToString());
            JpArticle.aid = System.Int32.Parse(this.txtaid.Text);
            JpArticle.Update();
        }

        //静态发布
        TPortalClass.JpSite JpSite = new TPortalClass.JpSite();
        string ls_html = JpSite.fax;
        if (ls_html == "开启")
        {
            DataTable dt = JpArticle.GetArticleByGUID(this.txtguid.Text);
            if (dt.Rows.Count > 0)
            {
                JpArticle.PubAll("," + dt.Rows[0]["aid"].ToString() + ",", this.txtpubtime.Text, this.txtendtime.Text);
            }
        }
        Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>");
    }
Exemplo n.º 25
0
    //发布
    protected void btnpubart_Click(object sender, EventArgs e)
    {
        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
        TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle();
        string ls_tip = "发布成功!";
        TPortalClass.JpSite JpSite = new TPortalClass.JpSite();
        string ls_html = JpSite.fax;

        for (int i = 0; i < rptList.Items.Count; i++)
        {
            //int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
            string id = ((HiddenField)rptList.Items[i].FindControl("hidId")).Value;
            CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
            if (cb.Checked)
            {
                if (ls_html == "开启")
                {
                    JpArticle.PubAll("," + id + ",", this.txtpubtime.Value, this.txtendtime.Value);    //静态发布时使用
                }
                else
                {
                    JpArticle.PubAllNoHtml("," + id + ",", this.txtpubtime.Value, this.txtendtime.Value);//非静态发布时使用
                }
            }
        }
        string pageUrl = "";

        pageUrl = JpCommon.CombUrlTxt("list_article_fb.aspx", "page={0}&rnd={1}&cid={2}",
            "" + this.txtPage.Text + "", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtcid.Text + "");

        //写系统日志
        string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
        if (userip == null || userip == "")
        {
            userip = Request.ServerVariables["REMOTE_ADDR"];
        }
        JpCommon.WriteLog(userip, "发布", "批量发布文章记录", Session["uid"].ToString(), Session["uname"].ToString());
        Response.Write("<script>alert('" + ls_tip + "');window.location='" + pageUrl + "';</script>");
    }
Exemplo n.º 26
0
        /// <summary>
        /// ����
        /// </summary>
        /// <returns></returns>
        public bool Insert()
        {
            bool ret = true;
            DAO db = new DAO();

            try
            {
                String sql = " insert into hy_favorite(hy_uid,hy_aid,hy_addtime,hy_bt,hy_cid,hy_sort) values ";
                sql += "(@hy_uid,@hy_aid,@hy_addtime,@hy_bt,@hy_cid,@hy_sort) ";
                JpArticle jpArticle = new JpArticle();
                DataTable dt = new DataTable();
                try
                {
                    dt = jpArticle.GetArticleByaid(Convert.ToInt32(hy_aid));
                }
                catch
                {
                }
                if (dt.Rows.Count > 0)
                {
                    hy_bt = dt.Rows[0]["title"].ToString();
                }
                SqlParameter[] sqlparam = {
                    db.MakeInParam("@hy_uid",SqlDbType.VarChar,hy_uid),
                    db.MakeInParam("@hy_aid",SqlDbType.VarChar,hy_aid),
                    db.MakeInParam("@hy_addtime",SqlDbType.VarChar,hy_addtime),
                    db.MakeInParam("@hy_bt",SqlDbType.VarChar,hy_bt),
                    db.MakeInParam("@hy_cid",SqlDbType.VarChar,hy_cid),
                    db.MakeInParam("@hy_sort",SqlDbType.Int,hy_sort),
                };
                dt.Clear();
                dt = GetData(" and hy_uid='" + hy_uid + "' and hy_aid='" + hy_aid + "' and hy_cid='" + hy_cid + "'  ");
                if (dt.Rows.Count > 0)
                {
                    try
                    {
                        id = Convert.ToInt32(dt.Rows[0]["id"].ToString());
                        Update();
                    }
                    catch
                    {
                    }
                }
                else
                {
                    db.Execute(sql, sqlparam);
                }
            }
            catch
            {
                ret = false;
            }
            finally
            {
                db.Close();
                db.Dispose();
            }
            return ret;
        }
Exemplo n.º 27
0
 protected void btnFb_Click(object sender, EventArgs e)
 {
     JpArticle jpArticle = new JpArticle();
     jpArticle.publish(aid, DateTime.Now.ToString(), DateTime.Now.AddMonths(1).ToString());
     Response.Write("<script>alert('审核通过!');</script>");
 }
Exemplo n.º 28
0
    //全部复制
    protected void btnallfz_Click(object sender, EventArgs e)
    {
        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
        TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle();
        string ls_tip = "全部复制成功!";

        TPortalClass.JpSite JpSite = new TPortalClass.JpSite();
        string ls_html = JpSite.fax;
        string ls_ids = "";
        //根据栏目ID得到该栏目下所有文章
        DataTable dt = JpArticle.GetArticlesByCid_fb(this.txtcid.Text);
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            int id = (int)dt.Rows[i]["aid"];
            string ls_cids = this.txtcheckcid.Text;
            string[] lv_cids = ls_cids.Split('+');
            for (int j = 0; j < lv_cids.Length; j++)
            {
                if (lv_cids[j] != "")
                {
                    JpArticle.cid = lv_cids[j];
                    JpArticle.title = dt.Rows[i]["title"].ToString();
                    JpArticle.subhead = dt.Rows[i]["subhead"].ToString();
                    JpArticle.ht_content = dt.Rows[i]["ht_content"].ToString();
                    JpArticle.summary = dt.Rows[i]["summary"].ToString();
                    JpArticle.author = dt.Rows[i]["author"].ToString();
                    JpArticle.status = dt.Rows[i]["status"].ToString();
                    JpArticle.indexdisplaypicpath = dt.Rows[i]["indexdisplaypicpath"].ToString();
                    JpArticle.seotitle = dt.Rows[i]["seotitle"].ToString();
                    JpArticle.seokeywords = dt.Rows[i]["seokeywords"].ToString();
                    JpArticle.seodescription = dt.Rows[i]["seodescription"].ToString();
                    JpArticle.asort = (int)dt.Rows[i]["asort"];
                    JpArticle.iftop = dt.Rows[i]["iftop"].ToString();
                    JpArticle.topendtime = dt.Rows[i]["topendtime"].ToString();
                    JpArticle.ifindexdisplay = dt.Rows[i]["ifindexdisplay"].ToString();
                    JpArticle.ifcomment = dt.Rows[i]["ifcomment"].ToString();
                    JpArticle.source = dt.Rows[i]["source"].ToString();
                    JpArticle.role_userid = dt.Rows[i]["role_userid"].ToString();
                    JpArticle.role_username = dt.Rows[i]["role_username"].ToString();
                    JpArticle.input = dt.Rows[i]["input"].ToString();
                    JpArticle.GUID = System.Guid.NewGuid().ToString();
                    JpArticle.map_cid = dt.Rows[i]["map_cid"].ToString();
                    JpArticle.map_aid = (int)dt.Rows[i]["map_aid"];
                    JpArticle.targettype = dt.Rows[i]["targettype"].ToString();
                    JpArticle.endtime = dt.Rows[i]["endtime"].ToString();
                    JpArticle.pubtime = dt.Rows[i]["pubtime"].ToString();
                    int ls_newaid = JpArticle.Insert();
                    if (ls_ids == "")
                    {
                        ls_ids = ls_newaid.ToString();
                    }
                    else
                    {
                        ls_ids = ls_ids + "," + ls_newaid.ToString();
                    }
                }

            }
        }
        string pageUrl = "";

        pageUrl = JpCommon.CombUrlTxt("list_article_fb.aspx", "page={0}&rnd={1}&cid={2}",
            "" + this.txtPage.Text + "", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtcid.Text + "");

        if (ls_ids != "")
        {
            //静态发布时使用
            string ls_pubtime = System.DateTime.Now.ToString();
            string ls_endtime = System.DateTime.Now.AddYears(10).ToString();
            if (ls_html == "开启")
            {
                JpArticle.PubAll("," + ls_ids + ",", ls_pubtime, ls_endtime);
            }
            //写系统日志
            string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
            if (userip == null || userip == "")
            {
                userip = Request.ServerVariables["REMOTE_ADDR"];
            }
            JpCommon.WriteLog(userip, "全部复制", "全部复制文章栏目ID:" + this.txtcid.Text, Session["uid"].ToString(), Session["uname"].ToString());
        }
        else
        {
            ls_tip = "全部复制失败!请选中复制源栏目和选择目标栏目。";
        }
        Response.Write("<script>alert('" + ls_tip + "');window.location='" + pageUrl + "';</script>");
    }
Exemplo n.º 29
0
        /// <summary>
        /// �޸�
        /// </summary>
        /// <returns></returns>
        public bool Update()
        {
            bool ret = true;
            DAO db = new DAO();

            try
            {
                JpArticle jpArticle = new JpArticle();
                DataTable dt = new DataTable();
                try
                {
                    dt = jpArticle.GetArticleByaid(Convert.ToInt32(hy_aid));
                }
                catch
                {
                }
                if (dt.Rows.Count > 0)
                {
                    hy_bt = dt.Rows[0]["title"].ToString();
                }
                String sql = " update hy_favorite ";
                sql += " set hy_uid = @hy_uid";
                sql += " ,hy_aid = @hy_aid";
                sql += " ,hy_addtime = @hy_addtime";
                sql += " ,hy_bt = @hy_bt";
                sql += " ,hy_cid = @hy_cid";
                sql += " ,hy_sort = @hy_sort";
                sql += " where id=@id ";

                SqlParameter[] sqlparam = {
                    db.MakeInParam("@id",SqlDbType.Int,id),
                    db.MakeInParam("@hy_uid",SqlDbType.VarChar,hy_uid),
                    db.MakeInParam("@hy_aid",SqlDbType.VarChar,hy_aid),
                    db.MakeInParam("@hy_addtime",SqlDbType.VarChar,hy_addtime),
                    db.MakeInParam("@hy_bt",SqlDbType.VarChar,hy_bt),
                    db.MakeInParam("@hy_cid",SqlDbType.VarChar,hy_cid),
                    db.MakeInParam("@hy_sort",SqlDbType.Int,hy_sort),
                };

                db.Execute(sql, sqlparam);
            }
            catch
            {
                ret = false;
            }
            finally
            {
                db.Close();
                db.Dispose();
            }
            return ret;
        }
Exemplo n.º 30
0
    //批量转移
    protected void btnplzy_Click(object sender, EventArgs e)
    {
        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
        TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle();
        string ls_tip = "批量转移成功!";

        TPortalClass.JpSite JpSite = new TPortalClass.JpSite();
        string ls_html = JpSite.fax;
        string ls_ids = "";
        for (int i = 0; i < rptList.Items.Count; i++)
        {
            int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
            //string id = ((HiddenField)rptList.Items[i].FindControl("hidId")).Value;
            CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
            if (cb.Checked)
            {
                if (ls_ids == "")
                {
                    ls_ids = id.ToString();
                }
                else
                {
                    ls_ids = ls_ids + "," + id.ToString();
                }
                string ls_cids = this.txtcheckcid.Text;
                string[] lv_cids = ls_cids.Split('+');
                for (int j = 0; j < lv_cids.Length; j++)
                {
                    if (lv_cids[j] != "")
                    {
                        JpArticle.aid = id;
                        JpArticle.cid = lv_cids[j];
                        JpArticle.UpdatePlzylm();
                    }
                }
            }
        }
        string pageUrl = "";
        pageUrl = JpCommon.CombUrlTxt("list_article_fb.aspx", "page={0}&rnd={1}&cid={2}",
            "" + this.txtPage.Text + "", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtcid.Text + "");

        if (ls_ids != "")
        {
            string ls_pubtime = System.DateTime.Now.ToString();
            string ls_endtime = System.DateTime.Now.AddYears(10).ToString();
            if (ls_html == "开启")
            {
                JpArticle.PubAll("," + ls_ids + ",", ls_pubtime, ls_endtime);
            }
            //写系统日志
            string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
            if (userip == null || userip == "")
            {
                userip = Request.ServerVariables["REMOTE_ADDR"];
            }
            JpCommon.WriteLog(userip, "转移", "批量转移文章ID:" + ls_ids, Session["uid"].ToString(), Session["uname"].ToString());
        }
        else
        {
            ls_tip = "批量转移失败!请选中复制源文章和选择一个目标栏目。";
        }

        Response.Write("<script>alert('" + ls_tip + "');window.location='" + pageUrl + "';</script>");
    }