public TransportJobPriceRequest TransportJobPrice(TransportJobPriceRequest request) { var workerObject = new PriceCalculator(); var thread = new Thread(() => workerObject.PriceCalc(request)); thread.Start(); return new TransportJobPriceRequest(); }
public void PriceCalc(TransportJobPriceRequest request) { double d = 0; double result; try { d = Convert.ToDouble(request.Distance); } catch (Exception) { d = 0; } result = (d * 0.26 / 1000); var client = new BackOfficeCallBackServiceClient(); var response = new VinilBackoffice.TransportJobPriceResponse(); response.encomendaID = request.encomendaID; response.fabricante = request.fabrica; response.refRequestPrice = request.WSCallback; response.Price = result; response.userID = request.userID; client.GetTransporterPrice(response); }