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)); }
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)); }
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)); }
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)); }
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)); }