Beispiel #1
0
        // 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);
        }
Beispiel #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            Pfep pfep = db.Pfeps.Find(id);

            db.Pfeps.Remove(pfep);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #3
0
 //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));
 }
Beispiel #4
0
        //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);
        }
Beispiel #5
0
        // 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));
        }