Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Runtime.Serialization;
- using System.ServiceModel;
- using System.Text;
- using System.Messaging;
- using WcfTLlevo.Modelo;
- namespace WcfTLlevo
- {
- // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in code, svc and config file together.
- public class Service1 : IService1
- {
- private BLTaxi bl = null;
- public Service1()
- {
- bl = new BLTaxi();
- }
- public Carrera ConsultarCarrera()
- {
- return bl.ConsultarCarrera();
- }
- public void RegistrarCarrera(Carrera opcion)
- {
- string rutaCola = @".\private$\jromero";
- MessageQueue cola = null;
- if (!MessageQueue.Exists(rutaCola))
- {
- MessageQueue.Create(rutaCola);
- cola = new MessageQueue(rutaCola);
- }
- else
- cola = new MessageQueue(rutaCola);
- MessageQueue queue = new MessageQueue(rutaCola);
- int cantidad = queue.GetAllMessages().Length + 1;
- Message mensaje = new Message();
- mensaje.Label = "Carrera Nro. " + cantidad.ToString();
- mensaje.Body = opcion.DNI;
- cola.Send(mensaje);
- bl.RegistrarCarrera(opcion);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement