예제 #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;
 }