-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainApp.java
More file actions
41 lines (37 loc) · 1.2 KB
/
Copy pathMainApp.java
File metadata and controls
41 lines (37 loc) · 1.2 KB
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
/** classe application */
import java.util.ArrayList;
import java.util.Map;
import java.util.Scanner;
public class MainApp {
public static void main (String[] args) {
Magasin mag=new Magasin("Decathlon",200);
Manager chef = new Manager("Musk", "Elon",Poste.Manager);
Article a=new Article("Ski",200,400,"P");
Article b=new Article ("Ski",100,200,"C");
Article c=new Article ("Ski",60,120,"E");
mag.AjouterArticlebis(a,1);
mag.AjouterArticlebis(b,2);
mag.AjouterArticlebis(c,3);
ArrayList <Article> a1=new ArrayList<Article>();
a1.add(a);
a1.add(b);
a1.add(c);
Fournisseur f=new Fournisseur("Fournisseur1",a1,100);
mag.ajouterFournisseur(f);
Vendeur v=new Vendeur("Guibert","Samuel",Poste.Vendeur,0);
chef.ajoutEmployeVendeur(v);
Scanner scan = new Scanner(System.in);
System.out.println("Souhaitez vous utiliser la sauvegarde et les fichiers : si oui tapez 1 sinon 0");
int choix = scan.nextInt();
if (choix == 1) {
FileDriver.ecrireFichier(FileDriver.chemin,Magasin.getArticles());
FileDriver.lireFichierSauvegarder(FileDriver.chemin);
FileDriver.lancerMenu1();
FileDriver.lancerMenu2();
}
else {
FileDriver.lancerMenu1();
FileDriver.lancerMenu2();
}
}
}