예제 #1
0
        public IActionResult add(FacultyDto model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    _facultyService.save(model);
                    AlertHelper.setMessage(this, "Faculty saved successfully.", messageType.success);
                    return(RedirectToAction("index"));
                }
            }
            catch (Exception ex)
            {
                AlertHelper.setMessage(this, ex.Message, messageType.error);
            }

            return(View(model));
        }