public object Delete(Teacher info)
 {
     try
     {
         ValidateNoTeacherInstan(info);
         var model = info.Map();
         using (var dao = new TeacherDAO())
         {
             return(dao.Delete(model));
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #2
0
        private void DeleteOperation()
        {
            long id = -1;

            while (id < 0)
            {
                id = view.EnterId();
            }
            if (id < 0)
            {
                throw new Exception("Wrong id");
            }
            switch (view.entity)
            {
            case Entity.Teacher:
                teacherDAO.Delete(id);
                break;

            case Entity.Pupil:
                pupilDAO.Delete(id);
                break;
            }
        }
Beispiel #3
0
 public IActionResult DeleteConfirmed(long id)
 {
     teacherDAO.Delete(id);
     return(RedirectToAction(nameof(Index)));
 }
 public static bool Delete(Guid id)
 {
     return(TeacherDAO.Delete(id));
 }