public JsonResult DeleteRecordbyID(int id) { UserAddress obj = _IBOUsers.GetAddressById(id); if (obj == null) { _IBOUsers.DeleteRecord(id); } else { _IBOUsers.DeleteAddress(obj.address_id); _IBOUsers.DeleteRecord(id); } return(Json(new JsonSerializerSettings())); }
public IActionResult DeleteRecord(int id) { UserAddress obj = _IBOUsers.GetAddressById(id); if (obj == null) { _IBOUsers.DeleteRecord(id); } else { _IBOUsers.DeleteAddress(obj.address_id); _IBOUsers.DeleteRecord(id); } return(RedirectToAction("UsersList")); }