コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            AdvVB advVB = db.AdvVBs.Find(id);

            db.AdvVBs.Remove(advVB);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "Id,projectname,description,studentname")] AdvVB advVB)
 {
     if (ModelState.IsValid)
     {
         db.Entry(advVB).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(advVB));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "Id,projectname,description,studentname")] AdvVB advVB)
        {
            if (ModelState.IsValid)
            {
                db.AdvVBs.Add(advVB);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(advVB));
        }
コード例 #4
0
        // GET: AdvVBs/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AdvVB advVB = db.AdvVBs.Find(id);

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