Advertisement
Guest User

Untitled

a guest
Mar 31st, 2015
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Runtime.Serialization;
  5. using System.ServiceModel;
  6. using System.Text;
  7. using System.Messaging;
  8. using WcfTLlevo.Modelo;
  9.  
  10. namespace WcfTLlevo
  11. {
  12. // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in code, svc and config file together.
  13. public class Service1 : IService1
  14. {
  15. private BLTaxi bl = null;
  16.  
  17. public Service1()
  18. {
  19. bl = new BLTaxi();
  20. }
  21.  
  22. public Carrera ConsultarCarrera()
  23. {
  24. return bl.ConsultarCarrera();
  25. }
  26.  
  27. public void RegistrarCarrera(Carrera opcion)
  28. {
  29. string rutaCola = @".\private$\jromero";
  30. MessageQueue cola = null;
  31. if (!MessageQueue.Exists(rutaCola))
  32. {
  33. MessageQueue.Create(rutaCola);
  34. cola = new MessageQueue(rutaCola);
  35.  
  36. }
  37. else
  38. cola = new MessageQueue(rutaCola);
  39.  
  40. MessageQueue queue = new MessageQueue(rutaCola);
  41. int cantidad = queue.GetAllMessages().Length + 1;
  42. Message mensaje = new Message();
  43. mensaje.Label = "Carrera Nro. " + cantidad.ToString();
  44. mensaje.Body = opcion.DNI;
  45. cola.Send(mensaje);
  46.  
  47. bl.RegistrarCarrera(opcion);
  48. }
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement