/// <summary>
        /// Creates new entry
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public UserInfo CreateNewUserToken(TokenInfo info)
        {
            var _userName = oauthFactory.GetOAuthTokenDao().getUser(info.access_token).username;

            var _userInfo = new UserInfo
            {
                AuthToken = info.access_token,
                RefreshToken = info.refresh_token,
                UserName = _userName,
                AuthDt = DateTime.Now
            };

            return factory.GetUserInfoDao().SaveUser(_userInfo);
        }
        public SendInfo RetrieveSettings(SettingsRetrieveDTO settingsDTO)
        {
            TokenInfo tokenInfo = new TokenInfo()
            {
                access_token = settingsDTO.accessToken,
                expires_in = settingsDTO.expiresIn,
                token_type = settingsDTO.tokenType,
                scope = settingsDTO.scope,
                refresh_token = settingsDTO.refreshToken
            };

            SendInfo info = GetUserSettings(tokenInfo);
            info.LastWeatherUpdate = null;

            return info;
        }
        /// <summary>
        /// Retrieve user settings from database
        /// </summary>
        /// <param name="userToken"></param>
        /// <returns></returns>
        private SendInfo GetUserSettings(TokenInfo tokenInfo)
        {
            string userName = oauthFactory.GetOAuthTokenDao().getUser(tokenInfo.access_token).username;

            if (userName != null)
            {
                SendInfo info = factory.GetSendInfoDao().Find(userName);

                if (info == null)
                {
                    info = factory.GetSendInfoDao().Insert(new SendInfo(userName));
                    if (factory.GetUserInfoDao().SelectCount(userName) == 0)
                        new UserAuthWorker().CreateNewUserToken(tokenInfo);
                }
                return info;
            }
            throw new ApplicationException(string.Format("Invalid access token {0}", tokenInfo.access_token));
        }