-
Notifications
You must be signed in to change notification settings - Fork 0
/
View_DB.java
83 lines (54 loc) · 2.06 KB
/
View_DB.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
77
78
79
80
81
82
83
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class View_DB
{
static void view_data(char item_code) throws FileNotFoundException
{
if(item_code == 'T')
{
String DB_Name = "teacher.txt";
System.out.print("\nTEACHERS DETAILS");
System.out.print("\n______________________________________________________________________________________\n");
reader(DB_Name);
}
else if(item_code == 'O')
{
String DB_Name = "officer.txt";
System.out.print("\nOFFICER DETAILS");
System.out.print("\n______________________________________________________________________________________\n");
reader(DB_Name);
}
else if(item_code == 'R')
{
String DB_Name = "regular_typist.txt";
System.out.print("\nREGULAR TYPIST DETAILS");
System.out.print("\n______________________________________________________________________________________\n");
reader(DB_Name);
}
else if(item_code == 'C')
{
String DB_Name = "casual_typist.txt";
System.out.print("\nCASUAL TYPIST DETAILS");
System.out.print("\n______________________________________________________________________________________\n");
reader(DB_Name);
}
else
{
System.out.print("\nERROR : WRONG INPUT!!");
choice_handling handling = new choice_handling();
handling.Navigation();
}
}
static void reader(String DB_Name) throws FileNotFoundException
{
FileInputStream fis = new FileInputStream(DB_Name);
Scanner output = new Scanner(fis);
while (output.hasNext())
{
System.out.print(output.nextLine()+"\n\n");
}
choice_handling handling = new choice_handling();
handling.Navigation();
}
}