Esempio n. 1
0
        public ActionResult Create(Faculty faculty)
        {
            if (!ModelState.IsValid)
            {
                return(View("~/Views/ErrorValidations/Null.cshtml"));
            }

            if (_facultyRepository.CheckExistFaculty(faculty.Name))
            {
                return(View("~/Views/ErrorValidations/Exist.cshtml"));
            }

            _facultyRepository.CreateFaculty(faculty);
            return(RedirectToAction("Index"));
        }