summaryrefslogtreecommitdiff
path: root/framework/Wsat/pages
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Wsat/pages')
-rw-r--r--framework/Wsat/pages/TWsatScaffolding.page4
-rw-r--r--framework/Wsat/pages/TWsatScaffolding.php19
2 files changed, 19 insertions, 4 deletions
diff --git a/framework/Wsat/pages/TWsatScaffolding.page b/framework/Wsat/pages/TWsatScaffolding.page
index a3ebffd5..f3e53df3 100644
--- a/framework/Wsat/pages/TWsatScaffolding.page
+++ b/framework/Wsat/pages/TWsatScaffolding.page
@@ -12,6 +12,10 @@
<com:TRequiredFieldValidator ControlToValidate="output_folder" Text="Output folder cannot be blank." Display="Dynamic" />
</div>
+ <com:TPanel ID="feedback_panel" Visible="false" style="width: 400px">
+ <com:TLabel ID="generation_msg" />
+ </com:TPanel>
+
<div style="text-align: center; width: 400px">
<com:TButton Text="Preview" OnClick="preview" Visible="false" />
<com:TButton Text="Generate" OnClick="generate" />
diff --git a/framework/Wsat/pages/TWsatScaffolding.php b/framework/Wsat/pages/TWsatScaffolding.php
index 9bbeec3a..2dc7d288 100644
--- a/framework/Wsat/pages/TWsatScaffolding.php
+++ b/framework/Wsat/pages/TWsatScaffolding.php
@@ -39,10 +39,21 @@ class TWsatScaffolding extends TPage
{
if ($this->IsValid)
{
- $scf_generator = new TWsatScaffoldingGenerator();
- // echo $this->cb_student->Text;
- // $scf_generator->renderAllTablesInformation();
+ try
+ {
+ $scf_generator = new TWsatScaffoldingGenerator();
+ $scf_generator->setOpFile($this->output_folder->Text);
+ $scf_generator->generate();
+ $this->feedback_panel->CssClass = "green_panel";
+ $this->generation_msg->Text = "The code has been generated successfully.";
+ } catch (Exception $ex)
+ {
+ $this->feedback_panel->CssClass = "red_panel";
+ $this->generation_msg->Text = $ex->getMessage();
+ }
+ $this->feedback_panel->Visible = true;
}
- }
+ // $scf_generator->renderAllTablesInformation();
+ }
} \ No newline at end of file