Пример #1
0
 //列出采集项目
 private void GetCollItemList()
 {
     TPortalClass.JpCollect_box JpCollect_box = new TPortalClass.JpCollect_box();
     //string ls_sql2 = "SELECT * FROM JpCollect_box as a,JpColumns as b where a.ClassId = b.cid order by Id";
     DataTable dt = JpCollect_box.Getcjlb();
     this.GvCollItemList.DataSource = dt;
     this.GvCollItemList.DataBind();
 }
Пример #2
0
    //复制向导
    private void CopyCollectInfo()
    {
        TPortalClass.JpCollect_box JpCollect_box = new TPortalClass.JpCollect_box();
        if (Request.QueryString["id"] != null)
        {
            JpCollect_box.ItemName = ItemName + "副本";
            JpCollect_box.ClassId = ClassId;
            JpCollect_box.WebEncode = WebEncode;
            JpCollect_box.WebName = WebName;
            JpCollect_box.WebUrl = WebUrl;

            JpCollect_box.ItemRemark = ItemRemark;
            JpCollect_box.Script_Iframe = Script_Iframe;
            JpCollect_box.Script_Object = Script_Object;
            JpCollect_box.Script_Script = Script_Script;
            JpCollect_box.Script_Div = Script_Div;

            JpCollect_box.Script_Table = Script_Table;
            JpCollect_box.Script_Span = Script_Span;
            JpCollect_box.Script_Img = Script_Img;
            JpCollect_box.Script_Font = Script_Font;
            JpCollect_box.Script_A = Script_A;

            JpCollect_box.Script_Html = Script_Html;
            JpCollect_box.IsSaveImg = IsSaveImg;
            JpCollect_box.IsDesc = IsDesc;
            JpCollect_box.CollecNum = CollecNum;

            JpCollect_box.ListUrl = ListUrl;
            JpCollect_box.ListStart = ListStart;
            JpCollect_box.ListEnd = ListEnd;
            JpCollect_box.LinkStart = LinkStart;
            JpCollect_box.LinkEnd = LinkEnd;

            JpCollect_box.TitleStart = TitleStart;
            JpCollect_box.TitleEnd = TitleEnd;
            JpCollect_box.RemoveTitle = RemoveTitle;
            JpCollect_box.KeyWordStart = KeyWordStart;
            JpCollect_box.KeyWordEnd = KeyWordEnd;

            JpCollect_box.DateStart = DateStart;
            JpCollect_box.SourceStart = SourceStart;
            JpCollect_box.DateEnd = DateEnd;
            JpCollect_box.SourceEnd = SourceEnd;
            JpCollect_box.ContentStart = ContentStart;
            JpCollect_box.ContentEnd = ContentEnd;
            JpCollect_box.RemoveBodyStart = RemoveBodyStart;

            JpCollect_box.RemoveBodyEnd = RemoveBodyEnd;
            JpCollect_box.NextPageRegex = NextPageRegex;
            JpCollect_box.Copydoc();
        }
    }
