Esempio n. 1
0
        public void LogFileUploadEvent(string fileName)
        {
            DateTime now = DateTime.Now;
            LogModel logModel = new LogModel();
            string combinedMessage = "Uploaded picture "+ fileName;

            logModel.date = now;
            logModel.description = combinedMessage;
            logModel.Username = "";
            logModel.logEvent = LogEventType.FileUpload;

            db.Logs.Add(logModel);
            db.SaveChanges();
        }
Esempio n. 2
0
        private void LogEvent(string username, string message, LogEventType logEvent)
        {
            DateTime now = DateTime.Now;
            LogModel logModel = new LogModel();
            string combinedMessage = message + " for user: " + username;

            logModel.date = now;
            logModel.description = combinedMessage;
            logModel.Username = username;
            logModel.logEvent = logEvent;

            db.Logs.Add(logModel);
            db.SaveChanges();
        }