public ActionResult UpdateCurrentEqpmt(tbl_eqpmt_kits_current currentEqpmtUpdate) { db.Database.ExecuteSqlCommand("UPDATE cmps411.tbl_eqpmt_kits_current SET machineID={0},kitID={1} WHERE id={2}", currentEqpmtUpdate.machineID, currentEqpmtUpdate.kitID, currentEqpmtUpdate.id); return(new EmptyResult()); }
public ActionResult AddCurrentEqpmt(tbl_eqpmt_kits_current currentEqpmtAdd) { db.Database.ExecuteSqlCommand("Insert into cmps411.tbl_eqpmt_kits_current Values({0},{1})", currentEqpmtAdd.machineID, currentEqpmtAdd.kitID); return(RedirectToAction("Index")); }
public ActionResult DeleteCurrentEqpmt(tbl_eqpmt_kits_current currentEqpmtDelete) { tbl_eqpmt_kits_current tbl_eqpmt_kits_current = db.tbl_eqpmt_kits_current.Find(currentEqpmtDelete.id); db.tbl_eqpmt_kits_current.Remove(tbl_eqpmt_kits_current); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult UpdateCurrentEqpmt(tbl_eqpmt_kits_current currentEqpmtUpdate) { using (allpax_sale_minerEntities entities = new allpax_sale_minerEntities()) { tbl_eqpmt_kits_current UpdateCurrentEqpmt = (from c in entities.tbl_eqpmt_kits_current where c.id == currentEqpmtUpdate.id select c).FirstOrDefault(); UpdateCurrentEqpmt.machineID = currentEqpmtUpdate.machineID; UpdateCurrentEqpmt.kitID = currentEqpmtUpdate.kitID; entities.SaveChanges(); } return(new EmptyResult()); }
public ActionResult AddCurrentEqpmt(tbl_eqpmt_kits_current currentEqpmtAdd) { using (allpax_sale_minerEntities entities = new allpax_sale_minerEntities()) { entities.tbl_eqpmt_kits_current.Add(new tbl_eqpmt_kits_current { machineID = currentEqpmtAdd.machineID, kitID = currentEqpmtAdd.kitID }); entities.SaveChanges(); } return(RedirectToAction("Index")); }
//public ActionResult DeleteCurrentEqpmt(tbl_eqpmt_kits_current currentEqpmtDelete) //{ // db.Database.ExecuteSqlCommand("DELETE FROM cmps411.tbl_eqpmt_kits_current WHERE id=({0})", currentEqpmtDelete.id); // return RedirectToAction("Index"); //} public ActionResult DeleteCurrentEqpmt(tbl_eqpmt_kits_current currentEqpmtDelete) { db.Database.ExecuteSqlCommand("DELETE FROM cmps411.tbl_eqpmt_kits_current WHERE machineID=({0}) AND " + "kitID=({1})", currentEqpmtDelete.machineID, currentEqpmtDelete.kitID); return(RedirectToAction("Index")); }