public ObjectMakeCDResponse MakeCd(ObjectCDRequest request) { var thread = new Thread(() => { int newID = FabricaCDB.AddNewCDRequest(request); var client = new BackOfficeCallBackServiceClient(); var response = new BOCallBack.ObjectMakeCDResponse(); //response.id = newID; //response.refRequestCD = request.WSCallback; //response.userID = request.userid; //response.Status = "recebida a encomenda"; //client.GetStatus(response); Thread.Sleep(2000); response.id = newID; response.refRequestCD = request.WSCallback; response.userID = request.userid; response.Status = "Pronto a levantar"; response.fabrica = "fabrica c"; response.Distance = request.Distance; response.DeliveryAdress = request.DeliveryAdress; client.GetStatus(response); }); thread.Start(); return new ObjectMakeCDResponse(); }
public static int AddNewCDRequest(ObjectCDRequest request) { request.id = DbFabrica.Count + 1; DbFabrica.Add(request); return request.id; }