Example #1
0
        public void NotificarCambioEnLosDatos(DAOIngresoDetalleExamen dao)
        {
            TipoMensaje tipoMensaje = TipoMensaje.GetTipoMensajeFromString(dao.opcion);
            String      mensaje     = tipoMensaje.actualizarDatos(datos, dao, esperandoRespuesta);

            actualizarConteo();
            notificadorUI.NotificarCambiosEnDatos(mensaje);
            esperandoRespuesta = false;
        }
Example #2
0
 public override String actualizarDatos(List <IngresoDetalleExamen> datos,
                                        DAOIngresoDetalleExamen dao, Boolean enEspera)
 {
     datos.Add(dao.ingresoDetalleExamen);
     if (enEspera)
     {
         return("Registro agregado de forma exitosa");
     }
     else
     {
         return(CAMBIO_EXTERNO);
     }
 }
Example #3
0
 public override String actualizarDatos(List <IngresoDetalleExamen> datos,
                                        DAOIngresoDetalleExamen dao, Boolean enEspera)
 {
     datos.Remove(dao.ingresoDetalleExamen);
     if (enEspera)
     {
         return("Eliminacion realizada de forma exitosa");
     }
     else
     {
         return(CAMBIO_EXTERNO);
     }
 }
        public void enviarMensaje(DAOIngresoDetalleExamen ide)
        {
            String mensajeResultante = JsonConvert.SerializeObject(ide);

            if (webSocket.IsAlive)
            {
                webSocket.Send(mensajeResultante);
            }
            else
            {
                notificador.NotificarErrorEnConexion();
            }
        }
Example #5
0
 public void EnviarMensaje(IngresoDetalleExamen ide)
 {
     if (tipoMensajeSeleccionado != null)
     {
         DAOIngresoDetalleExamen dao = new DAOIngresoDetalleExamen();
         dao.ingresoDetalleExamen = ide;
         dao.opcion = tipoMensajeSeleccionado.getAccion();
         webSocket.enviarMensaje(dao);
         esperandoRespuesta = true;
     }
     else
     {
         throw new ApplicationException("Intentas que envie un mensaje cuando no he resgitrado accion alguna");
     }
 }
 private void manejarOnMessaje(object sender, MessageEventArgs e)
 {
     timer.Stop();
     if (seSerializaALista(e.Data))
     {
         List <IngresoDetalleExamen> lista = desserializarListaIngresoDetalleExamen(e.Data);
         notificador.NotificarConexionAbierta(lista);
     }
     else if (seSerializaANotificacion(e.Data))
     {
         DAOIngresoDetalleExamen dao = deserializarDAOIngresoDetalle(e.Data);
         notificador.NotificarCambioEnLosDatos(dao);
     }
     else
     {
         throw new ApplicationException("Se me ha enviado un tipo de respuesta no esperada");
     }
 }
Example #7
0
            public override String actualizarDatos(List <IngresoDetalleExamen> datos,
                                                   DAOIngresoDetalleExamen dao, Boolean enEspera)
            {
                int index = datos.IndexOf(dao.ingresoDetalleExamen);

                if (index != -1)
                {
                    datos[index] = dao.ingresoDetalleExamen;
                    if (enEspera)
                    {
                        return("Modificacion realizada de forma exitosa");
                    }
                    else
                    {
                        return(CAMBIO_EXTERNO);
                    }
                }
                else
                {
                    throw new ApplicationException("Me pides substituir un elemento que no existe...");
                }
            }
Example #8
0
 public abstract String actualizarDatos(List <IngresoDetalleExamen> datos,
                                        DAOIngresoDetalleExamen dao, Boolean enEspera);