Package it.hotel.controller.user

Source Code of it.hotel.controller.user.UserController

/*
Copyright (C) European Community 2008 - Licensed under the EUPL V.1.0 (http://ec.europa.eu/idabc/en/document/6523)
*/

package it.hotel.controller.user;
import it.hotel.controller.hotel.HotelSimpleFormController;
import it.hotel.model.role.Role;
import it.hotel.model.user.IUser;
import it.hotel.model.user.manager.IUserManager;
import it.hotel.system.exception.SystemException;

/**
*
*
*/
public class UserController extends HotelSimpleFormController{

    /**
     * @throws
     * @return
     */
  //Metodo da sovrascrivere per il funzionamento custom del form
  protected void doSubmitAction(Object user) throws Exception {   
    this.addUser((IUser) user);
  }
 
  private void addUser(IUser user) throws SystemException{
    Role role = new Role();
    if(user.getStructureId() != 0){
      role.setName("albergatore");
      user.setRole(role);
    }else{
      role.setName("customer");
      user.setRole(role);
    }
    userManager.addUser(user);
  }


  private IUserManager userManager;

  public void setUserManager(IUserManager manager){
    this.userManager=manager;
 
}
TOP

Related Classes of it.hotel.controller.user.UserController

TOP
Copyright © 2018 www.massapi.com. 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.