public JsonResult Filter(WorkerFilter filter) { var response = _workerService.Filter(filter); if (filter.IsReport) { var branches = _branchService.Filter(new BranchFilter()).Branches; response.Workers.ForEach(worker => worker.Branch = branches.FirstOrDefault(branch => branch.Id.IsEqualTo(worker.BranchId))); } return(new JsonFactory().Success(response.Workers, response.TotalRecords)); }
public JsonResult Filter(BranchFilter filter) { var response = _branchService.Filter(filter); return(new JsonFactory().Success(response.Branches, response.TotalRecords)); }