コード例 #1
0
ファイル: EmployeeController.cs プロジェクト: chiselko6/tofi
        public ActionResult SecurityApprove(SecurityApproveCommand command)
        {
            var employee = GetEmployee();

            command.EmployeeId = employee.Id;
            _employeeService.SecurityApproveCommand(command);
            var request = GetRequest(command);

            _creditRequestService.UnassignEmployee(request);
            return(RedirectToAction("Security"));
        }
コード例 #2
0
        public CommandResult SecurityApproveCommand(SecurityApproveCommand command)
        {
            var rightsRes   = CheckEmployeeRights(command.EmployeeId, EmployeeRights.SecurityOfficer);
            var employeeRes = GetEmployee(command.EmployeeId);
            var requestRes  = GetCreditRequest(command.CreditRequestId);
            var res         = CheckQueries(rightsRes, employeeRes, requestRes);

            if (res.IsFailed)
            {
                return(new CommandResult(command, false).From(res));
            }
            var request = requestRes.Value;

            request.IsSecurityApproved = command.Approved;
            request.SecurityComments   = command.Comments;
            request.SecurityApproved   = employeeRes.Value;
            return(UpdateCreditRequest(command, request));
        }