Esempio n. 1
0
        public LogInfo AddVerificationLog(User user, int verificationCode)
        {
            var logInfo = new LogInfo();

            logInfo.User             = user;
            logInfo.VerificationCode = verificationCode;
            logInfo.ExpiryDate       = DateTime.UtcNow.AddMinutes(5);
            return(_logInfoRepository.Add(logInfo));
        }
Esempio n. 2
0
        private void AddLog(string logType, string message, string actor, DateTime date)
        {
            LogInfo log = new LogInfo()
            {
                LogType  = logType,
                Message  = message,
                Username = actor,
                Date     = date
            };

            logger.Add(log);
        }
        public int Log(string logType, string messagge, string username, DateTime date)
        {
            LogInfo newLog = new LogInfo()
            {
                Id       = 0,
                LogType  = logType,
                Message  = messagge,
                Username = username,
                Date     = date
            };

            try
            {
                newLog = logRepo.Add(newLog);
            }
            catch (DataInaccessibleException e) {
                throw new ServiceException(e.Message, ErrorType.DATA_INACCESSIBLE);
            }
            return(newLog.Id);
        }
 public void AddLogTest()
 {
     repo.Add(log1);
     Assert.AreEqual(1, repo.GetAll().Count);
 }