public async Task <DataSourceGrid <LogDTO> > GetGridLogs(ShowLogFilterParameters parameters) { List <FilterDefinition <Log> > rules = new List <FilterDefinition <Log> >(); FilterDefinition <Log> filter; foreach (var rule in parameters.RulesSet.Rules) { rules.Add(ShowLogFilterBuilder.BuildFilter(rule)); } filter = ShowLogFilterBuilder.GetConditionFilters(parameters.RulesSet, rules); var logs = await _dbService.Logs.GetAsync(filter, parameters.Skip, parameters.Take); var dataSource = new DataSourceGrid <LogDTO>(); dataSource.Data = logs.Select(o => new LogDTO() { MessageId = o.MessageId, RequestDate = o.RequestDate, Request = _processLogTree.GetTree(o.Request), ResponseDate = o.ResponseDate, Response = _processLogTree.GetTree(o.Response) }); dataSource.CountLogs = await _dbService.Logs.Count(filter); return(dataSource); }
public async Task <DataSourceGrid <AnswerDTO> > GetGridAnswers(int skip, int take) { var answers = await AnswerProcess.GetAnswers(skip, take); var dataSource = new DataSourceGrid <AnswerDTO>(); dataSource.Data = answers.Select(o => new AnswerDTO() { StatusId = o.StatusId.ToString(), Text = o.Text, }); dataSource.CountLogs = await _dbService.Answers.Count(); return(dataSource); }
public async Task <DataSourceGrid <KnownErrorDTO> > GetGridKnownError(int skip, int take) { var knownErrors = await ErrorProcess.GetKnownErrors(skip, take); var dataSource = new DataSourceGrid <KnownErrorDTO>(); dataSource.Data = knownErrors.Select(o => new KnownErrorDTO() { CountFounded = o.CountFounded, Message = o.Message, Status = ErrorProcess.GetTreeStatus(o.Status), Answer = ErrorProcess.GetTreeAnswer(o.Answer), }); dataSource.CountLogs = await _dbService.KnownErrors.Count(); return(dataSource); }
public async Task <DataSourceGrid <UnKnownErrorDTO> > GetGridUnKnownError(int skip, int take) { var unKnownErrors = await ErrorProcess.GetUnKnownErrors(skip, take); var dataSource = new DataSourceGrid <UnKnownErrorDTO>(); dataSource.Data = unKnownErrors.Select(o => new UnKnownErrorDTO() { ObjectId = o.Id.ToString(), MessageId = o.MessageId, Message = o.Message, Count = o.CountFounded }); dataSource.CountLogs = await _dbService.UnKnownErrors.Count(); return(dataSource); }