Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            AspNetDurationType aspNetDurationType = db.AspNetDurationTypes.Find(id);

            db.AspNetDurationTypes.Remove(aspNetDurationType);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "Id,TypeName")] AspNetDurationType aspNetDurationType)
 {
     if (ModelState.IsValid)
     {
         db.Entry(aspNetDurationType).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(aspNetDurationType));
 }
Exemple #3
0
        public ActionResult Create([Bind(Include = "Id,TypeName")] AspNetDurationType aspNetDurationType)
        {
            if (ModelState.IsValid)
            {
                db.AspNetDurationTypes.Add(aspNetDurationType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(aspNetDurationType));
        }
Exemple #4
0
        // GET: AspNetDurationType/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AspNetDurationType aspNetDurationType = db.AspNetDurationTypes.Find(id);

            if (aspNetDurationType == null)
            {
                return(HttpNotFound());
            }
            return(View(aspNetDurationType));
        }
        public ActionResult DeleteCnfm(int id)
        {
            AspNetDurationType aspNetDurationType = db.AspNetDurationTypes.Find(id);

            try
            {
                db.AspNetDurationTypes.Remove(aspNetDurationType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            catch
            {
                ViewBag.Error = "It can't be deleted";
                return(View("Details", aspNetDurationType));
            }
        }