Beispiel #1
0
        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));
        }
Beispiel #2
0
 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));
 }
Beispiel #4
0
 public ActionResult Edit(Data.Quiz quiz)
 {
     if (ModelState.IsValid)
     {
         db.Entry(quiz).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(quiz));
 }
Beispiel #5
0
 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));
 }
Beispiel #6
0
 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));
 }
Beispiel #7
0
 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));
 }
Beispiel #8
0
 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));
 }