public IActionResult Update(long id, columns column)
        {
            var col = _context.columns.Find(id);

            if (col == null)
            {
                return(NotFound());
            }

            col.Status = column.Status;

            _context.columns.Update(col);
            _context.SaveChanges();
            var json = new JObject();

            json["New Status"] = column.Status;
            json["message"]    = "The Status of the Column Id: " + col.id + " has been changed to: " + col.Status;
            return(Content(json.ToString(), "application/json"));
        }
Example #2
0
        public IActionResult Update(long id, batteries battery)
        {
            var bat = _context.batteries.Find(id);

            if (bat == null)
            {
                return(NotFound());
            }

            bat.Status = battery.Status;

            _context.batteries.Update(bat);
            _context.SaveChanges();
            var json = new JObject();

            json["New Status"] = battery.Status;
            json["message"]    = "The Status of the Battery Id: " + bat.id + " has been changed to: " + bat.Status;
            return(Content(json.ToString(), "application/json"));
        }
Example #3
0
        public IActionResult Update(long id, elevators elevator)
        {
            var elev = _context.elevators.Find(id);

            if (elev == null)
            {
                return(NotFound());
            }

            elev.Status = elevator.Status;

            _context.elevators.Update(elev);
            _context.SaveChanges();
            var json = new JObject();

            json["New Status"] = elevator.Status;
            json["message"]    = "The Status of the Elevator Id: " + elev.id + " has been changed to: " + elev.Status;
            return(Content(json.ToString(), "application/json"));
        }