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 lbtnBeginSetUp_Click(object sender, EventArgs e) { int accountid = int.Parse(Request.QueryString["ID"]); DataSet accountType = procedure.getaccounttype(accountid); string userType = accountType.Tables[0].Rows[0]["AccountType"].ToString(); if (userType == "customer") { Response.Redirect("CustProfileCreation.aspx?ID=" + accountid); } }
protected void lbtnEnterSite_Click(object sender, EventArgs e) { int accountid = int.Parse(Request.QueryString["ID"]); int imageSize; string fileExtension; string imgType; string imgName; DataSet typeHandler = procedure.getaccounttype(accountid); string type = typeHandler.Tables[0].Rows[0]["AccountType"].ToString(); try { if (uploadProfilePic.HasFile) { imageSize = uploadProfilePic.PostedFile.ContentLength; byte[] imageData = new byte[imageSize]; uploadProfilePic.PostedFile.InputStream.Read(imageData, 0, imageSize); imgName = uploadProfilePic.PostedFile.FileName; imgType = uploadProfilePic.PostedFile.ContentType; fileExtension = imgName.Substring(imgName.LastIndexOf(".")); fileExtension = fileExtension.ToLower(); if (fileExtension == ".jpg" || fileExtension == ".jpeg" || fileExtension == ".png") { int updateDB = procedure.updateProfileImage(accountid, imgName, imgType, imageData, imageData.Length); } else { Response.Write("<script>alert('This site does not accept the file type you uploaded. Please submit a .jpg, .jpeg or .png file.')</script>"); } } Response.Redirect("ArtistSearch.aspx=ID=" + accountid); }catch { } }