예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            HAPStockTable hAPStockTable = db.HAPStockTables.Find(id);

            db.HAPStockTables.Remove(hAPStockTable);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            HAPStockTable hAPStockTable = await db.HAPStockTables.FindAsync(id);

            db.HAPStockTables.Remove(hAPStockTable);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
예제 #3
0
 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));
 }
예제 #4
0
        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));
        }
예제 #5
0
        // 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));
        }
예제 #6
0
        // 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));
        }