Beispiel #1
0
        public ActionResult <Employee> AddEmployeeData(Employee emp)
        {
            var emp_data = _services.AddEmployeeData(emp);

            if (emp_data == null)
            {
                return(NotFound());
            }

            return(emp_data);
        }
Beispiel #2
0
        public ActionResult Create(Employee emp)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(View());
                }

                var emp_data = _services.AddEmployeeData(emp);

                if (emp_data == null)
                {
                    return(NotFound());
                }

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }