Commit 0938b7ab3f66009669e5cc329e48175da267219f

Authored by totoro
1 parent b0e5ce0d

add delete row controller

Showing 2 changed files with 37 additions and 0 deletions   Show diff stats
controler/hk_controler.anubis 0 → 100644
  1 +/*
  2 + * Created by PyramIDE.
  3 + * User: フランスのトトロ aka (David RENÉ)
  4 + * Date: 19/03/2016
  5 + * Time: 19:48
  6 + * © Calexium
  7 + */
  8 +
  9 +
  10 +transmit hayamiki_lib/controler/hk_delete.anubis
controler/hk_delete.anubis 0 → 100644
  1 +/*
  2 + * Created by PyramIDE.
  3 + * User: フランスのトトロ aka (David RENÉ)
  4 + * Date: 19/03/2016
  5 + * Time: 19:25
  6 + * © Calexium
  7 + */
  8 +
  9 +read calexium_lib/web/CXM_common.anubis
  10 +read calexium_lib/web/CXM_web_arg_utils.anubis
  11 +//TODO move to hayamiki lib as view part of MVC
  12 +read calexium_lib/database/vtm/view_table_manager.anubis
  13 +
  14 +public define Result(String, String)
  15 + hk_delete_row
  16 + (
  17 + List(Web_arg) lwa,
  18 + TM_delete_list d_list, //list of all delete row function for database
  19 + SQLite3DataBase db
  20 + )=
  21 + if get_String(lwa, "table_name") is {failure then error("CANT_GET_ARGUMENT"), success(table_name) then
  22 + if get_Int(lwa, "id") is {failure then error("CANT_GET_ARGUMENT"), success(id) then
  23 + if tm_get_delete(table_name, d_list) is {failure then error("DELETE_FUNC_DOESNT_EXIST"), success(hk_delete) then
  24 + if hk_delete(db, [id]) is {failure then error("DELETE_ROW_DB_ERROR"), success(_) then
  25 + ok("DELETE_ROW_OK")
  26 + }}}}.
  27 +