public string SendReceiveEmission(string message, int showCommand, int showResponse, int millisecondsTimeout) { CommandsAPI.ValidateMarkups = false; defaultmillisecondsTimeout = millisecondsTimeout; currentmsg = message; myresult = string.Empty; message = CustomFunction.convertToSabreChars(message); MySabreAPI.sendCommandToHost2(ref message, showCommand, showResponse); cbCustom.Invoke(0, string.Empty); string finalresult = string.Empty; while (!isfinish) { if (frmMain.getApiStateFromEvents().Equals(frmMain.API_UNAVAILABLE)) { isfinish = true; } else { if (counter > timeAPIResponse) { isfinish = true; } else { System.Threading.Thread.Sleep(defaultmillisecondsTimeout); counter++; } } } counter = 1; IsFinish(true); if (myresult.Contains("PREVIOUS ENTRY ACTIVE-PLEASE WAIT FOR RESPONSE")) { IsFinish(true); } Components.CommandsAPILog.WriteCommandIntoFile(string.Concat(sabreCommand, "|", myresult)); CommandsAPI.ValidateMarkups = true; if (string.IsNullOrEmpty(myresult)) { myresult = "NOTHING"; } return(myresult); }
public string SendReceiveProfile(string message, int showCommand, int showResponse, bool showAllContent) { ValidateMarkups = false; currentmsg = message; singleMessage = string.Empty; message = CustomFunction.convertToSabreCharsProfile(message); MySabreAPI.sendCommandToHost2(ref message, showCommand, showResponse); cbCustom.Invoke(0, string.Empty); string finalresult = string.Empty; while (!isfinish) { if (frmMain.getApiStateFromEvents().Equals(frmMain.API_UNAVAILABLE)) { isfinish = true; } else { if (counter > timeAPIResponse) { isfinish = true; } else { System.Threading.Thread.Sleep(500); counter++; } } } counter = 1; IsFinish(true); Components.CommandsAPILog.WriteCommandIntoFile(string.Concat(sabreCommand, " -APP")); ValidateMarkups = true; if (string.IsNullOrEmpty(singleMessage)) { singleMessage = "NOTHING"; } return((showAllContent) ? allMessage : singleMessage); }