private static StartSerialResponse StartSerial(PushMessage message) { SerialInfo serialInfo = null; string user = null; string password = null; string equipment = null; string workarea = null; lock (_clientMessagesLock) { if (clients.ContainsKey(message.ClientUniqueID)) { var client = clients[message.ClientUniqueID]; user = client.UserName; password = client.Password; equipment = client.Equipment; workarea = client.WorkArea; if (client.Messages.ContainsKey(message.ServerMessageId)) { serialInfo = GetMessageData <SerialInfo>(client.Messages[message.ServerMessageId]); } } } if (user == null || password == null || serialInfo == null || workarea == null) { return new StartSerialResponse { Succeeded = false, Error = "Unknown Client or Serial" } } ; return(StartSerial(serialInfo, user, password, equipment, workarea)); }
private static StartSerialResponse StartSerial(SerialInfo serial, string user, string passsword, string equipment, string workarea) { IOTService service = GetOTService(); var request = new StartSerialRequest { Equipment = equipment, Operation = serial.Operation, SerialNumber = serial.SerialNumber, Password = passsword, OperationId = serial.OperationId, Order = serial.Order, ProductCode = serial.ProductCode, Status = serial.Status, User = user }; return(service.StartSerial(request)); }