public List <Report> GetSortedReportList() { var reportList = reportRepository.GetAllReports(); // var filteredReportList = reportList.OrderBy(x => x.) return(null); }
public List <Report> GetNewestReports() { ReportRepository <Report> reportrepository = new ReportRepository <Report>(); var reportList = reportrepository.GetAllReports(); var newestreports = reportList.OrderByDescending(x => x.ReportDate); return(null); }
public void OnGet() { Rideids = new SelectList(rideRepository.GetRides(), "Id", "Name"); MatchingReports = new List <Report>(); if (!string.IsNullOrEmpty(SearchNote) || (int)SearchStatus != -1 || SearchRideId != -1 || SearchDate != default(DateTime)) { MatchingReports = reportRepository.GetAllMatchingReports(SearchRideId, SearchDate, (int)SearchStatus, SearchNote); } else { MatchingReports = reportRepository.GetAllReports(); } }
//Загрузка данных в грид "Отчеты" private bool LoadDataToGridReport() { string error; _reports = _repoReport.GetAllReports(out error); if (error != string.Empty) { MessageBox.Show("Помилка завантаження звітів.\nТехнічна інформація: " + error, "Помилка"); return(false); } BindingSource source = new BindingSource(); source.DataSource = _reports.OrderBy(rec => rec.Report_Name); dgvReport.DataSource = source; return(true); }
public List <UserModelView> AllUsersByAdmin() { ReportRepository reportRepo = new ReportRepository(); RecipeRepository recipeRepo = new RecipeRepository(); PostRepository postRepo = new PostRepository(); RestaurantRepository restRepo = new RestaurantRepository(); List <UserModelView> userModelList = new List <UserModelView>(); foreach (var user in this.GetAll()) { UserModelView umv = new UserModelView(); umv.TotalReport = 0; umv.TotalRecipe = 0; umv.TotalPost = 0; umv.TotalRestaurant = 0; umv.Name = user.Name; umv.Image = user.Image; umv.UserId = user.UserID; //toral report foreach (var report in reportRepo.GetAllReports()) { if (user.UserID == report.ReportedId) { umv.TotalReport += 1; } } //toral recipe foreach (var recipe in recipeRepo.GetAll()) { if (user.UserID == recipe.UserId) { umv.TotalRecipe += 1; } } //toral post foreach (var post in postRepo.GetAll()) { if (user.UserID == post.UserID) { umv.TotalPost += 1; } } //Total Restaurant foreach (var rest in restRepo.GetAll()) { if (user.UserID == rest.UserID) { umv.TotalRestaurant += 1; } } userModelList.Add(umv); } return(userModelList); }
public IActionResult Get() { return(Ok(_reportRepository.GetAllReports())); }