Ejemplo n.º 1
0
        protected void uxLogin_Click(object sender, EventArgs e)
        {
            string uname = Convert.ToString(uxUser.Text);
            string pass  = Convert.ToString(uxPass.Text);

            if (CustomerDB.Login(uname, pass))
            {
                //if customer already exist
                Customer cust = CustomerDB.Find(uname);
                Session["Customer"] = cust;
                Response.Redirect("~/CustomerOrders.aspx");
            }
            else
            {
                //if customer did not register
                Session["Customer"] = null;
                ValidLogin          = false;
                //Response.Write("Username or Password is not correct.");
                //Response.Write("<script>alert('Username or Password is not correct.')</script>");
            }
        }
Ejemplo n.º 2
0
 public Customer Find(int id)
 {
     return(CustomerDB.Find(id));
 }