public ActionResult DeleteConfirmed(int id) { HAPStockTable hAPStockTable = db.HAPStockTables.Find(id); db.HAPStockTables.Remove(hAPStockTable); db.SaveChanges(); return(RedirectToAction("Index")); }
public async Task <ActionResult> DeleteConfirmed(int id) { HAPStockTable hAPStockTable = await db.HAPStockTables.FindAsync(id); db.HAPStockTables.Remove(hAPStockTable); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Time_Scraped,Stock_Symbol,Last_Price,Change,Change_Percent")] HAPStockTable hAPStockTable) { if (ModelState.IsValid) { db.Entry(hAPStockTable).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(hAPStockTable)); }
public ActionResult Create([Bind(Include = "Id,Time_Scraped,Stock_Symbol,Last_Price,Change,Change_Percent")] HAPStockTable hAPStockTable) { if (ModelState.IsValid) { db.HAPStockTables.Add(hAPStockTable); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(hAPStockTable)); }
// GET: HAPStockTables/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } HAPStockTable hAPStockTable = db.HAPStockTables.Find(id); if (hAPStockTable == null) { return(HttpNotFound()); } return(View(hAPStockTable)); }
// GET: HAPStockTables/Edit/5 public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } HAPStockTable hAPStockTable = await db.HAPStockTables.FindAsync(id); if (hAPStockTable == null) { return(HttpNotFound()); } return(View(hAPStockTable)); }