protected void lbtnSignIn_Click(object sender, EventArgs e) { string email = txtEmail.Text; string enteredpass = txtPass.Text; DataSet accountinfo = procedure.getaccountidfromemail(email); int account = int.Parse(accountinfo.Tables[0].Rows[0]["Account_ID"].ToString()); DataSet passinfo = procedure.getpassword(account); string password = passinfo.Tables[0].Rows[0]["Password"].ToString(); DataSet type = procedure.getaccounttype(account); string accType = type.Tables[0].Rows[0]["AccountType"].ToString(); DataSet verification = procedure.getverification(account); int verifactionCode = int.Parse(verification.Tables[0].Rows[0]["Verification"].ToString()); if (accType == "artist" && verifactionCode == 1 && password == enteredpass) { Response.Redirect("ArtistLandingPage.aspx?ID=" + account); } else if (accType == "customer" && verifactionCode == 1 && password == enteredpass) { Response.Redirect("CustomerLandingPage.aspx?ID=" + account); } else { Response.Write("<script>alert('Your account has not been verified. Please check your email for verification details.')</script>"); } }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["ID"] != null) { int accountid = int.Parse(Request.QueryString["ID"]); DataSet userData = procedure.getVerificationInformation(accountid); DataSet verificationStatus = procedure.getverification(accountid); int verifactionCode = int.Parse(verificationStatus.Tables[0].Rows[0]["Verification"].ToString()); if (verifactionCode != 1) { int updateStatus = procedure.updateAccountVerification(accountid); if (updateStatus == 1) { string fName = userData.Tables[0].Rows[0]["FirstName"].ToString(); string lName = userData.Tables[0].Rows[0]["LastName"].ToString(); string accountName = fName + " " + lName; lblVerificationTitle.Text = "Account has been verified"; lblVerificationInfo.Text = "Account for " + accountName + " has been verified. You are now able to access your information. Please click the button below to begin account set up."; lbtnBackHome.Visible = false; } else { lblVerificationTitle.Text = "Something went wrong"; lblVerificationInfo.Text = "Your account was not verified. Please contect system admins."; lbtnBeginSetUp.Text = "Log In"; lbtnBeginSetUp.Visible = false; } } else { lblVerificationTitle.Text = "Verification Not Valid"; lblVerificationInfo.Text = "Verification of this account has already been complete. Please click the link below to log in to your account."; lbtnBeginSetUp.Text = "Log In"; lbtnBeginSetUp.Visible = false; } } else { lblVerificationTitle.Text = "ERROR"; lblVerificationInfo.Text = "You did not enter the valid URL needed to verify your accout. Reminder that all verification links are sent to the email you used to sign up with us. Please check you email or contact an admin for help."; lbtnBeginSetUp.Visible = false; } }