コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            RestSharpTable restSharpTable = db.RestSharpTables.Find(id);

            db.RestSharpTables.Remove(restSharpTable);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            RestSharpTable restSharpTable = await db.RestSharpTables.FindAsync(id);

            db.RestSharpTables.Remove(restSharpTable);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
コード例 #3
0
 public ActionResult Edit([Bind(Include = "Id,TimeScraped,Symbol,LastPrice,Change,ChangePercent")] RestSharpTable restSharpTable)
 {
     if (ModelState.IsValid)
     {
         db.Entry(restSharpTable).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(restSharpTable));
 }
コード例 #4
0
        public ActionResult Create([Bind(Include = "Id,TimeScraped,Symbol,LastPrice,Change,ChangePercent")] RestSharpTable restSharpTable)
        {
            if (ModelState.IsValid)
            {
                db.RestSharpTables.Add(restSharpTable);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(restSharpTable));
        }
コード例 #5
0
        // GET: RestSharpTables/Delete/5
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            RestSharpTable restSharpTable = await db.RestSharpTables.FindAsync(id);

            if (restSharpTable == null)
            {
                return(HttpNotFound());
            }
            return(View(restSharpTable));
        }
コード例 #6
0
        // GET: RestSharpTables/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            RestSharpTable restSharpTable = db.RestSharpTables.Find(id);

            if (restSharpTable == null)
            {
                return(HttpNotFound());
            }
            return(View(restSharpTable));
        }