// GET: Pfeps/Edit/5 public ActionResult Edit(int?id) { var pfeps = db.Pfeps.SingleOrDefault(c => c.PfepId == id); var parttypes = db.PartTypes.ToList(); var viewModel = new Save1PfepViewModel() { Pfep = pfeps, PartTypes = parttypes }; if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Pfep pfep = db.Pfeps.Find(id); if (pfep == null) { return(HttpNotFound()); } return(View("Edit", viewModel)); //return View(pfep); }
public ActionResult DeleteConfirmed(int id) { Pfep pfep = db.Pfeps.Find(id); db.Pfeps.Remove(pfep); db.SaveChanges(); return(RedirectToAction("Index")); }
//public ActionResult Edit([Bind(Include = "PfepId,CustomerPn,PartType,LtCustomer,LtTx,LtOcean,LtHaimen,LtAssy,PfepCustomer,PfepTx,PfepOcean,PfepHaimen,PfepAssy,Min,Max,KbQty")] Pfep pfep) public ActionResult Edit(Pfep pfep) { if (ModelState.IsValid) { db.Entry(pfep).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(pfep)); }
//public ActionResult Create([Bind(Include = "PfepId,CustomerPn,PartType,LtCustomer,LtTx,LtOcean,LtHaimen,LtAssy,PfepCustomer,PfepTx,PfepOcean,PfepHaimen,PfepAssy,Min,Max,KbQty")] Pfep pfep) public ActionResult Create(Pfep pfep) { if (ModelState.IsValid) { db.Pfeps.Add(pfep); db.SaveChanges(); return(RedirectToAction("Index", "Pfeps")); } return(View()); //return View(pfep); }
// GET: Pfeps/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Pfep pfep = db.Pfeps.Find(id); if (pfep == null) { return(HttpNotFound()); } return(View(pfep)); }