Пример #3
0
    //根据ID得到列表所有内容
    private void GetAllListContent()
    {
        TPortalClass.JpCollect_box JpCollect_box = new TPortalClass.JpCollect_box();
        if (Request.QueryString["id"] != null && Request.QueryString["id"] != "8888")
        {

            Id = this.Request.QueryString["id"].ToString();

            //string ls_sql = "select * from JpCollect_box where id = " + Id;
            dt = JpCollect_box.Getdocbyid(int.Parse(Id));
            //dt = db.GetDataTable(ls_sql);

            if (dt.Rows.Count > 0)
            {
                this.txtId.Text = dt.Rows[0]["Id"].ToString();

                ListUrl = dt.Rows[0]["ListUrl"].ToString();
                ListStart = dt.Rows[0]["ListStart"].ToString();
                ListEnd = dt.Rows[0]["ListEnd"].ToString();
                LinkStart = dt.Rows[0]["LinkStart"].ToString();
                LinkEnd = dt.Rows[0]["LinkEnd"].ToString();

                TitleStart = dt.Rows[0]["TitleStart"].ToString();
                TitleEnd = dt.Rows[0]["TitleEnd"].ToString();
                RemoveTitle = dt.Rows[0]["RemoveTitle"].ToString();
                KeyWordStart = dt.Rows[0]["KeyWordStart"].ToString();
                KeyWordEnd = dt.Rows[0]["KeyWordEnd"].ToString();
                DateStart = dt.Rows[0]["DateStart"].ToString();
                SourceStart = dt.Rows[0]["SourceStart"].ToString();
                DateEnd = dt.Rows[0]["DateEnd"].ToString();
                SourceEnd = dt.Rows[0]["SourceEnd"].ToString();
                ContentStart = dt.Rows[0]["ContentStart"].ToString();
                ContentEnd = dt.Rows[0]["ContentEnd"].ToString();
                RemoveBodyStart = dt.Rows[0]["RemoveBodyStart"].ToString();
                RemoveBodyEnd = dt.Rows[0]["RemoveBodyEnd"].ToString();
                NextPageRegex = dt.Rows[0]["NextPageRegex"].ToString();

                ItemName = dt.Rows[0]["ItemName"].ToString();
                ClassId = dt.Rows[0]["ClassId"].ToString();
                WebEncode = dt.Rows[0]["WebEncode"].ToString();
                WebName = dt.Rows[0]["WebName"].ToString();
                WebUrl = dt.Rows[0]["WebUrl"].ToString();
                ItemRemark = dt.Rows[0]["ItemRemark"].ToString();
                CollecNum = Convert.ToInt32(dt.Rows[0]["CollecNum"].ToString());
                IsSaveImg = Convert.ToInt32(dt.Rows[0]["IsSaveImg"].ToString());
                IsDesc = Convert.ToInt32(dt.Rows[0]["IsDesc"].ToString());

                Script_Iframe = Convert.ToInt32(dt.Rows[0]["Script_Iframe"].ToString());
                Script_A = Convert.ToInt32(dt.Rows[0]["Script_A"].ToString());
                Script_Div = Convert.ToInt32(dt.Rows[0]["Script_Div"].ToString());
                Script_Font = Convert.ToInt32(dt.Rows[0]["Script_Font"].ToString());
                Script_Html = Convert.ToInt32(dt.Rows[0]["Script_Html"].ToString());
                Script_Img = Convert.ToInt32(dt.Rows[0]["Script_Img"].ToString());
                Script_Object = Convert.ToInt32(dt.Rows[0]["Script_Object"].ToString());
                Script_Script = Convert.ToInt32(dt.Rows[0]["Script_Script"].ToString());
                Script_Span = Convert.ToInt32(dt.Rows[0]["Script_Span"].ToString());
                Script_Table = Convert.ToInt32(dt.Rows[0]["Script_Table"].ToString());
            }
        }
    }
