public IActionResult DeleteAcount([FromBody] Dictionary <string, object> formData)
        {
            string departmentid = "";

            if (formData.Keys.Contains("departmentid") && !string.IsNullOrEmpty(Convert.ToString(formData["departmentid"])))
            {
                departmentid = Convert.ToString(formData["departmentid"]);
            }
            _itemBusiness.Delete(departmentid);
            return(Ok());
        }
Beispiel #2
0
 public ActionResult DeleteConfirmed(int id)
 {
     if (_studentBusiness.GetAll().Any(x => x.DepartmentId == id) == false)
     {
         Department department = _departmentBusiness.GetById((int)id);
         _departmentBusiness.Delete(department);
         return(RedirectToAction("Index"));
     }
     else
     {
         TempData["message"] = "Can't Delele Running Department";
         return(RedirectToAction("Delete"));
     }
 }