コード例 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("wp_index,WebCamInterval,PredictionThreshold")] WebCamPredictSetting webCamPredictSetting)
        {
            if (id != webCamPredictSetting.wp_index)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(webCamPredictSetting);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!WebCamPredictSettingExists(webCamPredictSetting.wp_index))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(webCamPredictSetting));
        }
コード例 #2
0
        public async Task <IActionResult> Create([Bind("wp_index,WebCamInterval,PredictionThreshold")] WebCamPredictSetting webCamPredictSetting)
        {
            if (ModelState.IsValid)
            {
                _context.Add(webCamPredictSetting);
                await _context.SaveChangesAsync();

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