MasterPage.master.cs

(开头部分) 3KB

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

using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class MasterPage : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["MemberName"] != null)
        {
            //会员没有退出登陆
            divLogin.Visible = false;
            divShow.Visible = true;  
        }
        if (!IsPostBack)
        {
            string SqlType = "select top 10 * from tb_GoodsType order by TypeID desc";

            DataSet ds = DBHelper.GetDataSet(SqlType);
            this.GridView2.DataSource = ds.Tables[0];
            this.GridView2.DataBind();

            string sql2 = "SELECT TOP (5) GoodsID, GoodsName, GoodsPicture,sales FROM tb_Goods WHERE (sales <> - 1) ORDER BY sales DESC";
            DataSet result2 = DBHelper.GetDataSet(sql2);

            this.DataList2.DataSource = result2.Tables[0];
            this.DataList2.DataBind();

            string sql3 = "select top 15  * from tb_Goods where ChuXiao='是'";
            DataSet result3 = DBHelper.GetDataSet(sql3);

            this.GridView3.DataSource = result3.Tables[0];
            this.GridView3.DataBind();

          

        }

    }
    protected void btLogin_Click(object sender, EventArgs e)
    {
        string membername, pwd;
        membername = this.txtMemberName.Text.Trim();
        pwd = this.txtPWD.Text;

        
        string sql1 = "select * from tb_Member where MemberName ='" + membername + "' and MemberPwd ='" + pwd + "'";

        DataSet ds1 = DBHelper.GetDataSet(sql1);
       

        if (ds1.Tables[0].Rows.Count >= 1)
        {
            //存在该用户
            Session["MemberName"] = ds1.Tables[0].Rows[0][1];//将登录的会员编号和会员名称用session变量保存,以备后用
            Session["MemberID"] = ds1.Tables[0].Rows[0][0];
后面还有 40 行代码,购买后查看完整代码

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

AI 解读 AI

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

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