Esempio n. 1
0
 public IActionResult Create([Bind("Id,FirstName,LastName,Experience,MainSubjectId")] Teacher teacher)
 {
     if (ModelState.IsValid)
     {
         teacherDAO.Create(teacher);
         return(RedirectToAction(nameof(Index)));
     }
     ViewData["MainSubjectId"] = new SelectList(subjectDAO.GetList(0), "Id", "Title");
     return(View(teacher));
 }
Esempio n. 2
0
        private void AddOperation()
        {
            switch (view.entity)
            {
            case Entity.Pupil:
                Pupil s = view.PupilAddOrUpdateEnter();
                pupilDAO.Create(s);
                break;

            case Entity.Teacher:
                Teacher t = view.TeacherAddOrUpdateEnter();
                teacherDAO.Create(t);
                break;
            }
        }