コード例 #1
0
        public async Task <IActionResult> Create([Bind("ID,SensorType,SensorID,Value,TimeStamp")] SensorValue sensorValue)
        {
            if (ModelState.IsValid)
            {
                _context.Add(sensorValue);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(sensorValue));
        }
コード例 #2
0
        public async Task <IActionResult> Create([Bind("ID,SensorID,ErrorType,Message,TimeStamp")] Error error)
        {
            if (ModelState.IsValid)
            {
                _context.Add(error);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(error));
        }
コード例 #3
0
        public async Task <IActionResult> Create([Bind("ID,Name,ActionThreshold")] Sensor sensor)
        {
            if (ModelState.IsValid)
            {
                _context.Add(sensor);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(sensor));
        }
コード例 #4
0
        public async Task <IActionResult> Create([Bind("ID,SensorID,NotificationType,Message,TimeStamp")] NotificationEntry notificationEntry)
        {
            if (ModelState.IsValid)
            {
                _context.Add(notificationEntry);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(notificationEntry));
        }