Exemple #1
0
        public void SaveDoorState(bool opened)
        {
            using (Connection context = new Connection())
            {
                FridgeControls frControl = context.FridgeControls.Where(w => w.IdControl == "DoorOpened").FirstOrDefault();

                if (frControl != null)
                {
                    frControl.Value = opened.ToString();
                }

                context.SaveChanges();
            }
        }
Exemple #2
0
        public void SaveTemperature(int temperature)
        {
            using (Connection context = new Connection())
            {
                FridgeControls frControl = context.FridgeControls.Where(w => w.IdControl == "Temperature").FirstOrDefault();

                if (frControl != null)
                {
                    frControl.Value = temperature.ToString();
                }

                context.SaveChanges();
            }
        }