Package br.com.buyFast.model

Examples of br.com.buyFast.model.Administrator


  /**
   * Instancia um novo {@link AdminController}.
   */
  public AdminController() {
    this.employee = new Employee();
    this.admin = new Administrator();
  }
View Full Code Here


      return null;
    }
   
    try {
      if (this.admin == true) {
        Administrator administrator = new Administrator();
        administrator.setName(this.employee.getName());
        administrator.setCpf(this.employee.getCpf());
        administrator.setEmail(this.employee.getEmail());
        administrator.setPassword(this.employee.getPassword());
        administrator.setSecondName(this.employee.getSecondName());
        administrator.setUser(this.employee.getUser());
        // Removendo o funcionário para termos certeza que será cadastrado como admin.
        facade.removeEmployee(this.employee);
        // Persistindo como Administrador.
        facade.saveAdmin(administrator);
      } else {
        if (employee instanceof Administrator) {
          Administrator admin = (Administrator) this.employee;
          facade.removeAdmin(admin);
          Employee emp = new Employee();
          emp.setName(this.employee.getName());
          emp.setCpf(this.employee.getCpf());
          emp.setEmail(this.employee.getEmail());
View Full Code Here

   */
  public String delete() {
    Object obj = dataModel.getRowData();
    try {
      if (obj instanceof Administrator) {
        Administrator administrator = (Administrator) obj;
        facade.removeAdmin(administrator);
      } else {
        Employee employee = (Employee) obj;
        facade.removeEmployee(employee);
      }
View Full Code Here

TOP

Related Classes of br.com.buyFast.model.Administrator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.