From 0938b7ab3f66009669e5cc329e48175da267219f Mon Sep 17 00:00:00 2001 From: totoro Date: Sat, 19 Mar 2016 20:36:59 +0100 Subject: [PATCH] add delete row controller --- controler/hk_controler.anubis | 10 ++++++++++ controler/hk_delete.anubis | 27 +++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 0 deletions(-) create mode 100644 controler/hk_controler.anubis create mode 100644 controler/hk_delete.anubis diff --git a/controler/hk_controler.anubis b/controler/hk_controler.anubis new file mode 100644 index 0000000..55bf0ce --- /dev/null +++ b/controler/hk_controler.anubis @@ -0,0 +1,10 @@ +/* + * Created by PyramIDE. + * User: フランスのトトロ aka (David RENÉ) + * Date: 19/03/2016 + * Time: 19:48 + * © Calexium + */ + + +transmit hayamiki_lib/controler/hk_delete.anubis diff --git a/controler/hk_delete.anubis b/controler/hk_delete.anubis new file mode 100644 index 0000000..c99aaec --- /dev/null +++ b/controler/hk_delete.anubis @@ -0,0 +1,27 @@ +/* + * Created by PyramIDE. + * User: フランスのトトロ aka (David RENÉ) + * Date: 19/03/2016 + * Time: 19:25 + * © Calexium + */ + +read calexium_lib/web/CXM_common.anubis +read calexium_lib/web/CXM_web_arg_utils.anubis +//TODO move to hayamiki lib as view part of MVC +read calexium_lib/database/vtm/view_table_manager.anubis + +public define Result(String, String) + hk_delete_row + ( + List(Web_arg) lwa, + TM_delete_list d_list, //list of all delete row function for database + SQLite3DataBase db + )= + if get_String(lwa, "table_name") is {failure then error("CANT_GET_ARGUMENT"), success(table_name) then + if get_Int(lwa, "id") is {failure then error("CANT_GET_ARGUMENT"), success(id) then + if tm_get_delete(table_name, d_list) is {failure then error("DELETE_FUNC_DOESNT_EXIST"), success(hk_delete) then + if hk_delete(db, [id]) is {failure then error("DELETE_ROW_DB_ERROR"), success(_) then + ok("DELETE_ROW_OK") + }}}}. + -- libgit2 0.21.4