Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Team 5 - Smart Towns
Manage
Activity
Members
Labels
Plan
Issues
34
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rhys Evans
Team 5 - Smart Towns
Commits
c7c99e5e
Commit
c7c99e5e
authored
1 year ago
by
Rhys Nute
Browse files
Options
Downloads
Patches
Plain Diff
completed database
parent
0822ee82
No related branches found
No related tags found
1 merge request
!39
Draft: Towns
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/Team5/SmartTowns/Organisation/organisationControllers.java
+15
-0
15 additions, 0 deletions
...eam5/SmartTowns/Organisation/organisationControllers.java
src/main/resources/WorkWith/towns.html
+5
-0
5 additions, 0 deletions
src/main/resources/WorkWith/towns.html
with
20 additions
and
0 deletions
src/main/java/Team5/SmartTowns/Organisation/organisationControllers.java
+
15
−
0
View file @
c7c99e5e
...
@@ -33,4 +33,19 @@ public class organisationControllers {
...
@@ -33,4 +33,19 @@ public class organisationControllers {
ModelAndView
modelAndView
=
new
ModelAndView
(
"WorkWith/towns.html"
);
ModelAndView
modelAndView
=
new
ModelAndView
(
"WorkWith/towns.html"
);
return
modelAndView
;
return
modelAndView
;
}
}
@Autowired
private
addAddTownsRepository
addAddTownsRepository
;
@PostMapping
(
"/townssub"
)
public
ModelAndView
townsSent
(
@Valid
@ModelAttribute
(
"towns-data"
)
Towns
towns
,
BindingResult
bindingResult
,
Model
model
)
{
if
(
bindingResult
.
hasErrors
())
{
ModelAndView
modelAndView
=
new
ModelAndView
(
"towns-data"
,
model
.
asMap
());
return
modelAndView
;
}
else
{
// converts user input using the organisation constructor into a submittable format to the sql table
Towns
tow
=
new
Towns
(
towns
.
getTownName
(),
towns
.
getAddress1
(),
towns
.
getAddress2
(),
towns
.
getCity
(),
towns
.
getCounty
(),
towns
.
getPostcode
());
System
.
out
.
println
(
bus
);
addAddTownsRepository
.
addAddTown
(
tow
);
//add new towns to Add Towns table
ModelAndView
modelAndView
=
new
ModelAndView
(
"redirect:/businesses"
);
return
modelAndView
;
}
}
}
This diff is collapsed.
Click to expand it.
src/main/resources/WorkWith/towns.html
+
5
−
0
View file @
c7c99e5e
...
@@ -11,6 +11,11 @@
...
@@ -11,6 +11,11 @@
<p>
Giving local businesses a voice in the community
</p>
<p>
Giving local businesses a voice in the community
</p>
<h1>
Empowering Community Spirit
</h1>
<h1>
Empowering Community Spirit
</h1>
<h1>
Creating the towns Identity
</h1>
<h1>
Creating the towns Identity
</h1>
<div>
<ul
th:each=
"addAddTowns:${addTown}"
>
<li
th:text=
"${addAddTowns}"
></li>
</ul>
</div>
<button
id=
"submit"
>
Towns log in here
</button><a
href=
"towns-data.html"
></a>
<button
id=
"submit"
>
Towns log in here
</button><a
href=
"towns-data.html"
></a>
</body>
</body>
<footer
th:insert=
"~{/towns/Templating.html::footer}"
></footer>
<footer
th:insert=
"~{/towns/Templating.html::footer}"
></footer>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment