public IActionResult ExportExcel(ReportListVM vm) { vm.SearcherMode = vm.Ids != null && vm.Ids.Count > 0 ? ListVMSearchModeEnum.CheckExport : ListVMSearchModeEnum.Export; var data = vm.GenerateExcel(); return(File(data, "application/vnd.ms-excel", $"Export_Report_{DateTime.Now.ToString("yyyy-MM-dd")}.xls")); }
public string Search(ReportListVM vm) { if (ModelState.IsValid) { return(vm.GetJson(false)); } else { return(vm.GetError()); } }
public IActionResult DeleteReport() { IEnumerable <Report> allReport = _repo.GetAll(); var vm = new ReportListVM { AllReports = _repo.GetAll().Select(x => new SelectListItem { Text = x.Title, Value = x.Id.ToString() }) }; return(View(vm)); }
public async Task <IActionResult> Reports(int productPage = 1, string searchByProduct = null, string searchByCategory = null) { var(reports, reportsCount) = await _reportService.GetFiltered(searchByProduct, searchByCategory, PageSize, productPage); var reportListVM = new ReportListVM() { Reports = reports }; const string Url = "/User/Home/Reports?productPage=:"; reportListVM.PagingInfo = new PagingInfo { CurrentPage = productPage, ItemsPerPage = PageSize, TotalItem = reportsCount, UrlParam = Url }; return(View(reportListVM)); }
public string Search(ReportListVM vm) { return(vm.GetJson(false)); }
public IActionResult ExportExcel(ReportListVM vm) { return(vm.GetExportData()); }