protected void Page_Load(object sender, EventArgs e) { if (!SuperMarketBIZ.Instance.InBusiness || Session["Curr_Customer"] == null) Response.Redirect("~/Default.aspx"); if (!IsPostBack) { GoodsManageBIZ biz = new GoodsManageBIZ(); this.GridView1.DataKeyNames = new string[] { "GoodsID" }; this.GridView1.DataSource = biz.GetGoodsSaleInfo(); this.GridView1.DataBind(); Customer customer = (Customer)Session["Curr_Customer"]; this.lblWelcomeMsg.Text = string.Format("你好[{0}],你的客户号是:{1}", customer.CustomerName, customer.CustomerID); btnBuy.Enabled = false; btnEditBuyCount.Enabled = false; lblGoodsCount.Text = customer.Goodss.Count.ToString(); ((Site2)this.Master).NavigateMessage = "今日商品信息"; } }