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;
using System.Data.OleDb;
public partial class usercontrol_userinfo : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        this.adm.Visible=false;
        if (Session["user"] == null)
        {
            Response.Redirect("login.aspx");
        }
        else
        {
            if (Session["user"].ToString() == "51aspx")
            {
                this.adm.Visible = true;
            }
            else 
            {
                this.adm.Visible = false;
            }
            string  OleDb="select * from user_info where userName='"+Session["user"].ToString()+"'";
            OleDbConnection conn = DB.connstr();
            conn.Open();
            OleDbCommand cmd = new OleDbCommand(OleDb, conn);
            OleDbDataReader readinfo = cmd.ExecuteReader();
            if (readinfo.Read())
            {
                this.id.Text = readinfo["userID"].ToString();
                this.uid.Text = readinfo["userName"].ToString();
                this.name.Text = readinfo["trueName"].ToString();
                this.money.Text = readinfo["xingMoney"].ToString();
                this.add.Text = readinfo["address"].ToString();
                this.ph.Text = readinfo["phone"].ToString();
                this.em.Text = readinfo["email"].ToString();
            }
            readinfo.Close();
            conn.Close();
        
        }
    }
 
}
