public ActionResult Index(int page = 1) { ViewBag.Logs = logRepository.GetAll(new PagingOptions <AuditLog>(page, Pagination.DefaultPageSize, "Dttm", true)); ViewBag.Pagination = new Pagination { TotalCount = logRepository.Count(), CurrentPage = page }; return(View()); }
public List <AuditLog> GetAuditLogBusinessObject(string business_object) { Log.Info("Accessing AuditLogBusinessEngine GetAuditLogByID function"); return(ExecuteFaultHandledOperation(() => { var audit_log_data = _audit_log_repo.GetAll(business_object); List <AuditLog> audits = new List <AuditLog>(); Log.Info("AuditLogBusinessEngine GetByID function completed"); foreach (AuditLogData log_entry in audit_log_data) { audits.Add(_audit_log_es.Map(log_entry)); } return audits; })); }
public IEnumerable <AuditLogModel> Invoke() { var logs = auditLogRepository.GetAll(); var users = userRepository.GetAll().ToDictionary(dic => dic.Id, dic => dic); var regex = new Regex(@"((?<=\p{Ll})\p{Lu})|((?!\A)\p{Lu}(?>\p{Ll}))", RegexOptions.Compiled); return(from auditLog in logs let user = users.ContainsKey(auditLog.UserId.GetValueOrDefault()) ? users[auditLog.UserId.GetValueOrDefault()] : null select new AuditLogModel { AuditLogId = auditLog.Id, UserId = user?.Id ?? 0, UserName = user != null ? $"{user.FirstName} {user.LastName}" : "N/A", EventType = regex.Replace(auditLog.EventType, " $0"), EventMessage = auditLog.EventMassage, CreationDate = auditLog.CreationDate, UserStatus = user?.Status ?? UserStatus.Deleted }); }
public IEnumerable <Entities.AuditLog> GetAll(string searchValue, int pageSize, int skip, int take, string sortField, string dir) { return(_auditLogRepository.GetAll(searchValue, pageSize, skip, take, sortField, dir)); }