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

            db.tblCollections.Remove(tblCollection);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit2([Bind(Include = "CollectionID,CollectionName,CollectionDiscription,Status,StatusBeschrijving")] tblCollection tblCollection)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tblCollection).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tblCollection));
 }
コード例 #3
0
 public ActionResult Edit([Bind(Include = "CollectionID,CollectionName,CollectionDiscription")] tblCollection tblCollection)
 {
     tblCollection.Status = "Te Accorderen wijziging";
     if (ModelState.IsValid)
     {
         db.Entry(tblCollection).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tblCollection));
 }
コード例 #4
0
        public ActionResult Create([Bind(Include = "CollectionID,CollectionName,CollectionDiscription")] tblCollection tblCollection)
        {
            tblCollection.Status = "Te Accorderen creatie";
            if (ModelState.IsValid)
            {
                db.tblCollections.Add(tblCollection);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tblCollection));
        }
コード例 #5
0
        public ActionResult Edit2(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tblCollection tblCollection = db.tblCollections.Find(id);

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