コード例 #1
0
        public ActionResult DeleteConfirmed(Guid id)
        {
            Specializ specializ = db.Specializ.Find(id);

            db.Specializ.Remove(specializ);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "ID,Specialization")] Specializ specializ)
 {
     if (ModelState.IsValid)
     {
         db.Entry(specializ).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(specializ));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "ID,Specialization")] Specializ specializ)
        {
            if (ModelState.IsValid)
            {
                specializ.ID = Guid.NewGuid();
                db.Specializ.Add(specializ);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

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

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