Exemplo n.º 1
0
 public ActionResult DeleteConfirmed(int id)
 {
     SCML.Models.Type type = db.Types.Find(id);
     db.Types.Remove(type);
     db.SaveChanges();
     this.AddToastMessage("Success!", "Successfully Deleted.", ToastType.Success);
     return(RedirectToAction("Index"));
 }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "id,name")] SCML.Models.Type type)
 {
     if (ModelState.IsValid)
     {
         db.Entry(type).State = EntityState.Modified;
         db.SaveChanges();
         this.AddToastMessage("Success!", "Successfully Edited.", ToastType.Success);
         return(RedirectToAction("Index"));
     }
     return(View(type));
 }
Exemplo n.º 3
0
        public ActionResult Create([Bind(Include = "id,name")] SCML.Models.Type type)
        {
            if (ModelState.IsValid)
            {
                db.Types.Add(type);
                db.SaveChanges();
                this.AddToastMessage("Success!", "Successfully Saved.", ToastType.Success);
                return(RedirectToAction("Index"));
            }

            return(View(type));
        }
Exemplo n.º 4
0
 public ActionResult Edit(int?id)
 {
     if (id == null)
     {
         return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
     }
     SCML.Models.Type type = db.Types.Find(id);
     if (type == null)
     {
         return(HttpNotFound());
     }
     return(View(type));
 }