Esempio n. 1
0
        public async Task <IActionResult> MessageSalaUsuario(string UserID, int SalaID, string UserName)
        {
            if (UserID != null && SalaID > 0)
            {
                chatTracebility = await chatTracebilityProvider.GetAllByUserSalaAsync(UserID, SalaID);

                ViewData["chatTracebility"] = chatTracebility;
                ViewData["UserName"]        = UserName;
                ViewData["UserID"]          = UserID;
            }

            return(View());
        }
        public async Task <IActionResult> GetAllByUserSalaAsync(string idusuarios, int?idsala)
        {
            if (String.IsNullOrEmpty(idusuarios) && idsala == null)
            {
                return(BadRequest());
            }

            var results = await chatTracebilityProvider.GetAllByUserSalaAsync(idusuarios, idsala);

            if (results != null)
            {
                return(Ok(results));
            }

            return(NotFound());
        }
Esempio n. 3
0
        private async Task GettingMessage()
        {
            try
            {
                // Obteniendo usuario de LocalStorage
                var us     = LocalStorage.Get <Usuario>("usuario");
                var salaID = LocalStorage.Get("salaID");

                // Obtener Mensaje en la sala
                messagesChat = await chatTracebilityProvider.GetAllByUserSalaAsync(us.UID, int.Parse($"{salaID}"));

                ViewData["messagesChat"] = messagesChat;
            }
            catch (Exception)
            {
                Console.WriteLine("Usuario no logeado");
            }
        }