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 {
return modelAndView;
}
@GetMapping("/townForm")
public ModelAndView getLocalAuthForm(){
ModelAndView modelAndView = new ModelAndView("townForm");
modelAndView.addObject("addAddTowns",new Towns());
public ModelAndView getLocalAuthPage(){
ModelAndView modelAndView = new ModelAndView("towns-data");
modelAndView.addObject("addAddTowns",new addAddTowns());
return modelAndView;
}
......
......@@ -2,9 +2,11 @@ package Team5.SmartTowns.addTowns;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class addAddTowns {
private String townName;
private String address1;
......
......@@ -35,7 +35,7 @@ public class addAddTownsRepositoryJDBC implements addAddTownsRepository {
@Override
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());
}
......
......@@ -9,23 +9,23 @@
<header th:insert="~{/towns/Templating.html::header}"></header>
<body>
<div id="container1">
<h2>Enter your Local authority</h2>
<form action="" method="post" id="data">
<p>
<label for="townName">Enter your town</label>
<input type="text" name="town_Name" id="townName">
</p>
<p>
<label for="address1">Please enter first line of your address</label>
<h2>Enter your Town</h2>
<form action="\town-data" method="post" id="data" name="data" th:object="*{towns-data}">
<label>Enter your town
<input type="text" th:field="*{townName}" name="town_Name" id="townName">
</label><br><br>
<label for="address1">Please enter first line of your address
<input type="text" name="address_1" id="address1">
</label><br><br>
</p>
<p>
<label for="address2">Please enter second line of your address (optional)</label>
<input type="text" name="address_2" id="address2">
<label>Please enter second line of your address (optional)</label>
<input type="text" th:field="*{address2}">
</p>
<p>
<label for="city">Please enter the City/Town</label>
<input type="text" name="city" id="city">
<label>Please enter the City/Town
<input type="text" th:field="*{city}">
</label>
</p>
<p>
<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