Пример #1
0
 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);
     }
   }
 }
Пример #2
0
 public List<Admin> listAdminUsers() {
   return adminDao.findAll();
 }
Пример #3
0
 public Admin getAdminUserById(int adminId) {
   return adminDao.findById(adminId);
 }
Пример #4
0
 public Admin getAdminByUserName(String userName) {
   String userRole = null;
   return adminDao.findAdminByUserNameAndRole(userName, userRole);
 }
Пример #5
0
  public void updateAdminUser(Admin updatedAdminUser) {

    adminDao.update(updatedAdminUser);
  }
Пример #6
0
 public List<Admin> getAdminListExcludingLoginAdmin(int adminId) {
   List<Admin> adminList;
   adminList = adminDao.getAdminListExcludingLoginAdmin(adminId);
   if (adminList == null) adminList = new ArrayList<Admin>();
   return adminList;
 }
Пример #7
0
 public List<Admin> getAdminByRoleName(String roleName) {
   String userRole = roleName;
   List<Admin> adminList = adminDao.findAllAdminByRole(userRole);
   if (adminList == null) adminList = new ArrayList<Admin>();
   return adminList;
 }