コード例 #1
0
 public ActionResult Edit([Bind(Include = "missionID,missionName,missionPresidentName,missionAddress,missionLanguage,missionClimate,missionDomReligion,missionFlagURL")] Missions missions)
 {
     if (ModelState.IsValid)
     {
         db.Entry(missions).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(missions));
 }
コード例 #2
0
        public ActionResult Create([Bind(Include = "missionID,missionName,missionPresidentName,missionAddress,missionLanguage,missionClimate,missionDomReligion,missionFlagURL")] Missions missions)
        {
            if (ModelState.IsValid)
            {
                db.Missions.Add(missions);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(missions));
        }
コード例 #3
0
        // GET: Missions/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Missions missions = db.Missions.Find(id);

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