private string getLangPref(string lang) { string username = DBHandler.GetTempUsername(this); if (username != "Guest") { User user = DBHandler.GetUsers().FirstOrDefault(x => x.Username.Equals(username.ToString(), StringComparison.OrdinalIgnoreCase)); if (user != null && (user.langPref != null || user.langPref != "")) { return(user.langPref); } } return(lang); }
public bool DeleteAccount() { string username = DBHandler.GetTempUsername(this).ToLower(); DBHandler.DeleteAccount(username); bool exists = DBHandler.GetUsers().Exists(x => x.Username.Equals(username)); if (!exists) { DBHandler.SetTempUsername(this, "Guest"); DBHandler.SetTempRole(this, "Guest"); return(exists); } else { return(exists); } }