-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSearchEmployee.java
More file actions
46 lines (40 loc) · 2.28 KB
/
SearchEmployee.java
File metadata and controls
46 lines (40 loc) · 2.28 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
import javax.sound.midi.Soundbank;
import java.util.Scanner;
interface iSearchEmployee {
void searchEmployee(AddEmployee empInfo);
}
public class SearchEmployee implements iSearchEmployee {
Scanner s = new Scanner(System.in);
public void searchEmployee(AddEmployee empInfo){
boolean empFound = false;
System.out.println("SEARCH EMPLOYEE\n");
System.out.print("Enter your Employee Number for which you want to edit the information: ");
String inputEmpNum = s.nextLine();
for (int i=0 ; i<empInfo.addEmp.size() ; i++){
if(inputEmpNum.equals(empInfo.addEmp.get(i).employeeNum)){
System.out.println("Employee found!\n");
System.out.println("Employee Details: \n");
System.out.println("Employee Number: " + empInfo.addEmp.get(i).getEmployeeNum());
System.out.println("Employee Name: " + empInfo.addEmp.get(i).getEmployeeName());
System.out.println("Father's Name: " + empInfo.addEmp.get(i).getFatherName());
System.out.println("Contact Number: " + empInfo.addEmp.get(i).getContactNum());
System.out.println("Qualification: " + empInfo.addEmp.get(i).getQualification());
System.out.println("Date of Joining: " + empInfo.addEmp.get(i).getDoj());
System.out.println("Date of End: " + empInfo.addEmp.get(i).getDoe());
System.out.println("Date of Birth: " + empInfo.addEmp.get(i).getDob());
System.out.println("Address: " + empInfo.addEmp.get(i).getAddress());
System.out.println("Religion: " + empInfo.addEmp.get(i).getReligion());
System.out.println("Designation: " + empInfo.addEmp.get(i).getDesignation());
System.out.println("Department: " + empInfo.addEmp.get(i).getDept());
System.out.println("CNIC number: " + empInfo.addEmp.get(i).getCnic());
empFound = true;
break;
}
}
if (!empFound){
System.out.println("Error: Employee not found.");
}
System.out.println("\nX-------------------------X-------------------------------X\n");
System.out.println("Returning back to Main Menu...\n");
}
}