コード例 #1
0
ファイル: list_help_sh.aspx.cs プロジェクト: wjszxli/xdjb
    //受理
    protected void btnDeal_Click(object sender, EventArgs e)
    {
        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
        TPortalClass.JpAdver JpAdver = new TPortalClass.JpAdver();
        string ls_tip = "受理成功!";
        for (int i = 0; i < rptList.Items.Count; i++)
        {
            string id = ((HiddenField)rptList.Items[i].FindControl("hidId")).Value;
            CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
            if (cb.Checked)
            {
                TPortalClass.DAO db = new DAO();
                string sql = "update hy_help set hy_ifsh=1 where id=" + int.Parse(id) + "";
                db.Execute(sql);
            }
        }
        string pageUrl = JpCommon.CombUrlTxt("list_help_sh.aspx", "page={0}&rnd={1}",
            "" + this.txtPage.Text + "", "" + System.Guid.NewGuid().ToString() + "");

        //写系统日志

        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>");
    }
コード例 #2
0
ファイル: main_adver_sh.aspx.cs プロジェクト: wjszxli/xdjb
    //撤稿
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (this.Session["uid"] == null || this.Session["uid"].ToString() == "")
        {
            this.Response.Redirect("../login.aspx");
        }

        string ls_tip = "撤稿成功!";

        TPortalClass.JpAdver JpAdver = new TPortalClass.JpAdver();
        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
        TPortalClass.DAO db = new TPortalClass.DAO();
        string sql_cg = "update hy_adver set hy_ifsh=3 where id=" + System.Int32.Parse(this.txtid.Value) + "";
        db.Execute(sql_cg);
        //写系统日志
        string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
        if (userip == null || userip == "")
        {
            userip = Request.ServerVariables["REMOTE_ADDR"];
        }
        JpCommon.WriteLog(userip, "撤稿", "撤稿广告链接记录[id:" + this.txtid.Value + "]", Session["uid"].ToString(), Session["uname"].ToString());
        JpAdver.Update();

        Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>");
    }
コード例 #3
0
ファイル: list_adver_tg.aspx.cs プロジェクト: wjszxli/xdjb
    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;
        txtPageNum.Text = this.pageSize.ToString();
        txtPage.Text = this.page.ToString();

        TPortalClass.JpAdver JpAdver = new TPortalClass.JpAdver();

        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
        string ls_key = JpCommon.Filter(this.txtKeywords.Text.Trim());

        DataTable dt = new DataTable();
        string ls_where = "  and   hy_advername  like '%" + ls_key + "%' ";
        ls_where += "   and ( hy_ifsh=1 or hy_ifsh=0 )";
        dt = JpAdver.SearchdocsByKey(ls_where, "   order  by hy_sort desc ", Convert.ToInt32(txtPage.Text), 10);

        this.totalCount = JpAdver.SearchdocsByKeyNum(ls_where);

        rptList.DataSource = dt;
        rptList.DataBind();

        string pageUrl = JpCommon.CombUrlTxt("list_adver_tg.aspx", "page={0}&rnd={1}&keywords={2}",
            "__id__", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtKeywords.Text + "");
        PageContent.InnerHtml = JpCommon.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
    }
コード例 #4
0
ファイル: main_adver_sh.aspx.cs プロジェクト: wjszxli/xdjb
    //审核
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (this.Session["uid"] == null || this.Session["uid"].ToString() == "")
        {
            this.Response.Redirect("../login.aspx");
        }
        TPortalClass.JpAdver JpAdver = new TPortalClass.JpAdver();
        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
        JpAdver.hy_advername = this.txthy_advername.Text;
        JpAdver.hy_way = this.txthy_way.SelectedValue;
        JpAdver.hy_adverurl = this.txthy_adverurl.Text;
        JpAdver.hy_sort = int.Parse(this.txthy_sort.Text);
        JpAdver.hy_adversize = this.txthy_adversize.Text;
        JpAdver.hy_advertitle = this.txthy_advertitle.Text;
        JpAdver.hy_used = "0";
        JpAdver.hy_ifsh = 2;
        JpAdver.hy_starttime = this.txthy_starttime.Value.Trim();
        JpAdver.hy_endtime = this.txthy_endtime.Value.Trim();
        TPortalClass.DAO db = new TPortalClass.DAO();
        string lsfilename = FileUpload1.FileName;
        string lspath = "", lsurl = "", str_path = "";
        if (lsfilename != "")  //attsize
        {
            lsfilename = System.Guid.NewGuid() + "_" + lsfilename;
            //将附件上传到服务器目录下
            lspath = Server.MapPath("~/");  //虚拟目录的位置
            lsurl = "/upload/adverpic_yt";  //原图存放的文件夹
            Directory.CreateDirectory(lspath + "/" + lsurl);
            str_path = lspath + "/" + lsurl + "/" + lsfilename;
            FileUpload1.SaveAs(str_path);
            JpAdver.hy_adverpic = lsurl + "/" + lsfilename;
        }
        else
        {
            JpAdver.hy_adverpic = this.txtpicurl.Value;
        }
        string ls_tip = "发布成功!";

        if (this.txtop.Value == "add")
        {
            if (JpAdver.IsExist())
            {
                this.Response.Write("<script language=javascript>alert('该广告名称已经存在!')</script>");
                return;
            }
            //写系统日志
            string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
            if (userip == null || userip == "")
            {
                userip = Request.ServerVariables["REMOTE_ADDR"];
            }
            JpCommon.WriteLog(userip, "广告审核", "广告审核记录[id:" + this.txtid.Value + "]", Session["uid"].ToString(), Session["uname"].ToString());
            JpAdver.Insert();
        }
        else
        {
            JpAdver.id = System.Int32.Parse(this.txtid.Value);
            //写系统日志
            string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
            if (userip == null || userip == "")
            {
                userip = Request.ServerVariables["REMOTE_ADDR"];
            }
            JpCommon.WriteLog(userip, "广告审核", "广告审核记录[id:" + this.txtid.Value + "]", Session["uid"].ToString(), Session["uname"].ToString());
            JpAdver.Update();
        }
        Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>");
    }
