public ListQueryResult <CreditRequestViewModel> GetDepartmentCreditRequests(DepartmentCreditRequestsQuery query) { var rightsRes = CheckEmployeeRights(query.EmployeeId, EmployeeRights.CreditDepartmentChief); if (rightsRes.IsFailed) { return(new ListQueryResult <CreditRequestViewModel>(query, null, false).From(rightsRes)); } return(Filter(_creditRequestService.GetDepartmentRequests(new DepartmentRequestsQuery()), query)); }
public ActionResult Department(DepartmentCreditRequestsQuery query) { ViewBag.EmployeeType = "Department"; ViewBag.Currency = _currencies.Select(model => new SelectListItem { Value = model.Id.ToString(), Text = model.Name }); ViewBag.CreditTypes = _creditTypes.Select(model => new SelectListItem { Value = model.Id.ToString(), Text = model.Name }); var employee = GetEmployee(); query.EmployeeId = employee.Id; var requests = _employeeService.GetDepartmentCreditRequests(query).Value; requests = FilterAssignedRequests(requests); return(View("CurrentRequests", requests)); }
public async Task <ListQueryResult <CreditRequestDto> > GetDepartmentCreditRequestDtosAsync(DepartmentCreditRequestsQuery query) { var rightsRes = await CheckEmployeeRightsAsync(query.EmployeeId, EmployeeRights.CreditDepartmentChief); if (rightsRes.IsFailed) { return(new ListQueryResult <CreditRequestDto>(query, null, false).From(rightsRes)); } return(Filter(await _creditRequestService.GetDepartmentRequestsDtosAsync(new DepartmentRequestsQuery()), query)); }