Example #1
0
        // GET: Student/Delete
        public ActionResult Delete(int id)
        {
            var studentGroup   = studentFacade.GetStudentById(id).StudentGroup;
            var studentGroupId = studentGroup.Id;

            studentFacade.DeleteStudent(id);
            return(View("View", CreateStudentViewModel(studentGroupId)));
        }
Example #2
0
 public IHttpActionResult DeleteStudent(Student student)
 {
     try
     {
         studentFcd.DeleteStudent(student);
         log.Info($"Student: {student.first_name} {student.last_name} has been removed from database!");
         return(Ok());
     }
     catch (Exception ex)
     {
         log.Error($"{ex.Message}");
         throw ex;
     }
 }
Example #3
0
 public IActionResult DeleteConfirmed(int id)
 {
     _studentFacade.DeleteStudent(id);
     return(RedirectToAction("Index"));
 }