ccwl_admin/giftManage.aspx.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

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

public partial class ccwl_admin_giftManage : System.Web.UI.Page
{

    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["users"] == null || Session["users"].ToString() == "")
        {
            Response.Write("<script>alert('对不起您还没有登陆!');window.location='login.aspx'</script>");
            return;
        }
        else if (!IsPostBack)
        {

            BindArticles();

        }

    }
    protected void gvwArticles_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        string id = gvwArticles.DataKeys[e.RowIndex].Value.ToString();
        string sql = "delete from gift where id=" + id;
        DBClass.ExecuteNonQuery(DBClass.connString, sql);
        BindArticles();
    }
    private void BindArticles()
    {

        string sql = "select id,proNo,proTitle,proQuantity,proPic,proIntegral,isTop,isShow,sort from gift";

        if (this.txtGift.Text.Trim() != "")
        {
            sql += " and proTitle like '%" + this.txtGift.Text.Trim() + "%' ";
        }
        sql += " order by sort desc,id desc ";

        DataSet ds = DBClass.GetTableData(sql, "articles");
        gvwArticles.DataSource = ds.Tables[0].DefaultView;
        gvwArticles.DataBind();
    }
    protected void gvwArticles_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "recom")
        {
            string[] arg = e.CommandArgument.ToString().Split(',');
            string sql = "update gift set istop=1 where id=" + arg[0];
            if (arg[1].Trim() == "True")
            {
                sql = "update gift set istop=0 where id=" + arg[0];
后面还有 68 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。