public ActionResult DeleteConfirmed(Transcript.Domain.Entities.Transcript transcript) { repository.Delete(transcript.Id); TempData["message"] = "Информация об успеваемости успешно удалена"; return(RedirectToAction("Index")); }
public ActionResult Delete(Transcript.Domain.Entities.Transcript transcript) { if (transcript == null) { return(HttpNotFound()); } transcript = db.Transcripts.Find(transcript.Id); return(View(transcript)); }
public ActionResult Edit(Transcript.Domain.Entities.Transcript transcript) { if (ModelState.IsValid) { repository.Edit(transcript); TempData["message"] = "Информация о успеваемости успешно редактирована"; return(RedirectToAction("Index")); } ViewBag.StudentId = new SelectList(db.Students, "Id", "SecondName", transcript.StudentId); ViewBag.SubjectId = new SelectList(db.Subjects, "Id", "Name", transcript.SubjectId); ViewBag.TeacherId = new SelectList(db.Teachers, "Id", "SecondName", transcript.TeacherId); ViewBag.TypeControlId = new SelectList(db.TypesControl, "Id", "Name", transcript.TypeControlId); return(View(transcript)); }
public ViewResult Edit(int?id) { if (id == null) { return(View("Index")); } Transcript.Domain.Entities.Transcript transcript = repository.Transcripts.FirstOrDefault(_ => _.Id == id); if (transcript == null) { return(View("Index")); } ViewBag.StudentId = new SelectList(db.Students, "Id", "SecondName", transcript.StudentId); ViewBag.SubjectId = new SelectList(db.Subjects, "Id", "Name", transcript.SubjectId); ViewBag.TeacherId = new SelectList(db.Teachers, "Id", "SecondName", transcript.TeacherId); ViewBag.TypeControlId = new SelectList(db.TypesControl, "Id", "Name", transcript.TypeControlId); return(View(transcript)); }