forked from hamzaouaddafe/AnnonceManager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ServicesSalesManager.java
76 lines (48 loc) · 1.48 KB
/
ServicesSalesManager.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import java.util.List;
public class ServicesSalesManager implements Services {
private AnnonceDao annonceDao;
private UserDao userDao;
public ServicesSalesManager(AnnonceDao annonceDao, UserDao userDao) {
this.annonceDao = annonceDao;
this.userDao = userDao;
}
public List<Annonce> selectAnnonces() {
return this.annonceDao.select();
}
public Annonce selectAnnonce(int id) {
return this.annonceDao.select(id);
}
public void insertAnnonce(Annonce a) {
this.annonceDao.insert(a);
}
public void deleteAnnonce(Annonce a) {
this.annonceDao.delete(a);
}
public void updateAnnonce(Annonce a) {
this.annonceDao.update(a);
}
public List<User> selectUsers() {
return this.userDao.select();
}
public User selectUser(int id) {
return this.userDao.select(id);
}
public User selectUser(String username, String password) {
return this.userDao.select(username, password);
}
public void insertUser(User u) {
this.userDao.insert(u);
}
public void deleteUser(User u) {
this.userDao.delete(u);
}
public void updateUser(User u) {
this.userDao.update(u);
}
public List<Annonce> selectAnnoncesByUser(User user) {
return this.annonceDao.selectByUser(user);
}
public List<Annonce> selectAnnoncesByUsername(String username) {
return this.annonceDao.selectByUser(username);
}
}