public ActionResult UpdateEqpmt(tbl_eqpmt_type eqpmtUpdate) { db.Database.ExecuteSqlCommand("UPDATE cmps411.tbl_eqpmt_type SET eqpmtType={0},model={1},description={2} WHERE id={3}", eqpmtUpdate.eqpmtType, eqpmtUpdate.model, eqpmtUpdate.description, eqpmtUpdate.id); return(new EmptyResult()); }
public ActionResult AddEqpmt(tbl_eqpmt_type eqpmtAdd) { db.Database.ExecuteSqlCommand("Insert into cmps411.tbl_eqpmt_type Values({0},{1},{2})", eqpmtAdd.eqpmtType, eqpmtAdd.model, eqpmtAdd.description); return(RedirectToAction("Index")); }
public ActionResult DeleteEqpmt(tbl_eqpmt_type eqpmtDelete) { tbl_eqpmt_type tbl_eqpmt_type = db.tbl_eqpmt_type.Find(eqpmtDelete.id); db.tbl_eqpmt_type.Remove(tbl_eqpmt_type); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult UpdateEqpmt(tbl_eqpmt_type eqpmtUpdate) { using (allpax_sale_minerEntities entities = new allpax_sale_minerEntities()) { tbl_eqpmt_type updatedEqpmt = (from c in entities.tbl_eqpmt_type where c.id == eqpmtUpdate.id select c).FirstOrDefault(); updatedEqpmt.eqpmtType = eqpmtUpdate.eqpmtType; updatedEqpmt.model = eqpmtUpdate.model; updatedEqpmt.description = eqpmtUpdate.description; entities.SaveChanges(); } return(new EmptyResult()); }
public ActionResult AddEqpmt(tbl_eqpmt_type eqpmtAdd) { using (allpax_sale_minerEntities entities = new allpax_sale_minerEntities()) { entities.tbl_eqpmt_type.Add(new tbl_eqpmt_type { eqpmtType = eqpmtAdd.eqpmtType, model = eqpmtAdd.model, description = eqpmtAdd.description }); entities.SaveChanges(); } return(RedirectToAction("Index")); }
public ActionResult DeleteEqpmt(tbl_eqpmt_type eqpmtDelete) { db.Database.ExecuteSqlCommand("DELETE FROM cmps411.tbl_eqpmt_type WHERE id=({0})", eqpmtDelete.id); return(RedirectToAction("Index")); }