Esempio n. 1
0
        public IActionResult PerformanceLogs(PerformanceLogSearchCriteria search)
        {
            var perfData = logRetrivalService.GetPerformanceLogs(search);

            perfData.ActiveTab = 3;
            return(View(perfData));
        }
Esempio n. 2
0
        public ReturnListWithSearchModel <PerfLog, PerformanceLogSearchCriteria> GetPerformanceLogs(PerformanceLogSearchCriteria search)
        {
            throw new NotImplementedException();

            /*
             * try
             * {
             *  using (var reader = GetNewPerfReader())
             *  {
             *      var searcher = new IndexSearcher(reader);
             *      var lst = searcher.AsQueryable<PerformanceLog>();
             *
             *      if (search.FromDate.IsValidDate() && search.ToDate.IsValidDate())
             *      {
             *          if (search.FromDate.Value <= search.ToDate.Value)
             *          {
             *              lst = lst.Where(x => x.Longdate >= search.FromDate.Value.StartOfDay() && x.Longdate <= search.ToDate.Value.EndOfDay());
             *          }
             *      }
             *      else if (search.FromDate.IsValidDate())
             *      {
             *          lst = lst.Where(x => x.Longdate >= search.FromDate.Value.StartOfDay());
             *      }
             *      else if (search.ToDate.IsValidDate())
             *      {
             *          lst = lst.Where(x => x.Longdate <= search.ToDate.Value.EndOfDay());
             *      }
             *
             *      lst = lst.OrderByDescending(x => x.Longdate);
             *
             *      var totalRows = lst.AsQueryable().Count();
             *      search.TotalRowCount = totalRows;
             *      var resultList = lst.ApplyPaging(search.Page, search.PageSize).ToList();
             *      search.CurrentRows = resultList.Count;
             *      return new ReturnListModel<PerformanceLog, PerformanceLogSearchCriteria>(search, resultList, totalRows);
             *  }
             * }
             * catch (Exception ex)
             * {
             *  log.Error(ex, "Error when getting Performance Log list ");
             *  search.TotalRowCount = 0;
             *  search.CurrentRows = 0;
             *  return new ReturnListModel<PerformanceLog, PerformanceLogSearchCriteria>(search, "Error when getting Performance Log list ", ex);
             * }
             */
        }
Esempio n. 3
0
        public ReturnListWithSearchModel <PerfLog, PerformanceLogSearchCriteria> GetPerformanceLogs(PerformanceLogSearchCriteria search)
        {
            try
            {
                using (var reader = GetNewAppReader())
                {
                    var searcher = new IndexSearcher(reader);
                    var lst      = searcher.AsQueryable <AppLog>();

                    if (search.FromDate.IsValidDate() && search.ToDate.IsValidDate())
                    {
                        if (search.FromDate.Value <= search.ToDate.Value)
                        {
                            lst = lst.Where(x => x.Longdate >= search.FromDate.Value.StartOfDay() && x.Longdate <= search.ToDate.Value.EndOfDay());
                        }
                    }
                    else if (search.FromDate.IsValidDate())
                    {
                        lst = lst.Where(x => x.Longdate >= search.FromDate.Value.StartOfDay());
                    }
                    else if (search.ToDate.IsValidDate())
                    {
                        lst = lst.Where(x => x.Longdate <= search.ToDate.Value.EndOfDay());
                    }

                    lst = lst.OrderByDescending(x => x.Longdate);

                    var totalRows = lst.AsQueryable().Count();
                    search.TotalRowCount = totalRows;
                    var resultList = lst.ApplyPaging(search.Page, search.PageSize).ToList();
                    search.CurrentRows = resultList.Count;
                    return(new ReturnListWithSearchModel <PerfLog, PerformanceLogSearchCriteria>(search, resultList.ToPerfLogs(), totalRows));
                }
            }
            catch (Exception ex)
            {
                log.Error(ex, "Error when getting Performance Log list ");
                search.TotalRowCount = 0;
                search.CurrentRows   = 0;
                return(new ReturnListWithSearchModel <PerfLog, PerformanceLogSearchCriteria>(search, "Error when getting Performance Log list ", ex));
            }
        }
Esempio n. 4
0
 public ReturnListWithSearchModel <PerfLog, PerformanceLogSearchCriteria> GetPerformanceLogs(PerformanceLogSearchCriteria search)
 {
     throw new NotImplementedException();
 }
Esempio n. 5
0
 public ReturnListWithSearchModel <PerfLog, PerformanceLogSearchCriteria> GetPerformanceLogs(PerformanceLogSearchCriteria search)
 {
     try
     {
         return(logReadRepository.GetPerformanceLogs(search));
     }
     catch (Exception ex)
     {
         log.Error(ex, "Error when getting Performance Log  List ");
         search.TotalRowCount = 0;
         search.CurrentRows   = 0;
         return(new ReturnListWithSearchModel <PerfLog, PerformanceLogSearchCriteria>(search, ex));
     }
 }