public ActionResult Index() { annorum_supra_cmps411Entities entities = new annorum_supra_cmps411Entities(); List <tbl_common_mtrl> material = entities.tbl_common_mtrl.ToList(); //ViewBag.eventType = new SelectList(db.tbl_event_type, "eventType", "eventType"); //ViewBag.customerCode = new SelectList(db.tbl_customers, "customerCode", "customerCode"); return(View(material.ToList())); }
// GET: material public ActionResult Index() { annorum_supra_cmps411Entities entities = new annorum_supra_cmps411Entities(); List <tbl_common_mtrl> material = entities.tbl_common_mtrl.ToList(); ViewBag.type = new SelectList(db.tbl_common_mtrl, "type", "type"); ViewBag.subtype = new SelectList(db.tbl_common_mtrl, "subtype", "subtype"); return(View(db.tbl_common_mtrl.ToList())); }
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()); }