Package sn.unitech.stock.metier

Source Code of sn.unitech.stock.metier.ConnexionM

package sn.unitech.stock.metier;

import java.util.List;
import java.util.Map;

import sn.unitech.stock.dao.SysUsersDao;
import sn.unitech.stock.dao.iface.ISysUsersDao;
import sn.unitech.stock.entity.SysUsers;
import sn.unitech.stock.entity.SysUsersId;
import sn.unitech.stock.metier.iface.IConnexionM;

@SuppressWarnings("unchecked")
public class ConnexionM implements IConnexionM{
public ISysUsersDao  iuser=new SysUsersDao ();
 
  public boolean connexion(SysUsers user,String password){
    //user=(SysUsers) iuser.find(SysUsers.class, new SysUsersId(user.getId().getIdUser(),user.getId().getIdAdherent()), null);
    if(user==null)return false;
  //  System.out.println("password :"+util.getPasswd()+" "+ToolsMetier.getToolsMetier().encodePassword(password));
    if(new String(user.getPasswd()).equals(password)){
      return true;
    }
    else{
      return false;
    }
  }
 
  public SysUsers findUser(SysUsers user){
    return (SysUsers) iuser.find(SysUsers.class, new SysUsersId(user.getId().getIdUser(),user.getId().getIdAdherent()), null);
  }

  @Override
  public List getAuthorizedMenu(String jpql,Map param) {
    return iuser.getResultList(jpql, null, param);
  }
}
TOP

Related Classes of sn.unitech.stock.metier.ConnexionM

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.