コード例 #1
0
        public void Execute()
        {
            var now      = DateTime.Now;
            var machName = Environment.MachineName;
            var userName = Environment.UserName;

            DataBaseOperations.AddLogData(now, machName, userName, "Login", null);
        }
コード例 #2
0
        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);
        }