예제 #1
0
 public ActionResult Edit([Bind(Include = "missionID,missionName,presidentName,missionAddress,missionLanguage,missionClimate,missionDominateReligion")] Mission mission)
 {
     if (ModelState.IsValid)
     {
         db.Entry(mission).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(mission));
 }
예제 #2
0
        public ActionResult EditAnswer([Bind(Include = "Mission_Question_ID, Mission_ID, User_ID, Question, Answer")] Mission_Questions mqID)
        {
            if (ModelState.IsValid)
            {
                //add entry
                //db.Mission_Questions.Add(mqID);
                //edit entries
                db.Entry(mqID).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("IndexLog"));
            }

            return(View(mqID));
        }
예제 #3
0
        public async Task <IActionResult> PutMissionDetails([FromRoute] int id, [FromBody] MissionDetails missionDetails)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != missionDetails.id)
            {
                return(BadRequest());
            }

            _context.Entry(missionDetails).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!MissionDetailsExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
예제 #4
0
 public ActionResult Edit([Bind(Include = "userID,userEmail,password,firstName,lastName")] Users users)
 {
     if (ModelState.IsValid)
     {
         db.Entry(users).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(users));
 }
예제 #5
0
 public ActionResult Edit([Bind(Include = "MissionID,Designation,Description")] Mission mission)
 {
     if (ModelState.IsValid)
     {
         db.Entry(mission).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(mission));
 }
 public ActionResult Edit([Bind(Include = "QUESTION_ID,MISSION_ID,USER_ID,QUESTION,ANSWER")] MissionQuestions missionQuestions)
 {
     if (ModelState.IsValid)
     {
         db.Entry(missionQuestions).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", new { missionID = globalMission.MISSION_ID, id = UserID }));
     }
     return(View(missionQuestions));
 }
예제 #7
0
 public ActionResult Edit([Bind(Include = "MissionID,missionName,missionPresidentsName,missionAddress,language,climate,dominantReligion,flagSymbol")] Mission mission)
 {
     if (ModelState.IsValid)
     {
         db.Entry(mission).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(mission));
 }
예제 #8
0
 public ActionResult Edit([Bind(Include = "USER_ID,USER_EMAIL,PASSWORD,FIRST_NAME,LAST_NAME")] Users users)
 {
     if (ModelState.IsValid)
     {
         db.Entry(users).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(users));
 }
예제 #9
0
 public ActionResult Answer([Bind(Include = "missionquestionID, missionID, userID, question, answer")] MissionQuestions newQuestion)
 {
     if (ModelState.IsValid)
     {
         db.Entry(newQuestion).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(newQuestion));
 }
예제 #10
0
 public ActionResult Edit([Bind(Include = "missionQuestionID,MissionID,UserID,question,answer")] MissionQuestions missionQuestions)
 {
     if (ModelState.IsValid)
     {
         db.Entry(missionQuestions).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.MissionID = new SelectList(db.Missions, "MissionID", "missionName", missionQuestions.MissionID);
     return(View(missionQuestions));
 }
예제 #11
0
 public ActionResult Edit([Bind(Include = "AstronautID,Name,Birthday,Nationality")] Astronaut astronaut)
 {
     if (ModelState.IsValid)
     {
         db.Entry(astronaut).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Nationality = new SelectList(db.Countries, "CountryID", "CountryName", astronaut.Nationality);
     return(View(astronaut));
 }
 public ActionResult Edit([Bind(Include = "CrewID,Astronaut,Mission,Position")] Crew crew)
 {
     if (ModelState.IsValid)
     {
         db.Entry(crew).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Astronaut = new SelectList(db.Astronauts, "AstronautID", "Name", crew.Astronaut);
     ViewBag.Mission   = new SelectList(db.Missions, "MissionID", "Designation", crew.Mission);
     return(View(crew));
 }