public IHttpActionResult PutQuiz(Guid id, Quiz quiz) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != quiz.Id) { return(BadRequest()); } db.Entry(quiz).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!QuizExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult Edit([Bind(Include = "Id,Order")] QuizQuestion quizQuestion) { if (ModelState.IsValid) { db.Entry(quizQuestion).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(quizQuestion)); }
public ActionResult Edit(TrainingExercise trainingExercise) { if (ModelState.IsValid) { db.Entry(trainingExercise).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index", new { id = trainingExercise.TrainingSession.Id })); } return(View(trainingExercise)); }
public ActionResult Edit(Data.Quiz quiz) { if (ModelState.IsValid) { db.Entry(quiz).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(quiz)); }
public ActionResult Edit(QuestionAnswer questionanswer) { if (ModelState.IsValid) { db.Entry(questionanswer).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index", new { id = questionanswer.Question.Id })); } return(View(questionanswer)); }
public ActionResult Edit([Bind(Include = "Id,Name,Description,IsPublic,AccessToken")] TrainingGroup trainingGroup) { if (ModelState.IsValid) { db.Entry(trainingGroup).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(trainingGroup)); }
public ActionResult Edit(Question question) { if (ModelState.IsValid) { db.Entry(question).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Details", new { id = question.Id })); } return(View(question)); }
public ActionResult Edit([Bind(Include = "Id,Userid,TimeStamp")] TrainingGroupSubscription trainingGroupSubscription) { if (ModelState.IsValid) { db.Entry(trainingGroupSubscription).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(trainingGroupSubscription)); }
public ActionResult Edit([Bind(Include = "Id,ShortName,Name,Reihenfolge")] QuestionCategory questionCategory) { if (ModelState.IsValid) { db.Entry(questionCategory).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(questionCategory)); }