public string GetUsername(int userId) { string query = "SELECT Username FROM UserAccount WHERE UserId = " + userId; Models.Database db = new Models.Database(); db.Connect(); return(db.UserIdToUsername(query)); }
protected void NewPasswordButton_Click(object sender, EventArgs e) { string query = "UPDATE UserAccount SET Password = '******' WHERE Username = '******'"; Models.Database db = new Models.Database(); db.Connect(); db.UpdatePassword(query); this.Session["RecoveryStep"] = "1"; Response.Redirect("~/Views/LogIn.aspx"); }
public bool CheckIfUserExists(string username) { string query = "SELECT Username FROM UserAccount WHERE Username = '******'"; Models.Database db = new Models.Database(); db.Connect(); if (db.ReturnBoolFromSingleResult(query)) { return(true); } return(false); }