public async Task <IActionResult> Create(Faculty fac)
        {
            var createFaculty = await _faculty.AddAsync(fac);

            if (createFaculty)
            {
                Alert("Faculty created successfully.", NotificationType.success);
                return(RedirectToAction("Index"));
            }
            else
            {
                Alert("Faculty not created!", NotificationType.error);
            }
            return(View());
        }
Beispiel #2
0
        public async Task <IActionResult> Create(Faculty faculty)
        {
            faculty.CreatedBy = _userManager.GetUserName(User);

            var createFaculty = await _faculty.AddAsync(faculty);

            if (createFaculty)
            {
                Alert("Faculty created successfully.", NotificationType.success);
                return(RedirectToAction("Index"));
            }
            else
            {
                Alert("Duplicate Faculty cannot created!", NotificationType.error);
            }


            return(View());
        }