diff options
author | Daniel <darthdaniel85@gmail.com> | 2013-11-22 15:25:30 -0500 |
---|---|---|
committer | Daniel <darthdaniel85@gmail.com> | 2013-11-22 15:25:30 -0500 |
commit | ab6effd64caefa732ef0994d6c3048f5cd474bf6 (patch) | |
tree | 73f4e568295f4d7625fc16af9ce03c58bbbaab2a /framework/Wsat/pages/TWsatGenerateAR.php | |
parent | 85ca63b0896be3d12a098b44b5ec0c65a5b76a6c (diff) |
WSAT beta release.
Diffstat (limited to 'framework/Wsat/pages/TWsatGenerateAR.php')
-rw-r--r-- | framework/Wsat/pages/TWsatGenerateAR.php | 80 |
1 files changed, 48 insertions, 32 deletions
diff --git a/framework/Wsat/pages/TWsatGenerateAR.php b/framework/Wsat/pages/TWsatGenerateAR.php index 754cac5c..3d4291e2 100644 --- a/framework/Wsat/pages/TWsatGenerateAR.php +++ b/framework/Wsat/pages/TWsatGenerateAR.php @@ -1,33 +1,49 @@ -<?php
-
-/**
- * Description of Inicio
- *
- * @author daniels
- */
-Prado::using("System.Wsat.TWsatARGenerator");
-
-class TWsatGenerateAR extends TPage {
-
- public function onInit($param) {
- parent::onInit($param);
- }
-
- public function generate($sender) {
- $table_name = $this->table_name->Text;
-
- $ar_generator = new TWsatARGenerator();
- if ($table_name != "*") {
- $ar_generator->generate($table_name);
- } else {
- $ar_generator->generateAll();
- }
- }
-
- public function preview($sender) {
-
- }
-
-}
-
+<?php + +/** + * Description of Inicio + * + * @author daniels + */ +Prado::using("System.Wsat.TWsatARGenerator"); + +class TWsatGenerateAR extends TPage { + + public function generate($sender) { + if ($this->IsValid) { + $table_name = $this->table_name->Text; + $class_prefix = $this->class_prefix->Text; + $output_folder_ns = $this->output_folder->Text; + + try { + $ar_generator = new TWsatARGenerator(); + $ar_generator->setOpFile($output_folder_ns); + $ar_generator->setClasPrefix($class_prefix); + + if ($this->build_rel->Checked) { + $ar_generator->buildRelations(); + } + if ($table_name != "*") { + $ar_generator->generate($table_name); + } else { + $ar_generator->generateAll(); + } + $this->success_panel->CssClass = "success_panel"; + $this->generation_msg->Text = "The code has been generated successfully."; + } catch (Exception $ex) { + $this->success_panel->CssClass = "exception_panel"; + $this->generation_msg->Text = $ex->getMessage(); + } + $this->success_panel->Visible = true; + } + } + + public function preview($sender) { +// $ar_generator = new TWsatARGenerator(); +// $ar_generator->renderAllTablesInformation(); + throw new THttpException(500, "Not implemented yet."); + } + +} + ?>
\ No newline at end of file |