コード例 #5
0
ファイル: main_adver_sh.aspx.cs プロジェクト: wjszxli/xdjb
    private void DataPlay()
    {
        if (this.Request.QueryString["op"] != null)
        {
            this.txtop.Value = this.Request.QueryString["op"].ToString();           //新增还是修改
        }

        if (this.Request.QueryString["id"] != null)
        {
            this.txtid.Value = this.Request.QueryString["id"].ToString();     //文档ID
        }
        TPortalClass.JpAdver JpAdver = new TPortalClass.JpAdver();

        //旧文档
        if (this.txtop.Value == "modify")
        {
            DataTable dt = JpAdver.Getdocbyid(int.Parse(this.txtid.Value));
            if (dt.Rows.Count > 0)
            {
                this.txtid.Value = dt.Rows[0]["id"].ToString();
                this.txthy_advername.Text = dt.Rows[0]["hy_advername"].ToString();
                this.txthy_advername.Enabled = false;
                this.txthy_way.SelectedValue = dt.Rows[0]["hy_way"].ToString();
                this.txthy_adverurl.Text = dt.Rows[0]["hy_adverurl"].ToString();
                this.txthy_starttime.Value = Convert.ToDateTime(dt.Rows[0]["hy_starttime"].ToString()).ToString("yyyy-MM-dd");
                this.txthy_endtime.Value = Convert.ToDateTime(dt.Rows[0]["hy_endtime"].ToString()).ToString("yyyy-MM-dd");
                if (dt.Rows[0]["hy_adverpic"].ToString() != "")
                {
                    this.txtpicurl.Value = dt.Rows[0]["hy_adverpic"].ToString();
                    this.lblpic.Text = "<img src='" + dt.Rows[0]["hy_adverpic"].ToString() + "' onError=\"this.src='/images/index/images/nophoto.jpg';\" width=60px height=55px />";
                }
                this.txthy_adversize.Text = dt.Rows[0]["hy_adversize"].ToString();
                this.txthy_advertitle.Text = dt.Rows[0]["hy_advertitle"].ToString();
                this.txthy_sort.Text = dt.Rows[0]["hy_sort"].ToString();
            }
        }
        else
        {
            this.txthy_sort.Text = (Convert.ToInt32(JpAdver.GetMaxSort().Rows[0]["hy_sort"].ToString()) + 1).ToString();
        }
    }
コード例 #6
0
ファイル: index.aspx.cs プロジェクト: wjszxli/xdjb
 //首页广告
 private void GetAdvers()
 {
     TPortalClass.JpAdver JpAdver = new TPortalClass.JpAdver();
     string ls_where = " and hy_ifsh='2' ";
     string ls_order = " order by hy_sort";
     DataTable dt = JpAdver.SearchdocsByKey(ls_where, ls_order, 1, 4);
     if (dt.Rows.Count == 4)
     {
         this.lb_gg1.Text = "<a onclick=\"locationDetail('" + dt.Rows[0]["hy_adverurl"].ToString() + "','" + locationType + "','0')\"  target=_blank><img src=\"" + dt.Rows[0]["hy_adverpic"].ToString() + "\" onError=\"this.src='images/nophoto.jpg';\"></a>";
         this.lb_gg2.Text = "<a onclick=\"locationDetail('" + dt.Rows[1]["hy_adverurl"].ToString() + "','" + locationType + "','0')\"  target=_blank><img src=\"" + dt.Rows[1]["hy_adverpic"].ToString() + "\" onError=\"this.src='images/nophoto.jpg';\"></a>";
         this.lb_gg3.Text = "<a onclick=\"locationDetail('" + dt.Rows[2]["hy_adverurl"].ToString() + "','" + locationType + "','0')\"  target=_blank><img src=\"" + dt.Rows[2]["hy_adverpic"].ToString() + "\" onError=\"this.src='images/nophoto.jpg';\"></a>";
         this.lb_gg4.Text = "<a onclick=\"locationDetail('" + dt.Rows[3]["hy_adverurl"].ToString() + "','" + locationType + "','0')\"  target=_blank><img src=\"" + dt.Rows[3]["hy_adverpic"].ToString() + "\" onError=\"this.src='images/nophoto.jpg';\"></a>";
     }
 }