public static Dictionary <string, string> RegisterTeam(string teamName) { HL7Client client = new HL7Client(); client.Connect(); Dictionary <string, string> teamInfo = registerTeam(client, teamName); client.Disconnect(); return(teamInfo); }
public static bool UnregisterTeam(string teamName, int teamID) { HL7Client client = new HL7Client(); client.Connect(); bool success = unregisterTeam(client, teamName, teamID); client.Disconnect(); return(success); }
public static Dictionary <string, string> QueryService(Dictionary <string, string> teamInfo) { Dictionary <string, string> serviceInfo = null; HL7Client client = new HL7Client(); client.Connect(); serviceInfo = queryService(client, teamInfo["Name"], teamInfo["ID"], "GIORP-TOTAL"); client.Disconnect(); return(serviceInfo); }
public static Dictionary <string, string> ExecuteService(float purchaseSubtotal, string province) { Dictionary <string, string> serviceInfo = null; string ipBuf = Shared.Messages.QueryService.GetServerIP(); IPAddress ipAddress; bool ipParseSuccess = IPAddress.TryParse(ipBuf, out ipAddress); if (ipParseSuccess) { HL7Client client = new HL7Client(ipAddress, Convert.ToInt32(Shared.Messages.QueryService.GetPort())); client.Connect(); int numArgs = 2; string[] argPosition = Shared.Messages.QueryService.GetArgPositions(); string[] argName = Shared.Messages.QueryService.GetArgName(); string[] argDataType = Shared.Messages.QueryService.GetArgDataType(); string[] argValue = new string[numArgs]; if (argName[0].ToLower() == "region") { argValue[1] = purchaseSubtotal.ToString(); argValue[0] = province; } else { argValue[0] = purchaseSubtotal.ToString(); argValue[1] = province; } serviceInfo = executeService(client, teamInfo["Name"], teamInfo["ID"], "GIORP-TOTAL", numArgs.ToString(), argPosition, argName, argDataType, argValue); client.Disconnect(); } else { Logger.LogMessage("(Comms:ExecuteService) Unable to parse service IP: ", ipBuf); } return(serviceInfo); }