public ActionResult UpdateCustEqpmt(tbl_customer_eqpmt custEqpmtUpdate) { db.Database.ExecuteSqlCommand("UPDATE cmps411.tbl_customer_eqpmt SET customerCode={1},machineID={2}, jobNum={3}, eqpmtType={4}, model={5} WHERE id={0}", custEqpmtUpdate.id, custEqpmtUpdate.customerCode, custEqpmtUpdate.machineID, custEqpmtUpdate.jobNum, custEqpmtUpdate.eqpmtType, custEqpmtUpdate.model); return(new EmptyResult()); }
public ActionResult DeleteCustEqpmt(tbl_customer_eqpmt custEqpmtDelete) { tbl_customer_eqpmt tbl_customer_eqpmt = db.tbl_customer_eqpmt.Find(custEqpmtDelete.id); db.tbl_customer_eqpmt.Remove(tbl_customer_eqpmt); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult DeleteConfirmed(string id) { tbl_customer_eqpmt tbl_customer_eqpmt = db.tbl_customer_eqpmt.Find(id); db.tbl_customer_eqpmt.Remove(tbl_customer_eqpmt); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult AddCustEqpmt(tbl_customer_eqpmt custEqpmtAdd) { //make sure that the sql db fields are lined up as shown here in the logic. i think the line below is just doing a dump. //i think this applies only sql adds db.Database.ExecuteSqlCommand("Insert into cmps411.tbl_customer_eqpmt Values({0},{1},{2}, {3}, {4})", custEqpmtAdd.customerCode, custEqpmtAdd.eqpmtType, custEqpmtAdd.model, custEqpmtAdd.machineID, custEqpmtAdd.jobNum); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "customerCode,machineID,eqpmtType,id")] tbl_customer_eqpmt tbl_customer_eqpmt) { if (ModelState.IsValid) { db.Entry(tbl_customer_eqpmt).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.customerCode = new SelectList(db.tbl_customer, "customerCode", "name", tbl_customer_eqpmt.customerCode); return(View(tbl_customer_eqpmt)); }
// GET: CustomerEqpmtMgmt/Details/5 public ActionResult Details(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tbl_customer_eqpmt tbl_customer_eqpmt = db.tbl_customer_eqpmt.Find(id); if (tbl_customer_eqpmt == null) { return(HttpNotFound()); } return(View(tbl_customer_eqpmt)); }
public ActionResult AddCustEqpmt(tbl_customer_eqpmt custEqpmtAdd) { using (allpax_sale_minerEntities entities = new allpax_sale_minerEntities()) { entities.tbl_customer_eqpmt.Add(new tbl_customer_eqpmt() { customerCode = custEqpmtAdd.customerCode, machineID = custEqpmtAdd.machineID, jobNum = custEqpmtAdd.jobNum, eqpmtType = custEqpmtAdd.eqpmtType }); entities.SaveChanges(); } return(RedirectToAction("Index")); }
// GET: CustomerEqpmtMgmt/Edit/5 public ActionResult Edit(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tbl_customer_eqpmt tbl_customer_eqpmt = db.tbl_customer_eqpmt.Find(id); if (tbl_customer_eqpmt == null) { return(HttpNotFound()); } ViewBag.customerCode = new SelectList(db.tbl_customer, "customerCode", "name", tbl_customer_eqpmt.customerCode); return(View(tbl_customer_eqpmt)); }
public ActionResult UpdateCustEqpmt(tbl_customer_eqpmt custEqpmtUpdate) { using (allpax_sale_minerEntities entities = new allpax_sale_minerEntities()) { tbl_customer_eqpmt updatedCustEqpmt = (from c in entities.tbl_customer_eqpmt where c.id == custEqpmtUpdate.id select c).FirstOrDefault(); updatedCustEqpmt.customerCode = custEqpmtUpdate.customerCode; updatedCustEqpmt.machineID = custEqpmtUpdate.machineID; updatedCustEqpmt.jobNum = custEqpmtUpdate.jobNum; updatedCustEqpmt.eqpmtType = custEqpmtUpdate.eqpmtType; entities.SaveChanges(); } return(new EmptyResult()); }
public ActionResult DeleteCustEqpmt(tbl_customer_eqpmt custEqpmtDelete) { db.Database.ExecuteSqlCommand("DELETE FROM cmps411.tbl_customer_eqpmt WHERE id=({0})", custEqpmtDelete.id); //return RedirectToAction("Index"); return(new EmptyResult()); }