Пример #1
0
        protected void btnRegister_Click(object sender, EventArgs e)
        {
            if (tbPassword.Text == tbPasswordConfirmation.Text)
            {
                MarinaCustomer NewCustomer = new MarinaCustomer();
                NewCustomer.FirstName = tbFirstName.Text;
                NewCustomer.LastName  = tbLastName.Text;
                NewCustomer.Phone     = tbPhone.Text;
                NewCustomer.City      = tbCity.Text;
                NewCustomer.Email     = tbEmail.Text;
                NewCustomer.Password  = tbPassword.Text;

                int success = MarinaCustomerDB.AddMarinaCustomer(NewCustomer);

                if (Convert.ToString(success) != "")
                {
                    Response.Write("<script>alert('Sucessfully Registered');</script>");
                    Response.Redirect("LeaseSlip.aspx");
                }
                else
                {
                    Response.Write("<script>alert('Registration Unsuccessful');</script>");
                }
            }
            else
            {
                Response.Write("<script>alert('New Password doesnt match');</script>");
            }
        }
Пример #2
0
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            MarinaCustomer registeredCustomer = new MarinaCustomer();

            registeredCustomer.Email    = tbEmail.Text;
            registeredCustomer.Password = tbPassword.Text;
            int custID = MarinaCustomerDB.MarinaCustomerLogin(registeredCustomer);

            if (custID >= 1)
            {
                Session["CustomerID"] = custID;
                Response.Redirect("AvailableLeaseSlip.aspx");
            }
            else
            {
                Response.Redirect("Registration.aspx");
            }
        }