public async Task <IPagedList <ActivityLog> > Get([FromQuery] ActivityLogTypeSearchViewModel viewModel) { await AuthorizeReadAsync(ActivityLogFunctionName); var from = viewModel.From ?? DateTime.Now.AddDays(-1); var to = viewModel.To ?? DateTime.Now; return(await _activityLogService.GetPagedListAsync( from.StartOfDayUtc(), to.EndOfDayUtc(), viewModel.UserName.TrimNull(), viewModel.IP.TrimNull(), viewModel.Page, viewModel.Size)); }
public async Task <IActionResult> Search(SearchActivityLogViewModel viewModel) { viewModel.ParseFormData(Request.Form); var pagedList = await _activityLogService.GetPagedListAsync( viewModel.FromDate, viewModel.ToDate, viewModel.UserName, viewModel.IP, viewModel.SortColumnName, viewModel.SortDirection, viewModel.Start, viewModel.Length); return(viewModel.CreateResponse( pagedList.TotalRecords, pagedList.TotalRecordsFiltered, pagedList)); }