/// <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"); } } } }
partial void DeleteOnlineUser(OnlineUser instance);
partial void UpdateOnlineUser(OnlineUser instance);
partial void InsertOnlineUser(OnlineUser instance);