Esempio n. 1
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();
        }
Esempio n. 2
0
 public void createNewUser([Bind(Include = "Id,UserName,Password")] RegistrationModel model)
 {
     db.Logins.Add(model);
     db.SaveChanges();
 }