// DEPRECATION WARNING!!! THIS WILL BE REMOVED IN A LATER VERSION #endregion #region _caseNotFound private void _caseNoFound(object sender, EventArgs args) { Note_Dto trigger = (Note_Dto)sender; if (File.Exists(GetServiceLocation() + "input\\inboundPath.txt")) { string newPath = inboundPath.Replace("inbound", "outbound"); newPath += "\\" + trigger.MicrotingUId + "_" + trigger.Activity + ".txt"; File.WriteAllText(newPath, trigger.Activity); } }
private static void Core_HandleNotificationNotFound(object sender, EventArgs e) { Note_Dto noteDto = (Note_Dto)sender; Packer packer = new Packer(); String jsonNoteDto = packer.PackNoteDto(noteDto); IntPtr ptr = (IntPtr)notificationNotFoundCallbackPointer; NotificationNotFoundCallback notificationNotFoundCallbackMethod = (NotificationNotFoundCallback)Marshal.GetDelegateForFunctionPointer(ptr, typeof(NotificationNotFoundCallback)); notificationNotFoundCallbackMethod(jsonNoteDto); }
#pragma warning disable 1998 public async Task Handle(EformCompleted message) { try { CheckStatusByMicrotingUid(message.MicrotringUUID); sqlController.NotificationUpdate(message.NotificationUId, message.MicrotringUUID, Constants.WorkflowStates.Processed, "", ""); } catch (Exception ex) { sqlController.NotificationUpdate(message.NotificationUId, message.MicrotringUUID, Constants.WorkflowStates.NotFound, ex.Message, ex.StackTrace.ToString()); Note_Dto note_Dto = new Note_Dto(message.NotificationUId, message.MicrotringUUID, Constants.WorkflowStates.NotFound); core.FireHandleNotificationNotFound(note_Dto); } }
#pragma warning disable 1998 public async Task Handle(EformRetrieved message) { try { sqlController.CaseUpdateRetrived(message.MicrotringUUID); sqlController.NotificationUpdate(message.notificationUId, message.MicrotringUUID, Constants.WorkflowStates.Processed, "", ""); Case_Dto cDto = sqlController.CaseReadByMUId(message.MicrotringUUID); log.LogStandard(t.GetMethodName("EformRetrievedHandler"), cDto.ToString() + " has been retrived"); core.FireHandleCaseRetrived(cDto); } catch (Exception ex) { sqlController.NotificationUpdate(message.notificationUId, message.MicrotringUUID, Constants.WorkflowStates.NotFound, ex.Message, ex.StackTrace.ToString()); Note_Dto note_Dto = new Note_Dto(message.notificationUId, message.MicrotringUUID, Constants.WorkflowStates.NotFound); core.FireHandleNotificationNotFound(note_Dto); } }
#pragma warning disable 1998 public async Task Handle(UnitActivated message) { try { Unit_Dto unitDto = sqlController.UnitRead(int.Parse(message.MicrotringUUID)); sqlController.UnitUpdate(unitDto.UnitUId, unitDto.CustomerNo, 0, unitDto.SiteUId); sqlController.NotificationUpdate(message.notificationUId, message.MicrotringUUID, Constants.WorkflowStates.Processed, "", ""); log.LogStandard(t.GetMethodName("UnitActivatedHandler"), "Unit with id " + message.MicrotringUUID + " has been activated"); Note_Dto note_Dto = new Note_Dto(message.notificationUId, message.MicrotringUUID, Constants.WorkflowStates.Processed); core.FireHandleSiteActivated(note_Dto); } catch (Exception ex) { sqlController.NotificationUpdate(message.notificationUId, message.MicrotringUUID, Constants.WorkflowStates.NotFound, ex.Message, ex.StackTrace.ToString()); Note_Dto note_Dto = new Note_Dto(message.notificationUId, message.MicrotringUUID, Constants.WorkflowStates.NotFound); core.FireHandleNotificationNotFound(note_Dto); } }
public void SQL_Notification_NotificationReadFirst_DoesReturnFirstNotification() { // Arrance var notificationId1 = Guid.NewGuid().ToString(); var microtingUId1 = Guid.NewGuid().ToString(); var notificationId2 = Guid.NewGuid().ToString(); var microtingUId2 = Guid.NewGuid().ToString(); // Act sut.NotificationCreate(notificationId1, microtingUId1, Constants.Notifications.Completed); sut.NotificationCreate(notificationId2, microtingUId2, Constants.Notifications.Completed); // Assert Note_Dto notification = sut.NotificationReadFirst(); Assert.NotNull(notification); Assert.AreEqual(2, DbContext.notifications.Count()); Assert.AreEqual(Constants.Notifications.Completed, notification.Activity); Assert.AreEqual(microtingUId1, notification.MicrotingUId); }
public string PackNoteDto(Note_Dto noteDto) { return(JObject.FromObject(noteDto).ToString()); }
private void _caseNoFound(object sender, EventArgs args) { Note_Dto trigger = (Note_Dto)sender; }