Beispiel #1
0
        private void EnviarReporte(LogMensaje log)
        {
            var            queue         = GetMailReportMsmq();
            IReportCommand reportCommand = null;
            var            reportId      = DaoFactory.ProgramacionReporteDAO.GetReportIdByReportName("MANUAL");

            switch (log.Accion.Reporte)
            {
            case ProgramacionReporte.Reportes.EstadoEntregas:
                //var vehicles = new List<int> {log.Viaje.Vehiculo.Id};
                //reportCommand = ReportService.CreateDeliverStatusReportCommand(reportId, log.Viaje.Empresa.Id, -1, log.Accion.DestinatariosMailReporte,
                //   log.Fecha, log.Viaje.InicioReal.Value, vehicles);

                reportCommand = new DeliverStatusReportCommand
                {
                    ReportId    = reportId, //log.Id,
                    CustomerId  = log.Viaje.Empresa.Id,
                    Email       = log.Accion.DestinatariosMailReporte,
                    FinalDate   = log.Fecha,
                    InitialDate = log.Viaje.InicioReal.Value,
                    VehiclesId  = new List <int> {
                        log.Viaje.Vehiculo.Id
                    },
                    ReportName = log.Viaje.Codigo
                };
                break;

            default:
                break;
            }

            if (queue == null)
            {
                throw new ApplicationException("No se pudo acceder a la cola");
            }
            if (reportCommand != null)
            {
                queue.Send(reportCommand);
            }
        }
Beispiel #2
0
 public ReportRepository(IReportCommand command, ICidadaoCommand cidadaocommand)
 {
     _command        = command;
     _cidadaocommand = cidadaocommand;
 }
Beispiel #3
0
 public void HandleMessage(IReportCommand command)
 {
     Logger.WarnFormat("Does not exist a report generator implementation for {0}", command.GetType());
 }