Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
2
20230403
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Patryk Czarnik
20230403
Commits
d5afb3c3
Commit
d5afb3c3
authored
Apr 26, 2023
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dane z formularza odbierane w formie obiektu
parent
478ff824
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
13 deletions
+1
-13
ProductController.java
...ing/src/main/java/sklep/controller/ProductController.java
+1
-13
No files found.
PC30-SklepSpring/src/main/java/sklep/controller/ProductController.java
View file @
d5afb3c3
...
...
@@ -70,19 +70,7 @@ public class ProductController {
}
@PostMapping
({
"/new"
,
"/{id}/edit"
})
public
String
zapiszProdukt
(
Model
model
,
Integer
productId
,
String
description
,
BigDecimal
price
,
String
productName
,
BigDecimal
vat
)
{
System
.
out
.
println
(
"Parametry: "
+
productId
+
" "
+
productName
);
Product
product
=
new
Product
();
product
.
setProductId
(
productId
);
product
.
setProductName
(
productName
);
product
.
setDescription
(
description
);
product
.
setPrice
(
price
);
product
.
setVat
(
vat
);
public
String
zapiszProdukt
(
Model
model
,
Product
product
)
{
System
.
out
.
println
(
"Obiekt przed zapisem: "
+
product
.
getProductId
()
+
" "
+
product
.
getProductName
());
productRepository
.
save
(
product
);
System
.
out
.
println
(
"Obiekt po zapisie: "
+
product
.
getProductId
()
+
" "
+
product
.
getProductName
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment