Professional Documents
Culture Documents
;private String id
{ )(public User
public User(String name, String id, String email, String password, String status, String
{ phoneNumber,String age, String department, String salary)
;this.id = id
;this.name = name
;this.password = password
;this.email = email
;this.phoneNumber = phoneNumber
;this.status = status
;return id
;this.id = id
;return name
;this.name = name
;return password
}
;this.password = password
;return email
;this.email = email
;return phoneNumber
;this.phoneNumber = phoneNumber
;return status
}
{ public void setStatus(String status)
;this.status = status
;return age
;this.age = age
;return department
;this.department = department
;return salary
}
{ public void setSalary(String salary)
;this.salary = salary
;return true
;return true
************************************************************************************************
public HRManager(String name,String id,String email, String password ,String status, String
phoneNumber ,String age ,String department ,String salary,String checkIn, String checkOut,int
{ numPermissions,int numHolidayDays)
;this.checkIn = checkIn
;this.checkOut = checkOut
;this.numPermissions = numPermissions
;this.numHolidayDays = numHolidayDays
;return checkIn
;this.checkIn = checkIn
;return checkOut
}
{ public void setCheckOut(String checkOut)
;this.checkOut = checkOut
;return numPermissions
;this.numPermissions = numPermissions
;return numHolidayDays
;this.numHolidayDays = numHolidayDays
static void addHR(String name,String id,String email, String password ,String status, String
phoneNumber ,String age ,String department ,String salary,String checkIn, String checkOut,int
{numPermissions,int numHolidayDays)
if (id != null &&name != null && password != null && email != null
;hrManagers.add(newHR)
{ else }
static void editHR(String name,String id,String email, String password ,String status, String
phoneNumber ,String age ,String department ,String salary,String checkIn, String checkOut,int
{numPermissions ,int numHolidayDays)
{ if (hrmanager.getId().equals(id) )
;hrmanager.setName(name)
;hrmanager.setPassword(password)
;hrmanager.setEmail(email)
;hrmanager.setPhoneNumber(phoneNumber)
;hrmanager.setStatus(status)
;hrmanager.setNumPermissions(numPermissions)
;hrmanager.setNumHolidayDays( numHolidayDays)
;hrmanager.setCheckIn(checkIn)
;hrmanager.setCheckOut(checkOut)
;break
;)(String id = in.next
;)(in.nextLine
{ if (hrManager.getId().equals(id) )
;hrManagers.remove(hrManager)
;break
manager.getEmail().equals(email) &&
{ )manager.getPhoneNumber().equals(phoneNumber)
;return manager
}
;return null
If the user wants the data in descending order, reverse the list //
{ if (!ascending)
;Collections.reverse(hrManagers)
;)"-----------------------"(System.out.println
;System.out.println("1.Add employee")
;System.out.println("2.edit employee")
;System.out.println("3.delete an employees")
{switch(choice)
:case 1
add employee //
;employees.add(newEmployee)
;break
:case 2
;break
:case 3
;break
:case 4
;break
:case 5
;break
}
*******************************************************************************************
public Employee( String userType, int numPermissions, int numHolidayDays, String checkIn,
String checkOut, String name, String id, String email, String password, String status, String
{ phoneNumber, String age, String department, String salary)
;this.userType = userType
;this.numPermissions = numPermissions
;this.numHolidayDays = numHolidayDays
;this.checkIn = checkIn
;this.checkOut = checkOut
;return employees
;Employee.employees = employees
;return userType
;this.userType = userType
;return numPermissions
}
{ public void setNumPermissions(int numPermissions)
;this.numPermissions = numPermissions
;return numHolidayDays
;this.numHolidayDays = numHolidayDays
;return checkIn
;this.checkIn = checkIn
;return checkOut
}
{ public void setCheckOut(String checkOut)
;this.checkOut = checkOut
static void addُEmployee( String userType, int numPermissions, int numHolidayDays, String
checkIn, String checkOut, String name, String id, String email, String password, String status,
{ String phoneNumber, String age, String department, String salary)
if (name != null && !name.isEmpty() && id != null && department!= null && !
{ department.isEmpty())
;employees.add(newEmployee)
{ else }
static void editEmployee( String userType, int numPermissions, int numHolidayDays, String
checkIn, String checkOut, String name, String id, String email, String password, String status,
{String phoneNumber, String age, String department,String salary)
{ if (employee.getId().equals(id) )
;employee.setName(name)
;employee.setPassword(password)
;employee.setEmail(email)
;employee.setPhoneNumber(phoneNumber)
;employee.setStatus(status)
;employee.setUserType(userType)
;employee.setNumPermissions(numPermissions)
;employee.setNumHolidayDays(numHolidayDays)
;employee.setCheckIn(checkIn)
;employee.setCheckOut(checkOut)
;break
;)(String id = in.next
;)(in.nextLine
{ if (employee.getId().equals(id) )
;employees.remove(employee)
;break
}
}
;return emp
;return null
{ if (!ascending)
;Collections.reverse(employees)
;System.out.println("Employee Email:"+employee.getEmail())
;System.out.println("Employee Password:"+employee.getPassword())
;System.out.println("Employee status:"+employee.getStatus())
;System.out.println("Employee Age:"+employee.getAge())
;System.out.println("Employee Department:"+employee.getDepartment())
;System.out.println("Employee Salary:"+employee.getSalary())
;)"========================================"(System.out.println
{ if (employee.getEmail().equals(email))
;found = true
;System.out.println(employee)
;break
{ if (!found)
**********************************************************************
{ public class Holiday
)id, user id, name, type, details, start date, end date, status( //
;private int id
public Holiday(int id, int userId, String name, String type, String details, int startDate, int
{ endtDate, int status)
;this.id = id
;this.userId = userId
;this.name = name
;this.type = type
;this.details = details
;this.startDate = startDate
;this.endtDate = endtDate
;this.status = status
;return id
}
;this.id = id
;return userId
;this.userId = userId
;return name
;this.name = name
;return type
}
{ public void setType(String type)
;this.type = type
;return details
;this.details = details
;return startDate
;this.startDate = startDate
;return endtDate
}
{ public void setEndtDate(int endtDate)
;this.endtDate = endtDate
;return status
;this.status = status
***************************************************************************************************
;private int id
;this.id = id
;this.userId = userId
;this.name = name
;this.type = type
;this.details = details
;this.startDate = startDate
;this.endtDate = endtDate
;return id
;this.id = id
;return userId
;this.userId = userId
}
;return name
;this.name = name
;return type
;this.type = type
;return details
;this.details = details
}
{ )(public int getStartDate
;return startDate
;this.startDate = startDate
;return endtDate
;this.endtDate = endtDate
;return status
;this.status = status
}
}