Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Riina Antikainen
/
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 ae54a0df
authored
May 08, 2014
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update users card after adding role or product purchase
1 parent
d052d87d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/ProductBean.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/RoleBean.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/ProductBean.java
View file @
ae54a0d
...
@@ -104,6 +104,9 @@ public class ProductBean implements ProductBeanLocal {
...
@@ -104,6 +104,9 @@ public class ProductBean implements ProductBeanLocal {
@EJB
@EJB
private
DiscountBean
discountBean
;
private
DiscountBean
discountBean
;
@EJB
private
CardTemplateBean
cardTemplateBean
;
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ProductBean
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ProductBean
.
class
);
/**
/**
...
@@ -350,6 +353,7 @@ public class ProductBean implements ProductBeanLocal {
...
@@ -350,6 +353,7 @@ public class ProductBean implements ProductBeanLocal {
public
AccountEvent
createAccountEvent
(
Product
product
,
BigDecimal
quantity
,
EventUser
user
)
{
public
AccountEvent
createAccountEvent
(
Product
product
,
BigDecimal
quantity
,
EventUser
user
)
{
user
=
eventUserFacade
.
reload
(
user
);
user
=
eventUserFacade
.
reload
(
user
);
AccountEvent
ret
=
productPBean
.
createAccountEvent
(
product
,
quantity
,
user
,
Calendar
.
getInstance
());
AccountEvent
ret
=
productPBean
.
createAccountEvent
(
product
,
quantity
,
user
,
Calendar
.
getInstance
());
cardTemplateBean
.
checkPrintedCard
(
user
);
return
ret
;
return
ret
;
}
}
...
...
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/RoleBean.java
View file @
ae54a0d
...
@@ -55,8 +55,12 @@ public class RoleBean implements RoleBeanLocal {
...
@@ -55,8 +55,12 @@ public class RoleBean implements RoleBeanLocal {
@EJB
@EJB
private
EventUserFacade
eventuserfacade
;
private
EventUserFacade
eventuserfacade
;
@EJB
private
EventBeanLocal
permbean
;
private
EventBeanLocal
permbean
;
@EJB
private
CardTemplateBean
cardTemplateBean
;
// VIEW_ALL pitää olla että voidaan hakea roolien perusteella.
// VIEW_ALL pitää olla että voidaan hakea roolien perusteella.
@Override
@Override
@RolesAllowed
({
UserPermission
.
S_READ_ROLES
,
UserPermission
.
S_VIEW_ALL
})
@RolesAllowed
({
UserPermission
.
S_READ_ROLES
,
UserPermission
.
S_VIEW_ALL
})
...
@@ -185,6 +189,7 @@ public class RoleBean implements RoleBeanLocal {
...
@@ -185,6 +189,7 @@ public class RoleBean implements RoleBeanLocal {
if
(!
role
.
getUsers
().
contains
(
eventuser
))
{
if
(!
role
.
getUsers
().
contains
(
eventuser
))
{
role
.
getUsers
().
add
(
eventuser
);
role
.
getUsers
().
add
(
eventuser
);
}
}
cardTemplateBean
.
checkPrintedCardPrivate
(
eventuser
);
return
role
;
return
role
;
}
}
...
@@ -203,6 +208,8 @@ public class RoleBean implements RoleBeanLocal {
...
@@ -203,6 +208,8 @@ public class RoleBean implements RoleBeanLocal {
ur
.
getUsers
().
remove
(
usr
);
ur
.
getUsers
().
remove
(
usr
);
}
}
}
}
cardTemplateBean
.
checkPrintedCard
(
usr
);
}
}
@Override
@Override
...
...
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