Esempio n. 1
0
        public bool checkForAccountEmail(string emailOrUsername, bool register)
        {
            bool exists = false;

            //check if the account exists and it is a emmail count type
            try
            {
                if (handler.checkForAccountTypeEmail(emailOrUsername) == null)
                {
                    //the use accoun dose not exist
                }
                else
                if (handler.checkForAccountTypeEmail(emailOrUsername).AccountType.Replace(" ", string.Empty) == "Email")
                {
                    exists = true;
                }
                else
                if (handler.checkForAccountTypeEmail(emailOrUsername).AccountType.Replace(" ", string.Empty) == "Google")
                {
                    if (register == true)
                    {
                        exists = true;
                    }
                }
            }
            catch (Exception e)
            {
                throw new ApplicationException(e.ToString() +
                                               "Error in checkForAccountEmail method of Authentication");
            }
            return(exists);
        }