Beispiel #1
0
        async Task <bool> EstadoBath()
        {
            var getEstado = await data.GetEstadoBath();

            var luz = getEstado.Where(x => x.Luz == 0 || x.Luz == 1).Select(y => y.Luz).FirstOrDefault();

            if (getEstado.Count == 0)
            {
                await data.AgregarEstadoBath();

                return(false);
            }
            else
            {
                if (luz == 1)
                {
                    btnBath.IsVisible = true;
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
        }
Beispiel #2
0
        async void EstadoBotonLuz()
        {
            var getEstado = await data.GetEstadoBath();

            var luz = getEstado.Where(x => x.Luz == 0 || x.Luz == 1).Select(y => y.Luz).FirstOrDefault();

            if (luz == 0)
            {
                colorButton.CambiarColorOFF(btnLuz);
                estadoLogicaLuz = 0;
            }
            else
            {
                colorButton.CambiarColorLucesON(btnLuz);
                estadoLogicaLuz = 1;
            }
        }