Пример #1
0
        /// <summary>
        /// Record the last user web login date and time on the users record in the database.
        /// </summary>
        /// <param name="user"></param>
        public void UpdateLastWebLogin(Common user)
        {
            if (user.sp_GetLogin == null)
            {
                throw new FaultException("UpdateLastWebLogin-1: Session not authenticated.");
            }

            lock (Authenticated)
            {
                if (Authenticated.Count > 0 && Authenticated.Contains(user.sp_GetLogin.FirstOrDefault().sessionid))
                {
                    using (CommonTableAdapters.QueriesTableAdapter queries = new CommonTableAdapters.QueriesTableAdapter())
                    {
                        queries.sp_UpdateLastWeblogin(user.sp_GetLogin.First().user_id);
                    }
                }
                else
                {
                    //not authenticated
                    throw new FaultException("UpdateLastWebLogin-2: Session not authenticated.");
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Record the last user web login date and time on the users record in the database.
        /// </summary>
        /// <param name="user"></param>
        public void UpdateLastWebLogin(Common user)
        {
            if (user.sp_GetLogin == null)
            {
                throw new FaultException("UpdateLastWebLogin-1: Session not authenticated.");
            }

            lock (Authenticated)
            {
                if (Authenticated.Count > 0 && Authenticated.Contains(user.sp_GetLogin.FirstOrDefault().sessionid))
                {
                    using (CommonTableAdapters.QueriesTableAdapter queries = new CommonTableAdapters.QueriesTableAdapter())
                    {
                        queries.sp_UpdateLastWeblogin(user.sp_GetLogin.First().user_id);
                    }
                }
                else
                {
                    //not authenticated
                    throw new FaultException("UpdateLastWebLogin-2: Session not authenticated.");
                }
            }
        }