private void AssignReviewAndTasksToRigDPAs(RigOapChecklist checklist) { var checklistQuestionWithNoAnswers = from questions in checklist.Questions from answers in questions.Answers where answers.Value == "N" select questions; if (checklistQuestionWithNoAnswers.Any()) { int rigId; int.TryParse(adminCustomRepository.GetByName("RigId").Value, out rigId); if (rigId == 0) { return; } var rigDPAs = dpaService.GetAllRigDPAs(rigId); foreach (var dpa in rigDPAs) { irmaTaskService.Add(new IrmaTask() { Source = "Oap", SourceId = checklist.Id.ToString(), SourceUrl = string.Format("/Oap/MasterOversight/List/{0}", checklist.Id), // Needs improvement - Does not have access to the MVC routing from the api AssigneeId = dpa.UserId, Comment = string.Format("Master Oversight checklist {0} has a 'NO' answer that needs your review", checklist.RigChecklistUniqueId), AssignedDateTime = DateTime.UtcNow, Status = "Open" }); reviewService.Add(new IrmaReview() { ReviewerPassportId = dpa.UserId, RigId = rigId, SourceForm = "Oap", SourceFormId = checklist.Id.ToString(), }); } } }
public Task <IEnumerable <Irma.Models.Domain.Oap.DPA> > Handle(GetAllRigDPAsRequest request, CancellationToken cancellationToken) { return(Task.FromResult(service.GetAllRigDPAs(request.RigId))); }