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.SqlClient;public partial class Login : System.Web.UI.Page
{    protected void btnLogin_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            shopbase loginDB = new shopbase();
            string tempCartID = loginDB.GetShoppingCartId();
            string customerid = loginDB.Login(txtUserName.Text.ToString(), txtPassword.Text.ToString());
            if (customerid != null)
            {
                //loginDB.TransplantShoppingCart(tempCartID, customerid.ToString());
                CustomerDetails customerDetails = loginDB.GetCustomerDetails(customerid);
                Response.Cookies["Store_CustomerName"].Value = loginDB.GetCustomerDetails(customerid).CustomerName;
                FormsAuthentication.RedirectFromLoginPage(customerid, true);
            }
            else
            {
                Message.Text = "用户名或密码错误,请重新登录";
            }
            
        }
    }
    protected void btnRegister_Click(object sender, EventArgs e)
    {
        Response.Redirect("Register.aspx");
    }
}