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)); }
public async Task <IActionResult> PutBotQuestions(int id, BotQuestions botQuestions) { if (id != botQuestions.Id) { return(BadRequest()); } _context.Entry(botQuestions).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BotQuestionsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> Create(BotQuestions botQuestions) { if (ModelState.IsValid) { _context.Add(botQuestions); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(botQuestions)); }