Пример #4
0
    protected void BtnAdd_Click(object sender, EventArgs e)
    {
        TPortalClass.JpCollect_box JpCollect_box = new TPortalClass.JpCollect_box();
        int Script_Iframe = 0, Script_Object = 0, Script_Script = 0, Script_Div = 0, Script_Table = 0, Script_Span = 0;
        int Script_Img = 0, Script_Font = 0, Script_A = 0, Script_Html = 0, IsSaveImg = 0, IsDesc = 0;
        if (this.ChkIframe.Checked)
        {
            Script_Iframe = 1;
        }
        if (this.ChkObject.Checked)
        {
            Script_Object = 1;
        }
        if (this.ChkScript.Checked)
        {
            Script_Script = 1;
        }
        if (this.ChkDiv.Checked)
        {
            Script_Div = 1;
        }
        if (this.ChkTable.Checked)
        {
            Script_Table = 1;
        }
        if (this.ChkSpan.Checked)
        {
            Script_Span = 1;
        }
        if (this.ChkImg.Checked)
        {
            Script_Img = 1;
        }
        if (this.ChkFont.Checked)
        {
            Script_Font = 1;
        }
        if (this.ChkA.Checked)
        {
            Script_A = 1;
        }
        if (this.ChkHtml.Checked)
        {
            Script_Html = 1;
        }
        if (this.ChkSaveImg.Checked)
        {
            IsSaveImg = 1;
        }
        if (this.ChkIsDesc.Checked)
        {
            IsDesc = 1;
        }

        string ls_url = "";

        JpCollect_box.ItemName = TxtItemName.Text;
        JpCollect_box.ClassId = ddl1.SelectedItem.Value;
        JpCollect_box.WebEncode = DdlEndoce.SelectedValue;
        JpCollect_box.WebName = TxtWebName.Text;
        JpCollect_box.WebUrl = TxtWebUrl.Text;
        JpCollect_box.ItemRemark = TxtItemRemark.Text;
        JpCollect_box.Script_Iframe = Script_Iframe;
        JpCollect_box.Script_Object = Script_Object;
        JpCollect_box.Script_Script = Script_Script;
        JpCollect_box.Script_Div = Script_Div;
        JpCollect_box.Script_Table = Script_Table;
        JpCollect_box.Script_Span = Script_Span;
        JpCollect_box.Script_Img = Script_Img;
        JpCollect_box.Script_Font = Script_Font;
        JpCollect_box.Script_A = Script_A;
        JpCollect_box.Script_Html = Script_Html;
        JpCollect_box.IsSaveImg = IsSaveImg;
        JpCollect_box.IsDesc = IsDesc;
        JpCollect_box.CollecNum = int.Parse(TxtCollecNum.Text);

        if (Request.QueryString["id"] == "8888")
        {
            //新建
            //Response.Write("<script>alert('采集基本信息填写111111111111111');</script>");
            JpCollect_box.Insert();

            //sql = "insert into JpCollect_box (ItemName,ClassId,WebEncode,WebName,WebUrl,ItemRemark,Script_Iframe";
            //sql += ",Script_Object,Script_Script,Script_Div,Script_Table,Script_Span,Script_Img,Script_Font";
            //sql += ",Script_A,Script_Html,IsSaveImg,IsDesc,CollecNum) values (";
            //sql += "'" + TxtItemName.Text + "','" + ddl1.SelectedItem.Value + "','" + DdlEndoce.SelectedValue + "','" + TxtWebName.Text + "','" + TxtWebUrl.Text + "','" + TxtItemRemark.Text + "','" + Script_Iframe.ToString() + "'";
            //sql += ",'" + Script_Object.ToString() + "','" + Script_Script.ToString() + "','" + Script_Div.ToString() + "','" + Script_Table.ToString() + "','" + Script_Span.ToString() + "','" + Script_Img.ToString() + "','" + Script_Font.ToString() + "'";
            //sql += ",'" + Script_A.ToString() + "','" + Script_Html.ToString() + "','" + IsSaveImg.ToString() + "','" + IsDesc.ToString() + "','" + TxtCollecNum.Text + "'";
            //sql += ")";
            //db.Execute(sql);

            //得到最大的ID
            //string ls_maxid = "";
            ////string ls_sql = "select max(Id) as maxid from JpCollect_box";
            //DataTable dt1 = JpCollect_box.GetMaxID();

            //if (dt1.Rows.Count > 0)
            //{
            //    ls_maxid = JpCollect_box.GetMaxID();
            //}
            ls_url = "list_collect_box.aspx?action=list&id=" + JpCollect_box.GetMaxID();

        }
        else
        {
            //修改
            JpCollect_box.Id = int.Parse(this.txtId.Text);
            JpCollect_box.UpdateCjjbxx();
            //sql = "update JpCollect_box set ItemName='" + TxtItemName.Text + "',ClassId='" + ddl1.SelectedItem.Value + "',WebEncode='" + DdlEndoce.SelectedValue + "'";
            //sql += ",WebName='" + TxtWebName.Text + "',WebUrl='" + TxtWebUrl.Text + "',ItemRemark='" + TxtItemRemark.Text + "'";
            //sql += ",Script_Iframe='" + Script_Iframe + "',Script_Object='" + Script_Object + "',Script_Script='" + Script_Script + "'";
            //sql += ",Script_Div='" + Script_Div + "',Script_Table='" + Script_Table + "',Script_Span='" + Script_Span + "'";
            //sql += ",Script_Img='" + Script_Img + "',Script_Font='" + Script_Font + "',Script_A='" + Script_A + "'";
            //sql += ",Script_Html='" + Script_Html + "',IsSaveImg='" + IsSaveImg + "',IsDesc='" + IsDesc + "'";
            //sql += ",CollecNum='" + TxtCollecNum.Text + "' where id=" + this.txtId.Text;

            //db.Execute(sql);
            ls_url = "list_collect_box.aspx?action=list&id=" + this.txtId.Text;

        }
        Response.Write("<script>alert('采集基本信息填写完成!');window.location='" + ls_url + "';</script>");
    }
Пример #5
0
    protected void GvCollItemList_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        int Id = Convert.ToInt32(GvCollItemList.DataKeys[e.RowIndex].Value);

        TPortalClass.JpCollect_box JpCollect_box = new TPortalClass.JpCollect_box();
        JpCollect_box.Id = Id;
        JpCollect_box.Delete();
        //string sql = "delete from JpCollect_box where id=" + Id;

        //db.Execute(sql);
        //db.Close();

        GetCollItemList();
    }
Пример #6
0
    //通过测试 设置采集状态为“可采集”
    protected void BtnTestOK_Click(object sender, EventArgs e)
    {
        TPortalClass.JpCollect_box JpCollect_box = new TPortalClass.JpCollect_box();
        JpCollect_box.Id = int.Parse(this.txtId.Text);
        JpCollect_box.UpdateCjnrcs();
        //string sql = "update JpCollect_box set State='0' where id=" + this.txtId.Text;

        //db.Execute(sql);
        //db.Close();
        Response.Write("<script>alert('采集内容测试');window.location='list_collect_box.aspx';</script>");
    }
