コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            I_Pax i_Pax = db.I_Pax.Find(id);

            db.I_Pax.Remove(i_Pax);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "Id,First_Name,Last_Name,Birthdate,Passport,CountryId,AdressId,Gender,Email,Created")] I_Pax i_Pax)
 {
     if (ModelState.IsValid)
     {
         db.Entry(i_Pax).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(i_Pax));
 }
コード例 #3
0
        // GET: IPax/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            I_Pax i_Pax = db.I_Pax.Find(id);

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