Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Codecrew
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
30
Merge Requests
2
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 62422ab9
authored
May 12, 2012
by
Juho Salli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Kantaan (melkein) kirjoittuu compo
1 parent
c76e8049
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
26 deletions
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Compo.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/voting/VotingCreateView.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Compo.java
View file @
62422ab
...
...
@@ -51,7 +51,7 @@ public class Compo extends GenericEntity {
@Temporal
(
TemporalType
.
TIMESTAMP
)
private
Calendar
startTime
;
@Column
(
name
=
"compo_
start
"
)
@Column
(
name
=
"compo_
end
"
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
private
Calendar
endTime
;
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/voting/VotingCreateView.java
View file @
62422ab
...
...
@@ -4,8 +4,9 @@ import java.util.Calendar;
import
java.util.Date
;
import
javax.ejb.EJB
;
import
javax.enterprise.context.ConversationScoped
;
import
javax.enterprise.context.RequestScoped
;
import
javax.faces.bean.ManagedBean
;
import
javax.faces.bean.RequestScoped
;
import
javax.inject.Named
;
import
javax.validation.constraints.Min
;
import
javax.validation.constraints.Size
;
...
...
@@ -35,12 +36,12 @@ public class VotingCreateView extends GenericCDIView {
@Min
(
value
=
1
,
message
=
"{voting.create.participantsError}"
)
private
Integer
maxParticipants
;
private
Calendar
compoStart
;
private
Calendar
compoEnd
;
private
Calendar
voteStart
;
private
Calendar
voteEnd
;
private
Calendar
submitStart
;
private
Calendar
submitEnd
;
private
Date
compoStart
;
private
Date
compoEnd
;
private
Date
voteStart
;
private
Date
voteEnd
;
private
Date
submitStart
;
private
Date
submitEnd
;
public
String
getName
()
{
return
name
;
...
...
@@ -60,40 +61,40 @@ public class VotingCreateView extends GenericCDIView {
public
void
setMaxParticipants
(
Integer
maxParticipants
)
{
this
.
maxParticipants
=
maxParticipants
;
}
public
Calendar
getCompoStart
()
{
public
Date
getCompoStart
()
{
return
compoStart
;
}
public
void
setCompoStart
(
Calendar
compoStart
)
{
public
void
setCompoStart
(
Date
compoStart
)
{
this
.
compoStart
=
compoStart
;
}
public
Calendar
getCompoEnd
()
{
public
Date
getCompoEnd
()
{
return
compoEnd
;
}
public
void
setCompoEnd
(
Calendar
compoEnd
)
{
public
void
setCompoEnd
(
Date
compoEnd
)
{
this
.
compoEnd
=
compoEnd
;
}
public
Calendar
getVoteStart
()
{
public
Date
getVoteStart
()
{
return
voteStart
;
}
public
void
setVoteStart
(
Calendar
voteStart
)
{
public
void
setVoteStart
(
Date
voteStart
)
{
this
.
voteStart
=
voteStart
;
}
public
Calendar
getVoteEnd
()
{
public
Date
getVoteEnd
()
{
return
voteEnd
;
}
public
void
setVoteEnd
(
Calendar
voteEnd
)
{
public
void
setVoteEnd
(
Date
voteEnd
)
{
this
.
voteEnd
=
voteEnd
;
}
public
Calendar
getSubmitStart
()
{
public
Date
getSubmitStart
()
{
return
submitStart
;
}
public
void
setSubmitStart
(
Calendar
submitStart
)
{
public
void
setSubmitStart
(
Date
submitStart
)
{
this
.
submitStart
=
submitStart
;
}
public
Calendar
getSubmitEnd
()
{
public
Date
getSubmitEnd
()
{
return
submitEnd
;
}
public
void
setSubmitEnd
(
Calendar
submitEnd
)
{
public
void
setSubmitEnd
(
Date
submitEnd
)
{
this
.
submitEnd
=
submitEnd
;
}
...
...
@@ -102,12 +103,30 @@ public class VotingCreateView extends GenericCDIView {
co
.
setName
(
name
);
co
.
setDescription
(
description
);
co
.
setMaxParticipantCount
(
maxParticipants
);
co
.
setStartTime
(
compoStart
);
// tässä laitetaan loppumisaika
co
.
setVoteStart
(
voteStart
);
co
.
setVoteEnd
(
voteEnd
);
co
.
setSubmitStart
(
submitStart
);
co
.
setSubmitEnd
(
submitEnd
);
Calendar
ct
=
Calendar
.
getInstance
();
ct
.
setTime
(
compoStart
);
co
.
setStartTime
(
ct
);
Calendar
ce
=
Calendar
.
getInstance
();
ce
.
setTime
(
compoEnd
);
co
.
setEndTime
(
ce
);
Calendar
vs
=
Calendar
.
getInstance
();
vs
.
setTime
(
voteStart
);
co
.
setVoteStart
(
vs
);
Calendar
ve
=
Calendar
.
getInstance
();
ve
.
setTime
(
voteEnd
);
co
.
setVoteEnd
(
ve
);
Calendar
ss
=
Calendar
.
getInstance
();
ss
.
setTime
(
submitStart
);
co
.
setSubmitStart
(
ss
);
Calendar
se
=
Calendar
.
getInstance
();
se
.
setTime
(
submitEnd
);
co
.
setSubmitEnd
(
se
);
votbean
.
createCompo
(
co
);
return
"success."
;
}
...
...
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