public void createAdminUser(Admin adminUser) {
   if (adminUser != null) {
     // Check if adminUser exists in db.
     Admin dbAdmin = adminDao.findByUserName(adminUser.getUsername());
     if (dbAdmin == null) {
       adminUser.setCreatedDate(DateUtil.getCurrentDate());
       adminDao.save(adminUser);
     }
   }
 }
 public List<Admin> listAdminUsers() {
   return adminDao.findAll();
 }
 public Admin getAdminUserById(int adminId) {
   return adminDao.findById(adminId);
 }
 public Admin getAdminByUserName(String userName) {
   String userRole = null;
   return adminDao.findAdminByUserNameAndRole(userName, userRole);
 }
  public void updateAdminUser(Admin updatedAdminUser) {

    adminDao.update(updatedAdminUser);
  }
 public List<Admin> getAdminListExcludingLoginAdmin(int adminId) {
   List<Admin> adminList;
   adminList = adminDao.getAdminListExcludingLoginAdmin(adminId);
   if (adminList == null) adminList = new ArrayList<Admin>();
   return adminList;
 }
 public List<Admin> getAdminByRoleName(String roleName) {
   String userRole = roleName;
   List<Admin> adminList = adminDao.findAllAdminByRole(userRole);
   if (adminList == null) adminList = new ArrayList<Admin>();
   return adminList;
 }