public int availableManagerInLocation(string locationName) { locationControl = new LocationControl(); employee = new Employee(); employeeDB = new EmployeeDB(); int locationID = locationControl.getEmployeeLocationID(locationName); employee.setLocationID(locationID); employeeDB.countManagerInLocation(employee); return(locationControl.getManagerNumbers() - employee.getNumberOfEmployee()); }
public void insertEmployee(string nationalID, string employeeName, string date, string position, double salary, string locationName, string sourceName) { employee = new Employee(); employeeDB = new EmployeeDB(); locationControl = new LocationControl(); sourceControl = new SourceControl(); employee.setNationalID(nationalID); employee.setName(employeeName); employee.setEmployDate(date); employee.setPosition(position); employee.setSalary(salary); int locationID = locationControl.getEmployeeLocationID(locationName); int sourceID = sourceControl.selectID(sourceName); employee.setLocationID(locationID); employee.setSourceID(sourceID); employeeDB.insertEmployee(employee); }