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 membercenter : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string sql0 = "select count(*) from members";
        lblnum.Text = oper.findstr(sql0);
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string sql0 = "select * from members where mname='" + TextBox1.Text + "' and mcarno='" + TextBox2.Text + "'";
        if (oper.isfind(sql0))
        {
            Panel1.Visible = true;
            lblnomem.Visible = false;
            string sql1 = "select top 1 * from members where mname='" + TextBox1.Text + "' and mcarno='" + TextBox2.Text + "'";
            DataRow dr = oper.dr(sql1);
            lblname.Text = dr["mname"].ToString();
            lblcarno.Text = dr["mcarno"].ToString();
            lblcartype.Text = dr["mcartype"].ToString();
            lblmoney.Text = dr["mmoney"].ToString();
            imgcar.ImageUrl = dr["mcarpic"].ToString();

            string sql2 = "select * from 会员消费记录 where 会员名='" + TextBox1.Text + "'";
            gdvdetail.DataSource = oper.dt(sql2);
            gdvdetail.DataBind();
        }
        else
        {
            Panel1.Visible = false;
            lblnomem.Visible = true;
        }
    }
}
