Ejemplo n.º 1
0
        public DesksController(DeskCheckContext context)
        {
            _context   = context;
            desksfpath = @".\DeskJsons\desks.json";
            using (StreamReader sr = new StreamReader(desksfpath))
            {
                string json = sr.ReadToEnd();
                desks = JsonConvert.DeserializeObject <List <Desk> >(json);
            }

            Random rng = new Random();

            foreach (Desk d in desks)
            {
                d.CO2  += rng.Next(-100, 100);
                d.temp += rng.Next(-5, 5);
                if (rng.Next(0, 100) < 80)
                {
                    d.available = false;
                }
            }
        }
Ejemplo n.º 2
0
 public UserController(DeskCheckContext context)
 {
     _context = context;
 }
Ejemplo n.º 3
0
 public MapsController(DeskCheckContext context)
 {
     _context = context;
 }