1 package projectmanagement.presentation.employees; 2 3 import projectmanagement.*; 4 import projectmanagement.presentation.*; 5 6 import projectmanagement.spec.employee.*; 7 import projectmanagement.spec.*; 8 import com.lutris.appserver.server.httpPresentation.*; 9 import org.enhydra.xml.xmlc.XMLObject; 10 11 import org.w3c.dom.*; 12 import org.w3c.dom.html.*; 13 14 import java.sql.Date ; 15 import java.util.*; 16 17 23 public class Edit extends BasePO { 24 25 28 private static String FIRST_NAME = "txtFirstName"; 29 private static String LAST_NAME = "txtLastName"; 30 private static String LOGIN = "txtLogin"; 31 private static String PASSWORD = "txtPassword"; 32 private static String TITLE = "txtTitle"; 33 private static String TITLE_OF_COURTESY = "txtTitleOfCourtesy"; 34 private static String BIRTH_DATE_YYYY = "txtBirthDateYYYY"; 35 private static String BIRTH_DATE_MM = "txtBirthDateMM"; 36 private static String BIRTH_DATE_DD = "txtBirthDateDD"; 37 private static String HIRE_DATE_YYYY = "txtHireDateYYYY"; 38 private static String HIRE_DATE_MM = "txtHireDateMM"; 39 private static String HIRE_DATE_DD = "txtHireDateDD"; 40 private static String ADDRESS = "txtAddress"; 41 private static String CITY = "txtCity"; 42 private static String REGION = "txtRegion"; 43 private static String POSTAL_CODE = "txtPostalCode"; 44 private static String COUNTRY = "txtCountry"; 45 private static String HOME_PHONE = "txtHomePhone"; 46 private static String MOBILE_PHONE = "txtMobilePhone"; 47 private static String EMAIL = "txtEmail"; 48 private static String NOTES = "txtNotes"; 49 private static String IS_ADMIN = "cbxIsAdmin"; 50 51 private static String EMPLOYEE_ID = "employeeID"; 52 private static String CONTEXT_PAGE = "Context.po"; 53 private static String ADD = "add"; 54 private static String DELETE = "delete"; 55 private static String MODIFY = "modify"; 56 private static String DETAILS = "showDetailsPage"; 57 private static String EVENT = "event"; 58 59 62 protected int getRequiredAuthLevel() { 63 String event=""; 64 try { 65 event=this.getComms().request.getParameter(EVENT); 66 } catch (Exception ex) {} 67 68 if (event!=null && event.equalsIgnoreCase(DETAILS)) { 69 return 1; 70 } else { 71 return 2; 72 } 73 } 74 75 78 public XMLObject handleDefault() 79 throws HttpPresentationException { 80 return showModifyPage(null,false); 81 } 82 83 89 public XMLObject handleShowAddPage() 90 throws HttpPresentationException { 91 return showAddPage(null); 92 } 93 94 100 public XMLObject handleShowDetailsPage () 101 throws HttpPresentationException { 102 return showModifyPage(null,true); 103 } 104 105 111 public XMLObject handleModify() 112 throws HttpPresentationException { 113 String employeeID = this.getComms().request.getParameter(EMPLOYEE_ID); 114 Employee employee=null; 115 116 try { 118 119 EmployeeManager employeeManager = EmployeeManagerFactory.getEmployeeManager("projectmanagement.business.employee.EmployeeManagerImpl"); 120 employee = employeeManager.findEmployeeByID(employeeID); 121 122 } catch(Exception ex) { 123 this.getSessionData().setUserMessage("Please choose a valid employee to edit"); 124 throw new ClientPageRedirectException(CONTEXT_PAGE); 125 } 126 127 try { 128 if (!isExistingLogin(employee)) { 130 saveEmployee(employee); 131 throw new ClientPageRedirectException(CONTEXT_PAGE); 132 } else { 133 return showModifyPage("The login you've entered already exists !",false); 134 } 135 } catch(Exception ex) { 136 return showModifyPage("To modify this employee, you must fill out fields properly!",false); 137 } 138 } 139 140 146 public XMLObject handleAdd() 147 throws HttpPresentationException { 148 try { 149 150 EmployeeManager employeeManager = EmployeeManagerFactory.getEmployeeManager("projectmanagement.business.employee.EmployeeManagerImpl"); 151 Employee employee = employeeManager.getEmployee(); 152 153 if (!isExistingLogin(employee)) { 155 saveEmployee(employee); 156 throw new ClientPageRedirectException(CONTEXT_PAGE); 157 } else { 158 return showAddPage("The login you've entered already exists !"); 159 } 160 165 } catch(NullPointerException ex) { 166 return showAddPage("You cannot add employee while runing ProjectManagement_pres"); 167 } catch(Exception ex) { 168 return showAddPage("To add this employee, you must fill out fields properly!"); 169 } 170 } 171 172 178 public XMLObject handleDelete() 179 throws HttpPresentationException, ProjectManagementPresentationException { 180 String employeeID = this.getComms().request.getParameter(EMPLOYEE_ID); 181 182 try { 183 184 EmployeeManager employeeManager = EmployeeManagerFactory.getEmployeeManager("projectmanagement.business.employee.EmployeeManagerImpl"); 185 Employee employee = employeeManager.findEmployeeByID(employeeID); 186 187 String fullName = employee.getFirstName() + " " + employee.getLastName(); 188 employee.delete(); 189 this.getSessionData().setUserMessage("The employee, " + fullName + ", was deleted"); 190 } catch(Exception ex) { 193 this.getSessionData().setUserMessage("Please choose a valid employee to delete"); 194 } 195 throw new ClientPageRedirectException(CONTEXT_PAGE); 198 } 199 200 209 public XMLObject showModifyPage(String errorMsg,boolean disabled) 210 throws HttpPresentationException, ProjectManagementPresentationException { 211 212 String firstName = this.getComms().request.getParameter(FIRST_NAME); 213 String lastName = this.getComms().request.getParameter(LAST_NAME); 214 String login = this.getComms().request.getParameter(LOGIN); 215 String password = this.getComms().request.getParameter(PASSWORD); 216 String title = this.getComms().request.getParameter(TITLE); 217 String titleOfCourtesy = this.getComms().request.getParameter(TITLE_OF_COURTESY); 218 String birthDateYYYY = this.getComms().request.getParameter(BIRTH_DATE_YYYY); 219 String birthDateMM = this.getComms().request.getParameter(BIRTH_DATE_MM); 220 String birthDateDD = this.getComms().request.getParameter(BIRTH_DATE_DD); 221 String hireDateYYYY = this.getComms().request.getParameter(HIRE_DATE_YYYY); 222 String hireDateMM = this.getComms().request.getParameter(HIRE_DATE_MM); 223 String hireDateDD = this.getComms().request.getParameter(HIRE_DATE_DD); 224 String address = this.getComms().request.getParameter(ADDRESS); 225 String city = this.getComms().request.getParameter(CITY); 226 String region = this.getComms().request.getParameter(REGION); 227 String postalCode = this.getComms().request.getParameter(POSTAL_CODE); 228 String country = this.getComms().request.getParameter(COUNTRY); 229 String homePhone = this.getComms().request.getParameter(HOME_PHONE); 230 String mobilePhone = this.getComms().request.getParameter(MOBILE_PHONE); 231 String email = this.getComms().request.getParameter(EMAIL); 232 String notes = this.getComms().request.getParameter(NOTES); 233 String isAdmin = this.getComms().request.getParameter(IS_ADMIN); 234 235 String employeeID = this.getComms().request.getParameter(EMPLOYEE_ID); 236 EditHTML page = new EditHTML(); 238 239 Employee employee = null; 240 241 try { 242 243 EmployeeManager employeeManager = EmployeeManagerFactory.getEmployeeManager("projectmanagement.business.employee.EmployeeManagerImpl"); 244 employee = employeeManager.findEmployeeByID(employeeID); 245 246 247 252 } catch(NullPointerException ex) { 253 page.setTextErrorText("This is a default HTML page"); 254 return page; 255 } catch(ProjectManagementException ex) { 257 this.getSessionData().setUserMessage("Please choose a valid employee to edit"); 258 throw new ClientPageRedirectException(CONTEXT_PAGE); 259 } 260 261 try { 262 page.getElementEmployeeID().setValue(employee.getHandle()); 265 266 HTMLInputElement el=page.getElementTxtFirstName(); 267 el.setDisabled(disabled); 268 if (null != firstName && firstName.length() != 0) { 269 el.setValue(firstName); 270 } else { 271 el.setValue(employee.getFirstName()); 272 } 273 274 el=page.getElementTxtLastName(); 275 el.setDisabled(disabled); 276 if (null != lastName && lastName.length() != 0) { 277 el.setValue(lastName); 278 } else { 279 el.setValue(employee.getLastName()); 280 } 281 282 el=page.getElementTxtLogin(); 283 el.setDisabled(disabled); 284 if (!disabled) { 285 if (null != login && login.length() != 0) { 286 el.setValue(login); 287 } else { 288 el.setValue(employee.getLogin()); 289 } 290 } else { 291 el.getParentNode().getParentNode().getParentNode().removeChild(el.getParentNode().getParentNode()); 292 } 293 294 el=page.getElementTxtPassword(); 295 el.setDisabled(disabled); 296 if (!disabled) { 297 if (null != password && password.length() != 0) { 298 el.setValue(password); 299 } else { 300 el.setValue(employee.getPassword()); 301 } 302 } else { 303 el.getParentNode().getParentNode().getParentNode().removeChild(el.getParentNode().getParentNode()); 304 } 305 306 307 el=page.getElementTxtTitle(); 308 el.setDisabled(disabled); 309 if (null != title && title.length() != 0) { 310 el.setValue(title); 311 } else { 312 el.setValue(employee.getTitle()); 313 } 314 315 el=page.getElementTxtTitleOfCourtesy(); 316 el.setDisabled(disabled); 317 if (null != titleOfCourtesy && titleOfCourtesy.length() != 0) { 318 el.setValue(titleOfCourtesy); 319 } else { 320 el.setValue(employee.getTitleOfCourtesy()); 321 } 322 323 el=page.getElementTxtBirthDateYYYY(); 324 el.setDisabled(disabled); 325 if (null != birthDateYYYY && birthDateYYYY.length() != 0) { 326 el.setValue(birthDateYYYY); 327 } else { 328 Calendar cal=new GregorianCalendar(); 329 cal.setTime(employee.getBirthDate()); 330 el.setValue(String.valueOf(cal.get(Calendar.YEAR))); 331 } 332 333 el=page.getElementTxtBirthDateMM(); 334 el.setDisabled(disabled); 335 if (null != birthDateMM && birthDateMM.length() != 0) { 336 el.setValue(birthDateMM); 337 } else { 338 Calendar cal=new GregorianCalendar(); 339 cal.setTime(employee.getBirthDate()); 340 el.setValue(String.valueOf(cal.get(Calendar.MONTH)+1)); 341 } 342 343 el=page.getElementTxtBirthDateDD(); 344 el.setDisabled(disabled); 345 if (null != birthDateDD && birthDateDD.length() != 0) { 346 el.setValue(birthDateDD); 347 } else { 348 Calendar cal=new GregorianCalendar(); 349 cal.setTime(employee.getBirthDate()); 350 el.setValue(String.valueOf(cal.get(Calendar.DAY_OF_MONTH))); 351 } 352 353 el=page.getElementTxtHireDateYYYY(); 354 el.setDisabled(disabled); 355 if (null != hireDateYYYY && hireDateYYYY.length() != 0) { 356 el.setValue(hireDateYYYY); 357 } else { 358 Calendar cal=new GregorianCalendar(); 359 cal.setTime(employee.getHireDate()); 360 el.setValue(String.valueOf(cal.get(Calendar.YEAR))); 361 } 362 363 el=page.getElementTxtHireDateMM(); 364 el.setDisabled(disabled); 365 if (null != hireDateMM && hireDateMM.length() != 0) { 366 el.setValue(hireDateMM); 367 } else { 368 Calendar cal=new GregorianCalendar(); 369 cal.setTime(employee.getHireDate()); 370 el.setValue(String.valueOf(cal.get(Calendar.MONTH)+1)); 371 } 372 373 el=page.getElementTxtHireDateDD(); 374 el.setDisabled(disabled); 375 if (null != hireDateDD && hireDateDD.length() != 0) { 376 el.setValue(hireDateDD); 377 } else { 378 Calendar cal=new GregorianCalendar(); 379 cal.setTime(employee.getHireDate()); 380 el.setValue(String.valueOf(cal.get(Calendar.DAY_OF_MONTH))); 381 } 382 383 el=page.getElementTxtAddress(); 384 el.setDisabled(disabled); 385 if (null != address && address.length() != 0) { 386 el.setValue(address); 387 } else { 388 el.setValue(employee.getAddress()); 389 } 390 391 el=page.getElementTxtCity(); 392 el.setDisabled(disabled); 393 if (null != city && city.length() != 0) { 394 el.setValue(city); 395 } else { 396 el.setValue(employee.getCity()); 397 } 398 399 el=page.getElementTxtRegion(); 400 el.setDisabled(disabled); 401 if (null != region && region.length() != 0) { 402 el.setValue(region); 403 } else { 404 el.setValue(employee.getRegion()); 405 } 406 407 el=page.getElementTxtPostalCode(); 408 el.setDisabled(disabled); 409 if (null != postalCode && postalCode.length() != 0) { 410 el.setValue(postalCode); 411 } else { 412 el.setValue(employee.getPostalCode()); 413 } 414 415 el=page.getElementTxtCountry(); 416 el.setDisabled(disabled); 417 if (null != country && country.length() != 0) { 418 el.setValue(country); 419 } else { 420 el.setValue(employee.getCountry()); 421 } 422 423 el=page.getElementTxtHomePhone(); 424 el.setDisabled(disabled); 425 if (null != homePhone && homePhone.length() != 0) { 426 el.setValue(homePhone); 427 } else { 428 el.setValue(employee.getHomePhone()); 429 } 430 431 el=page.getElementTxtMobilePhone(); 432 el.setDisabled(disabled); 433 if (null != mobilePhone && mobilePhone.length() != 0) { 434 el.setValue(mobilePhone); 435 } else { 436 el.setValue(employee.getMobilePhone()); 437 } 438 439 el=page.getElementTxtEmail(); 440 el.setDisabled(disabled); 441 if (null != email && email.length() != 0) { 442 el.setValue(email); 443 } else { 444 el.setValue(employee.getEmail()); 445 } 446 447 el=page.getElementTxtNotes(); 449 el.setDisabled(disabled); 450 if (null != notes && notes.length() != 0) { 451 el.setValue(notes); 452 } else { 453 el.setValue(employee.getNotes()); 454 } 455 456 el=page.getElementCbxIsAdmin(); 457 el.setDisabled(disabled); 458 if (null != isAdmin) { 459 el.setChecked(true); 460 } else { 461 el.setChecked(false); 462 } 463 464 el=page.getElementBtnSave(); 465 el.setDisabled(disabled); 466 467 if (null == errorMsg) { 468 page.getElementErrorText().getParentNode().removeChild(page.getElementErrorText()); 469 } else { 470 page.setTextErrorText(errorMsg); 471 } 472 } catch(ProjectManagementException ex) { 473 throw new ProjectManagementPresentationException("Error populating page for employee editing", ex); 474 } 475 476 page.getElementEvent().setValue(MODIFY); 477 return page; 478 } 479 480 487 public XMLObject showAddPage(String errorMsg) 488 throws HttpPresentationException, ProjectManagementPresentationException { 489 490 String firstName = this.getComms().request.getParameter(FIRST_NAME); 491 String lastName = this.getComms().request.getParameter(LAST_NAME); 492 String login = this.getComms().request.getParameter(LOGIN); 493 String password = this.getComms().request.getParameter(PASSWORD); 494 String title = this.getComms().request.getParameter(TITLE); 495 String titleOfCourtesy = this.getComms().request.getParameter(TITLE_OF_COURTESY); 496 String birthDateYYYY = this.getComms().request.getParameter(BIRTH_DATE_YYYY); 497 String birthDateMM = this.getComms().request.getParameter(BIRTH_DATE_MM); 498 String birthDateDD = this.getComms().request.getParameter(BIRTH_DATE_DD); 499 String hireDateYYYY = this.getComms().request.getParameter(HIRE_DATE_YYYY); 500 String hireDateMM = this.getComms().request.getParameter(HIRE_DATE_MM); 501 String hireDateDD = this.getComms().request.getParameter(HIRE_DATE_DD); 502 String address = this.getComms().request.getParameter(ADDRESS); 503 String city = this.getComms().request.getParameter(CITY); 504 String region = this.getComms().request.getParameter(REGION); 505 String postalCode = this.getComms().request.getParameter(POSTAL_CODE); 506 String country = this.getComms().request.getParameter(COUNTRY); 507 String homePhone = this.getComms().request.getParameter(HOME_PHONE); 508 String mobilePhone = this.getComms().request.getParameter(MOBILE_PHONE); 509 String email = this.getComms().request.getParameter(EMAIL); 510 String notes = this.getComms().request.getParameter(NOTES); 511 String isAdmin = this.getComms().request.getParameter(IS_ADMIN); 512 513 EditHTML page = new EditHTML(); 515 516 HTMLInputElement el=page.getElementTxtFirstName(); 517 if (null != firstName) { 518 el.setValue(firstName); 519 } else { 520 el.setValue(""); 521 } 522 523 el=page.getElementTxtLastName(); 524 if (null != lastName) { 525 el.setValue(lastName); 526 } else { 527 el.setValue(""); 528 } 529 530 el=page.getElementTxtLogin(); 531 if (null != login) { 532 el.setValue(login); 533 } else { 534 el.setValue(""); 535 } 536 537 el=page.getElementTxtPassword(); 538 if (null != password) { 539 el.setValue(password); 540 } else { 541 el.setValue(""); 542 } 543 544 el=page.getElementTxtTitle(); 545 if (null != title) { 546 el.setValue(title); 547 } else { 548 el.setValue(""); 549 } 550 551 el=page.getElementTxtTitleOfCourtesy(); 552 if (null != titleOfCourtesy) { 553 el.setValue(titleOfCourtesy); 554 } else { 555 el.setValue(""); 556 } 557 558 559 el=page.getElementTxtBirthDateYYYY(); 560 if (null != birthDateYYYY) { 561 el.setValue(birthDateYYYY); 562 } else { 563 el.setValue(""); 564 } 565 566 el=page.getElementTxtBirthDateMM(); 567 if (null != birthDateMM) { 568 el.setValue(birthDateMM); 569 } else { 570 el.setValue(""); 571 } 572 573 el=page.getElementTxtBirthDateDD(); 574 if (null != birthDateDD) { 575 el.setValue(birthDateDD); 576 } else { 577 el.setValue(""); 578 } 579 580 el=page.getElementTxtHireDateYYYY(); 581 if (null != hireDateYYYY) { 582 el.setValue(hireDateYYYY); 583 } else { 584 el.setValue(""); 585 } 586 587 el=page.getElementTxtHireDateMM(); 588 if (null != hireDateMM) { 589 el.setValue(hireDateMM); 590 } else { 591 el.setValue(""); 592 } 593 594 el=page.getElementTxtHireDateDD(); 595 if (null != hireDateDD) { 596 el.setValue(hireDateDD); 597 } else { 598 el.setValue(""); 599 } 600 601 el=page.getElementTxtAddress(); 602 if (null != address) { 603 el.setValue(address); 604 } else { 605 el.setValue(""); 606 } 607 608 el=page.getElementTxtCity(); 609 if (null != city) { 610 el.setValue(city); 611 } else { 612 el.setValue(""); 613 } 614 615 el=page.getElementTxtRegion(); 616 if (null != region) { 617 el.setValue(region); 618 } else { 619 el.setValue(""); 620 } 621 622 el=page.getElementTxtPostalCode(); 623 if (null != postalCode) { 624 el.setValue(postalCode); 625 } else { 626 el.setValue(""); 627 } 628 629 el=page.getElementTxtCountry(); 630 if (null != country) { 631 el.setValue(country); 632 } else { 633 el.setValue(""); 634 } 635 636 el=page.getElementTxtHomePhone(); 637 if (null != homePhone) { 638 el.setValue(homePhone); 639 } else { 640 el.setValue(""); 641 } 642 643 el=page.getElementTxtMobilePhone(); 644 if (null != mobilePhone) { 645 el.setValue(mobilePhone); 646 } else { 647 el.setValue(""); 648 } 649 650 el=page.getElementTxtEmail(); 651 if (null != email) { 652 el.setValue(email); 653 } else { 654 el.setValue(""); 655 } 656 657 el=page.getElementTxtNotes(); 659 if (null != notes) { 660 el.setValue(notes); 661 } else { 662 el.setValue(""); 663 } 664 665 el=page.getElementCbxIsAdmin(); 666 if (null != isAdmin) { 667 el.setChecked(true); 668 } else { 669 el.setChecked(false); 670 } 671 672 673 if (null == errorMsg) { 674 page.getElementErrorText().getParentNode().removeChild(page.getElementErrorText()); 675 } else { 676 page.setTextErrorText(errorMsg); 677 } 678 679 return page; 680 } 681 682 689 protected void saveEmployee(Employee theEmployee) 690 throws HttpPresentationException { 691 692 String firstName = this.getComms().request.getParameter(FIRST_NAME); 693 String lastName = this.getComms().request.getParameter(LAST_NAME); 694 String login = this.getComms().request.getParameter(LOGIN); 695 String password = this.getComms().request.getParameter(PASSWORD); 696 String title = this.getComms().request.getParameter(TITLE); 697 String titleOfCourtesy = this.getComms().request.getParameter(TITLE_OF_COURTESY); 698 String birthDateYYYY = this.getComms().request.getParameter(BIRTH_DATE_YYYY); 699 String birthDateMM = this.getComms().request.getParameter(BIRTH_DATE_MM); 700 String birthDateDD = this.getComms().request.getParameter(BIRTH_DATE_DD); 701 String hireDateYYYY = this.getComms().request.getParameter(HIRE_DATE_YYYY); 702 String hireDateMM = this.getComms().request.getParameter(HIRE_DATE_MM); 703 String hireDateDD = this.getComms().request.getParameter(HIRE_DATE_DD); 704 String address = this.getComms().request.getParameter(ADDRESS); 705 String city = this.getComms().request.getParameter(CITY); 706 String region = this.getComms().request.getParameter(REGION); 707 String postalCode = this.getComms().request.getParameter(POSTAL_CODE); 708 String country = this.getComms().request.getParameter(COUNTRY); 709 String homePhone = this.getComms().request.getParameter(HOME_PHONE); 710 String mobilePhone = this.getComms().request.getParameter(MOBILE_PHONE); 711 String email = this.getComms().request.getParameter(EMAIL); 712 String notes = this.getComms().request.getParameter(NOTES); 713 String isAdmin = this.getComms().request.getParameter(IS_ADMIN); 714 715 if (isNullField(firstName) || isNullField(lastName) || isNullField(login) 716 || isNullField(password) || !areDateFieldsValid(birthDateYYYY,birthDateMM,birthDateDD) || 717 !areDateFieldsValid(hireDateYYYY,hireDateMM,hireDateDD)) { 718 throw new ProjectManagementPresentationException("Error adding employee",new Exception ()); 719 } 720 721 try { 722 String birthDate=birthDateYYYY+"-"+birthDateMM+"-"+birthDateDD; 723 String hireDate=hireDateYYYY+"-"+hireDateMM+"-"+hireDateDD; 724 theEmployee.setFirstName(firstName); 725 theEmployee.setLastName(lastName); 726 theEmployee.setLogin(login); 727 theEmployee.setPassword(password); 728 theEmployee.setTitle(title); 729 theEmployee.setTitleOfCourtesy(titleOfCourtesy); 730 theEmployee.setBirthDate(Date.valueOf(birthDate)); 731 theEmployee.setHireDate(Date.valueOf(hireDate)); 732 theEmployee.setAddress(address); 733 theEmployee.setCity(city); 734 theEmployee.setRegion(region); 735 theEmployee.setPostalCode(postalCode); 736 theEmployee.setCountry(country); 737 theEmployee.setHomePhone(homePhone); 738 theEmployee.setMobilePhone(mobilePhone); 739 theEmployee.setEmail(email); 740 theEmployee.setNotes(notes); 741 theEmployee.setIsAdmin(isAdmin!=null); 742 theEmployee.save(); 743 } catch(Exception ex) { 744 throw new ProjectManagementPresentationException("Error adding employee", ex); 745 } 746 } 747 748 private boolean isExistingLogin (Employee employee) { 749 boolean isExistingLogin=false; 750 String login = null; 751 try { 752 login=this.getComms().request.getParameter(LOGIN).trim(); 753 } catch (Exception exc) {} 754 if (!isNullField(login)) { 755 ProjectManagement pm=getApplication(); 756 if (pm.getAdminUsername().equals(login)) { 757 isExistingLogin=true; 758 } else { 759 try { 760 761 EmployeeManager employeeManager = EmployeeManagerFactory.getEmployeeManager("projectmanagement.business.employee.EmployeeManagerImpl"); 762 Employee user = employeeManager.findEmployee(login); 763 if (user!=null && (employee==null || !user.getHandle().equals(employee.getHandle()))) { 764 isExistingLogin=true; 765 } 766 } catch(ProjectManagementException ex) { 767 } 768 } 769 } 770 return isExistingLogin; 771 } 772 773 } 774 775 | Popular Tags |