Esempio n. 1
0
        // GET: Departements/Delete/5
        public async Task <IActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }
            var employees = iDepatementService.GetAllEmp(id.GetValueOrDefault());

            if (employees.Count > 0)
            {
                TempData["Error"] = "NotConfirm";
                return(RedirectToAction("Index"));
            }


            var departements = iDepatementService.GetById(id.GetValueOrDefault());

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

            return(View(departements));
        }