예제 #1
0
        /// <summary>
        /// Removing the given user from online users tabel
        /// </summary>
        /// <param name="username">Username</param>
        public void Logout(string username)
        {
            if (username != "")
            {
                OnlineUser onlineUser = dc.OnlineUsers.SingleOrDefault(x => x.Username == username);
                if (dc.OnlineUsers.Any(x => x.Username == username))
                {
                    dc.OnlineUsers.DeleteOnSubmit(onlineUser);
                    dc.SubmitChanges();

                    // Save query to log
                    using (StreamWriter sw = File.AppendText(path))
                    {
                        sw.WriteLine(DateTime.Now + " - " + username + " logged off");
                    }
                }
            }
        }
예제 #2
0
 partial void DeleteOnlineUser(OnlineUser instance);
예제 #3
0
 partial void UpdateOnlineUser(OnlineUser instance);
예제 #4
0
 partial void InsertOnlineUser(OnlineUser instance);