审核

来源:互联网 发布:类似it桔子 编辑:程序博客网 时间:2024/04/19 21:13

 using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;


public partial class admin_advers : System.Web.UI.Page
{
    /// <summary>
    /// 广告位审核管理
    /// 20091127vidy
    /// 积分兑换广告位
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            upimgbind();

        }
    }

    public void upimgbind()
    {
        //查询积分用户
        string str = "select upimg.*,yonghu.score from Useradmin yonghu,adaddress upimg order by score desc";
        DataSet ds = new DBOpea().getvalue(str);
        this.GridView1.DataSource = ds;
        this.GridView1.DataBind();
    }
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName.Equals(""))
        {
           
            int ck = 0;//审核
            int index = ((GridViewRow)((Button)e.CommandSource).Parent.Parent).RowIndex;
            Button btn = (Button)this.GridView1.Rows[index].FindControl("Button1");
            int uid = Convert.ToInt32(btn.CommandArgument.ToString());//获取id
            bool chek = ((CheckBox)this.GridView1.Rows[index].FindControl("okshen")).Checked;
          
            if (chek == true)
            {
                ck = 1;
            }

            string str = "update adaddress set shenhe=" + ck + "  where id=" + uid + "";
            bool ifok = new DBOpea().DataOpera(str);
            if (ifok)
            {
                Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "alert('审核成功!');", true);
            }
        }

    }

    protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        this.GridView1.PageIndex = e.NewPageIndex;
        upimgbind();
    }

}
//////////////////////////////////

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="advers.aspx.cs" Inherits="admin_advers" %>
<html>
<head runat="server">
    <title>积分广告位管理</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
     <table style="width:800px;border-right: #ff9999 1px solid; border-top: #ff9999 1px solid; border-left: #ff9999 1px solid; border-bottom: #ff9999 1px solid; background-color: #ffebed;">
            <tr>
                <td style=" height: 16px;background-color: #ff99cc;">
                    <strong><span style="color: #ffffff; font-size: 12px;">官方强烈推荐,最新奇迹私服,网通奇迹私服,变态奇迹私服管理 &nbsp; &nbsp; &nbsp;
                        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                        &nbsp;
                        <asp:Literal ID="Literal2" runat="server"></asp:Literal></span></strong></td>
            </tr>
            <tr>
                <td style=" text-align: center;">
                    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" OnRowCommand="GridView1_RowCommand" Width="766px" AllowPaging="True" OnPageIndexChanging="GridView1_PageIndexChanging"  PageSize="15">
                          <Columns>
                <asp:BoundField DataField="id" HeaderText="编号" />
                <asp:BoundField DataField="path" HeaderText="图片路径" />
                <asp:BoundField DataField="adname" HeaderText="名称" />
                <asp:BoundField DataField="shentime" HeaderText="审核时间" />
                <asp:BoundField DataField="shenhe" HeaderText="是否审核" />
                <asp:TemplateField HeaderText="审核">
                    <ItemTemplate>
                        <asp:CheckBox ID="okshen" Text="确定" runat="server" Checked='<%# Eval("shenhe") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="提交">
                    <ItemTemplate>
                        <asp:Button ID="Button1" runat="server" Text="提交" CommandArgument='<%# Eval("id") %>' />&nbsp;
                    </ItemTemplate>
                </asp:TemplateField>
               
            </Columns>
                        <RowStyle BackColor="#FFC0FF" />

                    </asp:GridView>
                </td>
            </tr>
        </table>
  
    </div>
    </form>
</body>
</html>

原创粉丝点击