protected void btnLogOut_Click(object sender, EventArgs e) { clsDataLayer c = new clsDataLayer(); c.signOut(); btnLogOut.Visible = false; lnkLogin.Visible = true; lnkRegister.Visible = true; }
} /* end Page_Load */ //protected void btnSubmit_Click(object sender, EventArgs e) //{ // // pending delete //} /* end btnSubmit_Click */ protected void btnSubmit(object sender, EventArgs e) { // instantiate clsDataLayerObject for access to methods// clsDataLayer c = new clsDataLayer(); // check if form is posting back to Register page // /* if (IsPostBack) { } end IsPostBack */ if (c.checkCustomerExists(email.Text) == 1 ) { lblUsrExists.Text = "Email address already exists, try a different address"; //Response.Write("Email address already exists"); //Response.Redirect("Register.aspx"); } else { // try-catch takes query insert and then responds with success or failure // try { c.createCustomer(firstNm.Text, lastNm.Text, email.Text, streetaddress.Text, city.Text, state.Text, zipcode.Text, password.Text); Session["LoggedInUser"] = c.getSessionID(email.Text); Response.Redirect("RegistrationSuccessful.aspx"); } catch (Exception ex) { // show error message if database insert is unsuccessful // Response.Write("Error occurred: " + ex.ToString()); } /* end catch (Exception ex) */ } /* end else statement*/ }
protected void Page_Load(object sender, EventArgs e) { clsDataLayer c = new clsDataLayer(); if (Session["CustomerID"] == null) { lnkLogin.Visible = true; lnkRegister.Visible = true; lnkProfile.Visible = false; btnLogOut.Visible = false; } else { lnkLogin.Visible = false; lnkRegister.Visible = false; lnkProfile.Visible = true; } /* end if() */ if (IsPostBack) { } }