public ActionResult DeleteConfirmed(string id) { tbl_common_mtrl tbl_common_mtrl = db.tbl_common_mtrl.Find(id); db.tbl_common_mtrl.Remove(tbl_common_mtrl); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult DeleteMaterial(tbl_common_mtrl materialDelete) { //tbl_common_mtrl tbl_common_mtrl = db.tbl_common_mtrl.Find(materialDelete.id); tbl_common_mtrl tbl_common_mtrl = db.tbl_common_mtrl.Find(materialDelete.type, materialDelete.subtype); db.tbl_common_mtrl.Remove(tbl_common_mtrl); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,type,subtype")] tbl_common_mtrl tbl_common_mtrl) { if (ModelState.IsValid) { db.Entry(tbl_common_mtrl).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tbl_common_mtrl)); }
public ActionResult Create([Bind(Include = "id,type,subtype")] tbl_common_mtrl tbl_common_mtrl) { if (ModelState.IsValid) { db.tbl_common_mtrl.Add(tbl_common_mtrl); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tbl_common_mtrl)); }
// GET: Material/Edit/5 public ActionResult Edit(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tbl_common_mtrl tbl_common_mtrl = db.tbl_common_mtrl.Find(id); if (tbl_common_mtrl == null) { return(HttpNotFound()); } return(View(tbl_common_mtrl)); }
public ActionResult AddMaterial(tbl_common_mtrl materialAdd) { using (annorum_supra_cmps411Entities entities = new annorum_supra_cmps411Entities()) { entities.tbl_common_mtrl.Add(new tbl_common_mtrl { type = materialAdd.type, subtype = materialAdd.subtype, }); entities.SaveChanges(); } return(new EmptyResult()); }