-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAdmin.java
51 lines (43 loc) · 1.62 KB
/
Admin.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
package com.accenture.itfactory.base.FilmApplication;
import java.util.Date;
public class Admin extends User {
FilmDatabase filmDatabase;
public Admin(){
filmDatabase = new FilmDatabase();
}
public void addFilm(String fName, String fId, String fType, String fGenre, Date fDate,
double fRating, String fDescription){
//add films
filmDatabase.addFilm(fName,fId,fType,fGenre,fDate,fRating, fDescription);
}
public void deleteFilm(String fName, String fId, String fType, String fGenre, Date fDate,
double fRating, String fDescription){
//delete film
if(fName != null)
filmDatabase.removeByName(fName);
if(fId != null)
filmDatabase.removeById(fId);
if(fType != null)
filmDatabase.removeByType(fType);
if(fGenre!= null)
filmDatabase.removeByGenre(fGenre);
if(fDate != null)
filmDatabase.removeByReleaseDate(fDate);
if(fRating != 0)
filmDatabase.removeByRating(fRating);
if(fDescription != null)
filmDatabase.removeByDescription(fDescription);
}
public void addReview(String fName,String newReview){
//add review
filmDatabase.addReview(fName,newReview,"Admin");
}
public void editReview(String fName,String newReview){
//edit review
filmDatabase.editReview(fName,newReview,"Admin");
}
public void deleteReview(String fName){
//delete review
filmDatabase.deleteReview(fName);
}
}