public ActionResult GetDocumentsDownloadedReportBySpecificUser(string userName) { if (!String.IsNullOrEmpty(userName)) { DocumentsOperations documentsOperations = new DocumentsOperations(); List<FilesDownloadAuditTrail> filesDownloadAuditTrails = documentsOperations.GetFilesDownloadedAuditTrailsBySpecificUser(userName); List<FilesDownloadAuditTrailViewModel> filesDownloadAuditTrailViewModeldata = new List<FilesDownloadAuditTrailViewModel>(); foreach (FilesDownloadAuditTrail item in filesDownloadAuditTrails) { FilesDownloadAuditTrailViewModel filesDownloadAuditTrailViewModel = new FilesDownloadAuditTrailViewModel(); filesDownloadAuditTrailViewModel.FileID = item.FileID; filesDownloadAuditTrailViewModel.NiceNameOrAreaName = item.File.NiceNameOrAreaName; filesDownloadAuditTrailViewModel.DateTimeDownloaded = item.DateTimeDownloaded; filesDownloadAuditTrailViewModeldata.Add(filesDownloadAuditTrailViewModel); } return View(new GridModel<FilesDownloadAuditTrailViewModel> { Total = filesDownloadAuditTrailViewModeldata.Count, Data = filesDownloadAuditTrailViewModeldata }); } else { List<FilesDownloadAuditTrailViewModel> filesDownloadAuditTrails = new List<FilesDownloadAuditTrailViewModel>(); return View(new GridModel<FilesDownloadAuditTrailViewModel> { Total = filesDownloadAuditTrails.Count, Data = filesDownloadAuditTrails }); } }
public ActionResult GetTotalDocumentsDownloadedReport(string isLoad) { if (isLoad == "True") { DocumentsOperations documentsOperations = new DocumentsOperations(); List<FilesDownloadAuditTrail> filesDownloadAuditTrails = documentsOperations.GetTotalFilesDownloadedAuditTrails(); List<FilesDownloadAuditTrailViewModel> filesDownloadAuditTrailViewModeldata = new List<FilesDownloadAuditTrailViewModel>(); foreach (FilesDownloadAuditTrail item in filesDownloadAuditTrails) { FilesDownloadAuditTrailViewModel filesDownloadAuditTrailViewModel = new FilesDownloadAuditTrailViewModel(); filesDownloadAuditTrailViewModel.FileID = item.FileID; filesDownloadAuditTrailViewModel.NiceNameOrAreaName = item.File.NiceNameOrAreaName; filesDownloadAuditTrailViewModel.DateTimeDownloaded = item.DateTimeDownloaded; filesDownloadAuditTrailViewModeldata.Add(filesDownloadAuditTrailViewModel); } return View(new GridModel<FilesDownloadAuditTrailViewModel> { Total = filesDownloadAuditTrailViewModeldata.Count, Data = filesDownloadAuditTrailViewModeldata }); } else { List<FilesDownloadAuditTrailViewModel> filesDownloadAuditTrails = new List<FilesDownloadAuditTrailViewModel>(); return View(new GridModel<FilesDownloadAuditTrailViewModel> { Total = filesDownloadAuditTrails.Count, Data = filesDownloadAuditTrails }); } }