public async Task <ActionResult> Index() { var response = await OapChecklistClient.GetAllAsync(GetAllModelsCorp()); Session[CurrentChecklists] = response.Result.Data; return(View("OapChecklistQuestionsHelp", response.Result.Data)); }
private RigOapChecklist CreateFSOChecklist(int OwnerId, string Title, DateTime ChecklistDateTime) { OapChecklist oapChecklist = OapChecklistClient.GetByNameAsync("FSO Checklist").Result?.Result?.Data; if (oapChecklist == null) { ViewData["UpdateError"] = true; return(null); } RigOapChecklist checklist = new RigOapChecklist(); checklist.CreatedBy = UtilitySystem.CurrentUserName; checklist.OwnerId = OwnerId; //UtilitySystem.CurrentUserId; checklist.CreatedDateTime = DateTime.UtcNow; checklist.ChecklistDateTime = ChecklistDateTime; //DateTime.UtcNow; checklist.Title = Title; checklist.UpdatedDateTime = DateTime.UtcNow; checklist.Status = "Open"; checklist.OapchecklistId = oapChecklist.Id; var newChecklist = RigOapChecklistClient.AddRigChecklistAsync(checklist).Result?.Result?.Data; return(newChecklist); }
public async Task <ActionResult> AddScheduledChecklist(int numberOfDays, DateTime StartingAt, string title, string description) { if (StartingAt != null && numberOfDays > 0) { var lifeSaverChecklist = OapChecklistClient.GetByNameAsync("Life Savers").Result?.Result?.Data; if (lifeSaverChecklist == null) { throw new Exception("The life savers checklist was not found. Please contact the development support team"); } for (int i = 0; i < numberOfDays; i++) { var checklistDate = StartingAt.AddDays(i); RigOapChecklist checklist = new RigOapChecklist() { Status = "Open", ChecklistDateTime = checklistDate, OapchecklistId = lifeSaverChecklist.Id, IsAutoScheduled = true, //RigId = UtilitySystem.Settings.RigId.ToString(), Title = title, Description = description, CreatedDateTime = DateTime.UtcNow }; await RigOapChecklistClient.AddRigChecklistAsync(checklist); } } return(DisplayLifeSaverScheduleAbdJobs()); }
public ActionResult UpdateChecklistHelp(OapChecklist model) { // TODO: Add update logic here var response = OapChecklistClient.UpdateOapChecklistAsync(model).Result; return(RedirectToAction("Index")); }
public OapChecklistGroupsController() : base() { OapChecklistGroupClient = new OapChecklistGroupClient(GetApiBaseUrl(), Client); OapChecklistSubGroupClient = new OapChecklistSubGroupClient(GetApiBaseUrl(), Client); OapChecklistClient = new OapChecklistClient(GetApiBaseUrl(), Client); OapGraphicClient = new OapGraphicClient(GetApiBaseUrl(), Client); }
public async Task <ActionResult> CreateChecklist(OapChecklist model) { // TODO: Add insert logic here var response = await OapChecklistClient.AddOapChecklistAsync(model); return(RedirectToAction("Index")); }
public async Task <ActionResult> DeleteChecklist(OapChecklist model) { if (model.Id > 0) { var response = await OapChecklistClient.DeleteOapChecklistAsync(model.Id); } return(RedirectToAction("Index")); }
private OapChecklist GetCorporateFSOChecklist() { if (corpFSOChecklist == null) { corpFSOChecklist = OapChecklistClient.GetByNameAsync("FSO Checklist").Result?.Result?.Data; } return(corpFSOChecklist); }
public OapChecklistsController() : base() { OapChecklistClient = new OapChecklistClient(GetApiBaseUrl(), Client); OapHierarchyClient = new OapHierarchyClient(GetApiBaseUrl(), Client); OapProtocolFormTypeClient = new OapProtocolFormTypeClient(GetApiBaseUrl(), Client); OapFrequencyTypeClient = new OapFrequencyTypeClient(GetApiBaseUrl(), Client); }
public OapProtocolsToAuditController() : base() { OapAuditClient = new OapAuditClient(GetApiBaseUrl(), Client); OapChecklistClient = new OapChecklistClient(GetApiBaseUrl(), Client); OapAuditsClient = new OapAuditClient(GetApiBaseUrl(), Client); GridDataChecklist.Title = "Open Protocol Checklists"; GridDataChecklist = new GridData("OapProtocolsGrid", "OapProtocolsToAudit", "RigChecklists", "Protocols to Audit", "AddNewProtocol", "Add Protocol", "search", initializeCallBack: true); }
private List <OapChecklist> GetProtocols() { var protocols = new List <OapChecklist>(); var checklists = OapChecklistClient.GetAllAsync(GetAllModelsCorp()).Result?.Result?.Data; if (checklists != null) { protocols.AddRange(checklists.Where(c => c.OapType.IsProtocol)); } return(protocols); }
public GenericDashboardController() : base() { RigOapChecklistClient = new RigOapChecklistClient(GetApiBaseUrl(), Client); OapChecklistClient = new OapChecklistClient(GetApiBaseUrl(), Client); PeopleClient = new PeopleClient(GetApiBaseUrl(), Client); Owner = CommonUtilities.GetUsers(PeopleClient); ChecklistType = "BRC"; ChecklistSubType = "All"; ChecklistStatus = "Open"; FormType = "All"; }
public OapProtocolQuestionHeadersController() : base() { OapProtocolQuestionHeaderClient = new OapProtocolQuestionHeaderClient(GetApiBaseUrl(), Client); OapChecklistClient = new OapChecklistClient(GetApiBaseUrl(), Client); OapChecklistQuestionClient = new OapChecklistQuestionClient(GetApiBaseUrl(), Client); }
protected virtual IEnumerable <OapChecklist> GetProtocols() { var protocols = OapChecklistClient.GetAllAuditProtocolsAsync().Result?.Result?.Data; return(protocols); }
public static IEnumerable <OapChecklist> GetChecklists(OapChecklistClient client, string typeName, string subTypeName, string formType = "All", bool useTypeSubTypeFormTypeCode = false) { var values = (useTypeSubTypeFormTypeCode) ? client.GetAllByTypeSubTypeFormTypeCodeAsync(typeName, subTypeName, formType).Result?.Result?.Data : client.GetAllByTypeSubTypeFormTypeAsync(typeName, subTypeName, formType).Result?.Result?.Data; return(values); }
public static IEnumerable <OapChecklist> GetChecklists(OapChecklistClient client, GetAllModel model) { var values = client.GetAllAsync(model).Result?.Result?.Data; return(values); }
public OapAuditPlanController() : base() { OapChecklistClient = new OapChecklistClient(GetApiBaseUrl(), Client); OapHierarchyClient = new OapHierarchyClient(GetApiBaseUrl(), Client); }
private ObservableCollection <OapChecklist> GetOapChecklists() { return(OapChecklistClient.GetAllAsync(GetAllModelsCorp()).Result?.Result?.Data); }
public async Task <ActionResult> ChecklistsHelp() { var response = await OapChecklistClient.GetAllAsync(GetAllModelsCorp()); return(PartialView("OapChecklistsHelpPartial", response.Result.Data)); }
public OapChecklistsHelpController() : base() { OapChecklistClient = new OapChecklistClient(GetApiBaseUrl(), Client); }
public static bool HasActiveNoAnswerControl(this OapGenericCheckListFlatModel question, OapChecklistClient oapChecklistClient, int checklistId, int oapChecklistQuestionId) { var noAnswer = oapChecklistClient.GetFirstQuestionOpenNoAnswersAsync(checklistId, oapChecklistQuestionId).Result?.Result?.Data; return(noAnswer != null); }
public static bool ChecklistIsRelatedToPreviousNoAnswer(this OapGenericCheckListFlatModel question, OapChecklistClient oapChecklistClient, Guid rigOapChecklistId, int oapChecklistId, int oapChecklistQuestionId) { var noAnswer = oapChecklistClient.GetAllQuestionNoAnswersAsync(oapChecklistId, oapChecklistQuestionId).Result?.Result?.Data; return(noAnswer.Where(n => n.SourceRigOapChecklistId == rigOapChecklistId || n.ClosureRigOapChecklistId == rigOapChecklistId).Count() > 0); }
public async Task <ActionResult> Index() { var response = await OapChecklistClient.GetAllAsync(GetAllModelsCorp()); return(View("OapChecklist", response.Result.Data)); }