Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
            }
        }