Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Linnea Samila
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 859a4e99
authored
Oct 24, 2012
by
Tuukka Kivilahti, TKffTK
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aikajutukkeita
1 parent
9f1a002e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
1 deletions
code/LanBortalDatabase/src/fi/insomnia/bortal/model/FoodWave.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/FoodWaveTemplate.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/FoodWaveView.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/FoodWave.java
View file @
859a4e9
...
@@ -89,6 +89,10 @@ public class FoodWave extends GenericEntity {
...
@@ -89,6 +89,10 @@ public class FoodWave extends GenericEntity {
return
closed
;
return
closed
;
}
}
public
boolean
isClosed
()
{
return
closed
;
}
public
void
setClosed
(
boolean
waveClosed
)
{
public
void
setClosed
(
boolean
waveClosed
)
{
this
.
closed
=
waveClosed
;
this
.
closed
=
waveClosed
;
}
}
...
@@ -108,5 +112,39 @@ public class FoodWave extends GenericEntity {
...
@@ -108,5 +112,39 @@ public class FoodWave extends GenericEntity {
public
FoodWaveTemplate
getTemplate
()
{
public
FoodWaveTemplate
getTemplate
()
{
return
template
;
return
template
;
}
}
public
boolean
isFull
()
{
return
false
;
}
/**
* Check if foodwave is orderable
*
* That means that it's not closed, full and it's in future
* @return
*/
public
boolean
isOrderable
()
{
if
(
isClosed
())
{
return
false
;
}
if
(
getTime
().
before
(
Calendar
.
getInstance
()))
{
return
false
;
}
if
(
isFull
())
{
return
false
;
}
return
true
;
}
}
}
code/LanBortalDatabase/src/fi/insomnia/bortal/model/FoodWaveTemplate.java
View file @
859a4e9
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
*/
*/
package
fi
.
insomnia
.
bortal
.
model
;
package
fi
.
insomnia
.
bortal
.
model
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
javax.persistence.Column
;
import
javax.persistence.Column
;
...
@@ -100,5 +101,26 @@ public class FoodWaveTemplate extends GenericEntity {
...
@@ -100,5 +101,26 @@ public class FoodWaveTemplate extends GenericEntity {
public
void
setEvent
(
LanEvent
event
)
{
public
void
setEvent
(
LanEvent
event
)
{
this
.
event
=
event
;
this
.
event
=
event
;
}
}
public
List
<
FoodWave
>
getOrderableFoodwaves
()
{
List
<
FoodWave
>
returnList
=
new
ArrayList
<
FoodWave
>();
for
(
FoodWave
wave
:
getFoodwaves
())
{
if
(
wave
.
isOrderable
())
{
returnList
.
add
(
wave
);
}
}
return
returnList
;
}
}
}
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/FoodWaveView.java
View file @
859a4e9
...
@@ -113,7 +113,7 @@ public class FoodWaveView extends GenericCDIView {
...
@@ -113,7 +113,7 @@ public class FoodWaveView extends GenericCDIView {
public
String
selectTemplate
()
{
public
String
selectTemplate
()
{
if
(
templates
.
isRowAvailable
())
{
if
(
templates
.
isRowAvailable
())
{
foodWaves
=
new
ListDataModel
<
FoodWave
>(
templates
.
getRowData
()
foodWaves
=
new
ListDataModel
<
FoodWave
>(
templates
.
getRowData
()
.
getFoodwaves
());
.
get
Orderable
Foodwaves
());
}
}
return
"/foodwave/list"
;
return
"/foodwave/list"
;
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment