Skip to content
Snippets Groups Projects
Commit 22421a65 authored by Rhys Nute's avatar Rhys Nute
Browse files

updated

parent 7d1935d0
No related branches found
No related tags found
1 merge request!39Draft: Towns
...@@ -44,9 +44,9 @@ public class organisationControllers { ...@@ -44,9 +44,9 @@ public class organisationControllers {
return modelAndView; return modelAndView;
} }
@GetMapping("/townForm") @GetMapping("/townForm")
public ModelAndView getLocalAuthForm(){ public ModelAndView getLocalAuthPage(){
ModelAndView modelAndView = new ModelAndView("townForm"); ModelAndView modelAndView = new ModelAndView("towns-data");
modelAndView.addObject("addAddTowns",new Towns()); modelAndView.addObject("addAddTowns",new addAddTowns());
return modelAndView; return modelAndView;
} }
......
...@@ -2,9 +2,11 @@ package Team5.SmartTowns.addTowns; ...@@ -2,9 +2,11 @@ package Team5.SmartTowns.addTowns;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor
public class addAddTowns { public class addAddTowns {
private String townName; private String townName;
private String address1; private String address1;
......
...@@ -35,7 +35,7 @@ public class addAddTownsRepositoryJDBC implements addAddTownsRepository { ...@@ -35,7 +35,7 @@ public class addAddTownsRepositoryJDBC implements addAddTownsRepository {
@Override @Override
public void addTown(addAddTowns tow) { public void addTown(addAddTowns tow) {
String sql = "insert into addTowns( townName, address1, address2, city, county, postcode) values (?, ?, ?, ?, ?, ?)"; String sql = "insert into addTowns( townName, address1, address2, city, county, postcode) values (?, ?, ?, ?, ?, ?)";
jdbc.update(sql, tow.getTownName(), tow.getAddress1(), tow.getAddress2(), tow.getCity(), tow.getCounty(), tow.getPostcode()); jdbc.update(sql, tow.getTownName(), tow.getAddress1(), tow.getAddress2(), tow.getCity(), tow.getCounty(), tow.getPostcode());
} }
......
...@@ -9,23 +9,23 @@ ...@@ -9,23 +9,23 @@
<header th:insert="~{/towns/Templating.html::header}"></header> <header th:insert="~{/towns/Templating.html::header}"></header>
<body> <body>
<div id="container1"> <div id="container1">
<h2>Enter your Local authority</h2> <h2>Enter your Town</h2>
<form action="" method="post" id="data"> <form action="\town-data" method="post" id="data" name="data" th:object="*{towns-data}">
<p> <label>Enter your town
<label for="townName">Enter your town</label> <input type="text" th:field="*{townName}" name="town_Name" id="townName">
<input type="text" name="town_Name" id="townName"> </label><br><br>
</p> <label for="address1">Please enter first line of your address
<p>
<label for="address1">Please enter first line of your address</label>
<input type="text" name="address_1" id="address1"> <input type="text" name="address_1" id="address1">
</label><br><br>
</p> </p>
<p> <p>
<label for="address2">Please enter second line of your address (optional)</label> <label>Please enter second line of your address (optional)</label>
<input type="text" name="address_2" id="address2"> <input type="text" th:field="*{address2}">
</p> </p>
<p> <p>
<label for="city">Please enter the City/Town</label> <label>Please enter the City/Town
<input type="text" name="city" id="city"> <input type="text" th:field="*{city}">
</label>
</p> </p>
<p> <p>
<label for="county">Please enter you county (optional)</label> <label for="county">Please enter you county (optional)</label>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment