Пример #1
0
 public ActionResult Edit([Bind(Include = "Id,Caption,Question,Timer")] Test test)
 {
     if (ModelState.IsValid)
     {
         db.Entry(test).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(test));
 }
Пример #2
0
 public ActionResult Edit([Bind(Include = "Id,Login,Password,IsAdmin")] User user)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(user));
 }
Пример #3
0
 public ActionResult Edit([Bind(Include = "Id,Text,TestId")] Question question)
 {
     if (ModelState.IsValid)
     {
         db.Entry(question).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.TestId = new SelectList(db.Test, "Id", "Caption", question.TestId);
     return(View(question));
 }
Пример #4
0
 public ActionResult Edit([Bind(Include = "Id,IdQuestion,Text,IsCorrect")] Answer answer)
 {
     if (ModelState.IsValid)
     {
         db.Entry(answer).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.IdQuestion = new SelectList(db.Question, "Id", "Text", answer.IdQuestion);
     return(View(answer));
 }
Пример #5
0
 public ActionResult Edit([Bind(Include = "Id,TestId,UserId,Date")] TestResult testResult)
 {
     if (ModelState.IsValid)
     {
         db.Entry(testResult).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.TestId = new SelectList(db.Test, "Id", "Caption", testResult.TestId);
     ViewBag.UserId = new SelectList(db.User, "Id", "Login", testResult.UserId);
     return(View(testResult));
 }