예제 #1
0
        public ActionResult DeleteConfirmed(Transcript.Domain.Entities.Transcript transcript)
        {
            repository.Delete(transcript.Id);

            TempData["message"] = "Информация об успеваемости успешно удалена";

            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Delete(Transcript.Domain.Entities.Transcript transcript)
 {
     if (transcript == null)
     {
         return(HttpNotFound());
     }
     transcript = db.Transcripts.Find(transcript.Id);
     return(View(transcript));
 }
예제 #3
0
        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));
        }
예제 #4
0
        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));
        }