Добавил возможность удаления услуг в БД и UI панели администратора

This commit is contained in:
2026-07-06 23:26:04 +03:00
parent 8938fb2dcd
commit 31539142b1
2 changed files with 51 additions and 1 deletions
+8
View File
@@ -263,3 +263,11 @@ class DatabaseManager:
""", (name.strip(), price.strip(), float(price_numeric), description.strip(), int(is_active), service_id.strip()))
conn.commit()
return cursor.rowcount > 0
def delete_service(self, service_id: str) -> bool:
"""Удалить услугу из базы данных."""
with self._get_connection() as conn:
cursor = conn.cursor()
cursor.execute("DELETE FROM services WHERE id = ?", (service_id.strip(),))
conn.commit()
return cursor.rowcount > 0