protected void LoginBtn_Click(object sender, EventArgs e) { //loginCtrl.SesId = Session.SessionID; Session["StartTime"] = DateTime.UtcNow; Session["Name"] = userEmailTxt.Text; if (loginCtrl.authenticate(userEmailTxt.Text, password.Text)) { if (loginCtrl.isAdmin(userEmailTxt.Text, password.Text)) { Session["Admin"] = "admin"; } else { Session["Admin"] = "no"; } Response.Redirect("Profile.aspx"); } }
protected void EditProfileBtn_Click(object sender, EventArgs e) { int rows = 0; UserDaoImpl dao = new UserDaoImpl(); u = new User(); u.Email = email.Text; u.Address = address.Text; u.City = city.Text; u.LastName = lastName.Text; u.Phone = MobilePhone.Text; u.FirstName = firstName.Text; u.State = DropDownList1.SelectedValue; u.Zip = Convert.ToInt32(zipCode.Text); u.Text = checkToText.Checked; u.Carrier = CarrierList.SelectedValue; //Verifies correct password was input to modify profile info if (userControl.authenticate(email.Text, password1.Text)) { rows = dao.updateUser(u); } else { ResultLabel.Text = "Password was incorrect. Please try again."; return; } //Upon successful update of profile user is redirected back to Auction.asp if (rows == 1) { ResultLabel.Text = "Changes Successfully Saved!"; } else { ResultLabel.Text = "Unable to update your profile at this time."; } }