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")); }
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)); }