public void Execute() { var now = DateTime.Now; var machName = Environment.MachineName; var userName = Environment.UserName; DataBaseOperations.AddLogData(now, machName, userName, "Login", null); }
public void Execute() { var now = DateTime.Now; var machName = Environment.MachineName; var userName = Environment.UserName; var lastRow = DataBaseOperations.GetLastRow(machName, userName); var lastDate = (DateTime)lastRow["event_date"]; var duration = DateTime.Now - lastDate; DataBaseOperations.AddLogData(now, machName, userName, "Logout", duration.Seconds); }