Exemplo n.º 1
0
        public IActionResult AddSubDepartment(int departmentId, DepartmentViewModel newDepartmentViewModel)
        {
            if (!string.IsNullOrEmpty(newDepartmentViewModel.SubDepartment.Description))
            {
                newDepartmentViewModel.SubDepartment.DepartmentId = departmentId;

                _DepartmentData.AddNewSubDepartment(newDepartmentViewModel.SubDepartment);
                return(RedirectToAction("DepartmentofSubDepartment", new { departmentId = departmentId }));
            }

            return(Content("I will try to find a way to add to table ID " + newDepartmentViewModel.SubDepartment.DepartmentId + "newDepartmentViewModel.SubDepartment Name" + newDepartmentViewModel.SubDepartment.Description));
        }