Пример #7
0
    //列表内容更新
    protected void BtnList_Click(object sender, EventArgs e)
    {
        TPortalClass.JpCollect_box JpCollect_box = new TPortalClass.JpCollect_box();

        JpCollect_box.ListUrl = this.TxtListUrl.Text.Trim();
        JpCollect_box.ListStart = this.TxtListStart.Text.Trim();
        JpCollect_box.ListEnd = this.TxtListEnd.Text.Trim();
        JpCollect_box.Id = int.Parse(this.txtId.Text);
        JpCollect_box.UpdateCjlb();
        //string sql = "update JpCollect_box set ListUrl='" + this.TxtListUrl.Text.Trim() + "',ListStart='" + this.TxtListStart.Text.Trim() + "',ListEnd='" + this.TxtListEnd.Text.Trim() + "'";
        //sql += " where id=" + this.txtId.Text;

        //db.Execute(sql);
        //db.Close();
        //string ls_url = "list_collect_box.aspx?action=link&id=" + this.txtId.Text;
        string ls_url = "list_collect_box.aspx";
        Response.Write("<script>alert('采集列表填写完成!');window.location='" + ls_url + "';</script>");
    }
Пример #8
0
    //内容TxtRemoveTitle
    protected void BtnContent_Click(object sender, EventArgs e)
    {
        TPortalClass.JpCollect_box JpCollect_box = new TPortalClass.JpCollect_box();
        JpCollect_box.TitleStart = this.TxtTitleStart.Text.Trim();
        JpCollect_box.TitleEnd = this.TxtTitleEnd.Text.Trim();
        JpCollect_box.RemoveTitle = this.TxtRemoveTitle.Text.Trim();
        JpCollect_box.KeyWordStart = this.TxtKeyWordStart.Text.Trim();
        JpCollect_box.KeyWordEnd = this.TxtKeyWordEnd.Text.Trim();
        //JpCollect_box.DateRegex = this.TxtDateRegex.Text.Trim();
        //JpCollect_box.SourceRegex = this.TxtSourceRegex.Text.Trim();
        JpCollect_box.DateStart = this.TxtDateStart.Text;
        JpCollect_box.SourceStart = this.TxtSourceStart.Text;
        JpCollect_box.DateEnd = this.TxtDateEnd.Text;
        JpCollect_box.SourceEnd = this.TxtSourceEnd.Text;
        JpCollect_box.ContentStart = this.TxtContentStart.Text.Trim();
        JpCollect_box.ContentEnd = this.TxtContentEnd.Text.Trim();
        JpCollect_box.RemoveBodyStart = this.TxtRemoveBodyStart.Text.Trim();
        JpCollect_box.RemoveBodyEnd = this.TxtRemoveBodyEnd.Text.Trim();
        JpCollect_box.NextPageRegex = this.TxtNextPageRegex.Text.Trim();
        JpCollect_box.Id = int.Parse(this.txtId.Text);
        JpCollect_box.UpdateCjnr();

        //string sql = "update JpCollect_box set TitleStart='" + this.TxtTitleStart.Text.Trim() + "',TitleEnd='" + this.TxtTitleEnd.Text.Trim() + "'";
        //sql += ",RemoveTitle='" + this.TxtRemoveTitle.Text.Trim() + "',KeyWordStart='" + this.TxtKeyWordStart.Text.Trim() + "'";
        //sql += ",KeyWordEnd='" + this.TxtKeyWordEnd.Text.Trim() + "',DateRegex='" + this.TxtDateRegex.Text.Trim() + "'";
        //sql += ",SourceRegex='" + this.TxtSourceRegex.Text.Trim() + "',ContentStart='" + this.TxtContentStart.Text.Trim() + "'";
        //sql += ",ContentEnd='" + this.TxtContentEnd.Text.Trim() + "',RemoveBodyStart='" + this.TxtRemoveBodyStart.Text.Trim() + "'";
        //sql += ",RemoveBodyEnd='" + this.TxtRemoveBodyEnd.Text.Trim() + "',NextPageRegex='" + this.TxtNextPageRegex.Text.Trim() + "'";
        //sql += " where id=" + this.txtId.Text;

        //db.Execute(sql);
        //db.Close();
        string ls_url = "list_collect_box.aspx?action=test&id=" + this.txtId.Text;
        Response.Write("<script>alert('采集内容填写完成!');window.location='" + ls_url + "';</script>");
    }