示例#1
0
 public ActionResult Edit(tblShip tblship)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tblship).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tblship));
 }
示例#2
0
        public ActionResult Create(tblShip tblship)
        {
            if (ModelState.IsValid)
            {
                db.tblShips.Add(tblship);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tblship));
        }
示例#3
0
        // GET: adminShip/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tblShip tblShip = db.tblShips.Find(id);

            db.tblShips.Remove(tblShip);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#4
0
        // GET: adminShip/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tblShip tblShip = db.tblShips.Find(id);

            if (tblShip == null)
            {
                return(HttpNotFound());
            }
            return(View(tblShip));
        }