-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRecruitmentManagement.java
More file actions
221 lines (183 loc) · 9.34 KB
/
RecruitmentManagement.java
File metadata and controls
221 lines (183 loc) · 9.34 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
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
package recruitmentmanagement;
import java.util.*;
public class RecruitmentManagement {
private static Object hrChoice;
public static void main(String[] args) {
// Initialize instances
Job j = new Job("", "", 0);
Applicant ap = new Applicant(0, "", "", "", "", "", "");
Admin a = new Admin();
HiringDepartment HD = new HiringDepartment();
HR h = new HR(1, "", "", "", "", "", "", "", HD);
Menus m = new Menus();
Scanner s = new Scanner(System.in);
//ye code sirf file create krny k liye tha
File jobFile = new File("Job.txt");
File ApplicantFile = new File("Applicant.txt");
try {
if (ApplicantFile.createNewFile()){
System.out.println("File created :"+ApplicantFile.getName());
}else{
System.out.println("File already exist");
}
}catch (IOException e) {
e.printStackTrace();
}
try {
if (jobFile.createNewFile()) {
System.out.println("File created: " + jobFile.getName());
} else {
System.out.println("File already exists.");
}
} catch (IOException e) {
e.printStackTrace();
}
//jobs or applicants ki Files ky path
String jobFile = "Job.txt";
String applicantFile = "Applicant.txt";
//agr file mai koi data hai toh usko load krny k liye
List<Job> jobs = Job.readJobsFromFile(jobFile);
List<Applicant> applicants = Applicant.readApplicantsFromFile(applicantFile);
while (true) {
m.stakeholders();
int choice = s.nextInt();
s.nextLine();
switch (choice) {
case 1: // Admin ka case
if (!a.login()) {
System.out.println("Access Denied, Exiting...");
return; // Agr login fail hogaya toh program Exit hojye ga yahan
}
while (true) {
m.Adminmenu();
choice = s.nextInt();
s.nextLine();
switch (choice) {
case 1: // Job Management k liye case
String jobOption;
do {
m.jobmenu();
choice = s.nextInt();
s.nextLine();
switch (choice) {
case 1: // Add Job details
j.addJob();
jobs.add(j);
Job.writeJobsToFile(jobs, jobFile);
break;
case 2: // Display All Jobs details
Job.displayJobs(jobs);
break;
case 3: // Update Job details
Job.updateJob(jobs);
Job.writeJobsToFile(jobs, jobFile);
break;
case 4: // Delete Job details
Job.deleteJob(jobs);
Job.writeJobsToFile(jobs, jobFile);
break;
default:
System.out.println("Invalid Option Selected.");
}
System.out.println("Continue in Job Menu? Enter YES to continue or NO to return to Main Menu.");
jobOption = s.nextLine();
} while (jobOption.equalsIgnoreCase("YES"));
break;
case 2: // Applicant Management k liye case
String applicantOption;
do {
m.applicantmenu();
choice = s.nextInt();
s.nextLine();
switch (choice) {
case 1: // Add Applicant details
ap.addApplicant();
applicants.add(ap);
Applicant.writeApplicantsToFile(applicants, applicantFile);
break;
case 2: // Display All Applicants details
Applicant.displayAllApplicants(applicants);
break;
case 3: // Update Applicant details
Applicant.updateApplicant(applicants);
Applicant.writeApplicantsToFile(applicants, applicantFile);
break;
case 4: // Delete Applicant details
Applicant.deleteApplicant(applicants);
Applicant.writeApplicantsToFile(applicants, applicantFile);
break;
default:
System.out.println("Invalid Option Selected.");
}
System.out.println("Continue in Applicant Menu? Enter YES to continue or NO to return to Main Menu.");
applicantOption = s.nextLine();
} while (applicantOption.equalsIgnoreCase("YES"));
break;
case 3:
System.out.println("Signing off. Returning to Stakeholder Menu...");
break;
default:
System.out.println("Invalid Option Selected.");
}
if (choice == 3) break;
}
break;
case 2: // HR ka case
if (!h.login()) {
System.out.println("Access Denied, Exiting...");
return; // Agr login fail hogaya toh program Exit hojye ga yahan
}
// HR applicants ki details dekh skta hai or unka status update kr skta hai
do {
m.HRmenu();
String hrChoice = s.nextLine();
switch (hrChoice) {
case "1":
h.viewApplicants(applicants);
break;
case "2":
h.updateApplicantStatus(applicants);
break;
case "3":
System.out.println("HR Team :" + h.getTeamName());
break;
case "4":
System.out.println("Signing off. Returning to Stakeholder Menu...");
break;
default:
System.out.println("Invalid option. Please try again.");
}
} while (!hrChoice.equals("4"));
break;
case 3: // Hiring Department ka case
if (!HD.login()) {
System.out.println("Access Denied, Exiting...");
return; // Agr login fail hogaya toh program Exit hojye ga yahan
}
m.HiringDepartmentmenu();
choice = s.nextInt();
s.nextLine();
switch (choice) {
case 1:
h.viewApplicants(applicants);
break;
case 2:
h.updateApplicantStatus(applicants);
break;
case 3:
System.out.println("Signing off. Returning to Stakeholder Menu...");
break;
default:
System.out.println("Invalid option. Please try again.");
}
break;
case 4:
System.out.println("Shutting Down...");
System.exit(0);
default:
System.out.println("Invalid Stakeholder Option Selected. Exiting...");
return; // Agar selection invalid hoi program exit hojye ga
}
}
}
}