コード例 #1
0
ファイル: AdminBL.java プロジェクト: WeissGuertena/B425Gerage
 public boolean delete(
     String id,
     String name,
     String password,
     String identityID,
     String institutionID,
     enumSet.Position work)
     throws RemoteException {
   List<UserPO> userList = this.list;
   UserPO po = new UserPO(id, name, password, identityID, institutionID, work);
   for (UserPO temp : userList) {
     if (temp.getId().equals(id) && temp.getName().equals(name)) {
       po = UserDS.find(identityID);
       UserDS.delete(po);
       userList.remove(po);
     }
   }
   return true;
 }
コード例 #2
0
ファイル: AdminBL.java プロジェクト: WeissGuertena/B425Gerage
  public AdminBL() throws RemoteException {
    try {
      RMIHelper.initUserDataService();
      UserDS = RMIHelper.getUserDataService();
      list = UserDS.getUsers();

    } catch (ClientInitException e) {
      e.printStackTrace();
    }
  }
コード例 #3
0
  @Override
  public ArrayList<LogVO> logmessage(String office, String time) {
    // TODO Auto-generated method stub
    UserDataService userdata = datafactory.getUserData();
    logVOs = new ArrayList<LogVO>();
    try {
      logs = userdata.findsLogsPO(office, time);
    } catch (RemoteException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    for (LogPO po : logs) {
      LogVO vo = new LogVO(po.getTime(), po.getOffice(), po.getUseuId(), po.getLogmessage());
      logVOs.add(vo);
    }

    return logVOs;
  }
コード例 #4
0
  @Override
  public ResultMessage addMessage(String userId, String logmessage) {
    // TODO Auto-generated method stub

    PManagementController pm = new PManagementController();

    StaffVO staffVO = pm.select(userId);

    UserDataService userdata = datafactory.getUserData();

    Date dt = new Date();
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
    String timeOfLog = sdf.format(dt);

    LogPO log = new LogPO(timeOfLog, staffVO.getWorkPlaceNumber(), userId, logmessage);

    try {
      return userdata.insertLogPO(log);
    } catch (RemoteException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      return ResultMessage.FAIL;
    }
  }
コード例 #5
0
ファイル: AdminBL.java プロジェクト: WeissGuertena/B425Gerage
 public boolean add(
     String id,
     String name,
     String password,
     String identityID,
     String institutionID,
     enumSet.Position work)
     throws RemoteException {
   List<UserPO> userList = this.list;
   UserPO po = new UserPO(id, name, password, identityID, institutionID, work);
   for (UserPO temp : userList) {
     if (temp.getId().equals(po)) {
       return false;
     }
   }
   userList.add(po);
   UserDS.add(po);
   return true;
 }