protected void btnLogin_Click(object sender, EventArgs e) { string useremail = email.Value; string userpassword = password.Value; if(useremail == "" || userpassword =="") { lbl_result.Text = "You have not entered your email or password"; } else { AzureUserBLL login = new AzureUserBLL(); string dbpwd=login.CheckLogin(useremail); byte[] userpwd = Encoding.ASCII.GetBytes(userpassword); byte[] uphash = sha.ComputeHash(userpwd); string pwdhashbase64 = Convert.ToBase64String(uphash); Session["email"] = useremail; if (dbpwd == pwdhashbase64) Response.Redirect("patientprogress.aspx"); else lbl_result.Text = "Error,Your Email or Password might be wrong"; } }
protected void btn_signup(object sender, EventArgs e) { string emailinput = email.Value; if (emailinput == "") { lbl_result.Text = "Email cannot be empty"; } else { emailcheck = EmailIsValid(emailinput); } string tnameinput = tname.Value; string userdob = dob.Value; string userpasswordinput = password.Value; string cfmpasswordinput = cfmpassword.Value; string mobileinput = mobileno.Value; if (emailcheck == true) { if (fu_upload.HasFile) { if (fu_upload.PostedFile != null) { AzureUserBLL validateinput = new AzureUserBLL(); string FileName = Path.GetFileName(fu_upload.PostedFile.FileName); fu_upload.SaveAs(Server.MapPath("PImages//" + FileName)); validateinput.CreateDoctorAcccount(emailinput, tnameinput, userpasswordinput, cfmpasswordinput, mobileinput, userdob, "PImages//" + FileName); lbl_result.Text = validateinput.returnMessage; } } else { lbl_result.Text = "You did not upload a profile image"; } } else { lbl_result.Text = "Email is Invalid"; } }