コード例 #1
0
        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));
        }
コード例 #2
0
ファイル: EmployeeController.cs プロジェクト: chiselko6/tofi
        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));
        }
コード例 #3
0
        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));
        }