public async Task <IActionResult> Putquotes(long id, quotes quotes) { if (id != quotes.id) { return(BadRequest()); } _context.Entry(quotes).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!quotesExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <quotes> > Postquotes(quotes quotes) { _context.quotes.Add(quotes); await _context.SaveChangesAsync(); return(CreatedAtAction("Getquotes", new { id = quotes.id }, quotes)); }
static void Main(string[] args) { jerpBot.checkCreateBotStorage(); jerpBot.checkCreateBotDatabase(); logger logGeneral = new logger("log_general.txt"); botConfig tempConfig = new botConfig(); botConnection connConfig; if (tempConfig.loaded && tempConfig.configData.connections.Count > 0) { connConfig = tempConfig.configData.connections[0]; } else { return; } jerpBot botGeneral = new jerpBot(logGeneral, tempConfig); raffle raffleModule = new raffle(botGeneral); quotes quoteModule = new quotes(botGeneral); customCommand customCommandModule = new customCommand(botGeneral); gameCommand gameCommandModule = new gameCommand(botGeneral); counter counterModule = new counter(botGeneral); queueSystem queueModule = new queueSystem(botGeneral); autoShoutout shoutoutModule = new autoShoutout(botGeneral); lurkShoutout lurkShoutModule = new lurkShoutout(botGeneral); messageRoll rollModule = new messageRoll(botGeneral); pollManager pollModule = new pollManager(botGeneral); soundCommands soundManager = new soundCommands(botGeneral); commandAlias aliasManager = new commandAlias(botGeneral); trivia triviaManager = new trivia(botGeneral); hydrateReminder hydrateManager = new hydrateReminder(botGeneral); delaySender delaySendManager = new delaySender(botGeneral); hostMessages hostMessageModule = new hostMessages(botGeneral); streamProfiles streamProfileManager = new streamProfiles(botGeneral); predictionManager streamPredictionManager = new predictionManager(botGeneral); customCommandModule.initTable(); gameCommandModule.initTable(); aliasManager.initTable(); botGeneral.customCommandModule = customCommandModule; botGeneral.gameCommandModule = gameCommandModule; botGeneral.soundCommandModule = soundManager; botGeneral.aliasModule = aliasManager; while (!botGeneral.isReadyToClose) { botGeneral.frame(); } }
public IActionResult AddQuote(quotes newQuote) { if (ModelState.IsValid) { string query = $"INSERT INTO quotes(Name, Quote) VALUES('{newQuote.Name}', '{newQuote.Quote}')"; DbConnector.Execute(query); return(RedirectToAction("Quotes")); } else { return(RedirectToAction("Index")); } }