Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            MainKind mainKindModel = db.MainKindModels.Find(id);

            db.MainKindModels.Remove(mainKindModel);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "MainKindID,MainKindName")] MainKind mainKindModel)
 {
     if (ModelState.IsValid)
     {
         db.Entry(mainKindModel).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(mainKindModel));
 }
Ejemplo n.º 3
0
        public ActionResult Create([Bind(Include = "MainKindID,MainKindName")] MainKind mainKindModel)
        {
            if (ModelState.IsValid)
            {
                db.MainKindModels.Add(mainKindModel);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(mainKindModel));
        }
Ejemplo n.º 4
0
        // GET: MainKind/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MainKind mainKindModel = db.MainKindModels.Find(id);

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