Exemple #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,StartDay,TimeOccur,DayOccur,FrequencyOccur")] BotSchedule botSchedule)
        {
            if (id != botSchedule.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(botSchedule);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BotScheduleExists(botSchedule.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(botSchedule));
        }
Exemple #2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Question,BotScheduleId")] BotQuestions botQuestions)
        {
            if (id != botQuestions.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(botQuestions);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BotQuestionsExists(botQuestions.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(botQuestions));
        }