示例#1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,TimeStamp,InsideOrOutside,Temp,AirHumidity,RiskForMold")] JoinTables joinTables)
        {
            if (id != joinTables.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(joinTables);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!JoinTablesExists(joinTables.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(joinTables));
        }
示例#2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,TimeStamp")] Date date)
        {
            if (id != date.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(date);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DateExists(date.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(date));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,InsideOrOutside,DateId")] Enviornment enviornment)
        {
            if (id != enviornment.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(enviornment);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EnviornmentExists(enviornment.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DateId"] = new SelectList(_context.Dates, "Id", "Id", enviornment.DateId);
            return(View(enviornment));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Temp,EnviornmentId")] Temperature temperature)
        {
            if (id != temperature.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(temperature);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TemperatureExists(temperature.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EnviornmentId"] = new SelectList(_context.Enviornments, "Id", "Id", temperature.EnviornmentId);
            return(View(temperature));
        }