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); }
public void Execute() { DateTime now; DateTime yesterday; if (isDefault) { now = DateTime.Now; yesterday = new DateTime(now.Year, now.Month, now.Day - 1); } else { now = to; yesterday = from; } var dt = DataBaseOperations.GetLogData(yesterday, now); ConsoleTools.DisplayTable(dt); }