Ejemplo n.º 1
0
 public bool SetLogs()
 {
     try
     {
         return(Logs != null && _logsRepository.Insert(Logs));
     }
     catch (Exception)
     {
         // ignore
     }
     return(false);
 }
        /// <summary>
        //  This Method will return regular expression for password policy validation.
        /// </summary>
        /// <param name=""></param>
        /// <returns>this will return regular expression string</returns>
        public bool InsertLogs(Logs log)
        {
            // Logs logs = new Logs();
            // logs.type=log.type;
            // logs.description=log.description;
            // logs.source=log.source;
            // logs.host=log.host;
            // logs.session=log.session;
            // logs.logDate=log.logDate;

            return(_logsRepository.Insert(log));
            //_logsRepository.Commit();
        }
Ejemplo n.º 3
0
        private void ChangeStatus(Jobs job, JobStatus jobStatus)
        {
            job.Status = jobStatus;

            job.LastUpdatedAt = DateTime.Now;

            _jobsRepository.Update(job);

            _jobsRepository.Save();

            var log = new Logs
            {
                JobId       = job.Id,
                Description = string.Format(UserMessages.JobChangeStatus, job.Id, job.Name, jobStatus)
            };

            _logsRepository.Insert(log);

            _logsRepository.Save();
        }
Ejemplo n.º 4
0
        public void Add(string name, DateTime?doAfter)
        {
            try
            {
                var idJob = _jobsRepository.Insert(name, doAfter);

                _jobsRepository.Save();

                var log = new Logs
                {
                    JobId       = idJob,
                    Description = string.Format(UserMessages.NewJobAdded, idJob, name, DateTime.Now)
                };

                _logsRepository.Insert(log);

                _logsRepository.Save();
            }
            catch (Exception ex)
            {
                //TODO dissuced implemention of logging excetions
            }
        }