public void delete(StorageOutFormPO po) throws RemoteException { // TODO Auto-generated method stub System.out.println("Delete StorageOutFormPO Start!!"); if (po == null) { throw new IllegalArgumentException(); } ioHelper = new IOHelper(); allStorageOutForm = ioHelper.readFromFile(file); System.out.println(po.getNO()); allStorageOutForm.remove(po.getNO()); ioHelper.writeToFile(allStorageOutForm, file); }
@SuppressWarnings("unchecked") public void insert(StorageOutFormPO po) throws RemoteException { // TODO Auto-generated method stub System.out.println("Insert StorageOutFormPO Start!!"); ioHelper = new IOHelper(); allStorageOutForm = ioHelper.readFromFile(file); SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmss"); System.out.println(df.format(new Date())); po.setNO(df.format(new Date())); allStorageOutForm.put(po.getNO(), po); System.out.println(po.getNO()); ioHelper.writeToFile(allStorageOutForm, file); System.out.println("Add StorageOutFormPO Over!!"); }
public StorageOutFormPO find(String NO) throws RemoteException { // TODO Auto-generated method stub System.out.println("Find StorageOutFormPO Start!!"); ioHelper = new IOHelper(); allStorageOutForm = ioHelper.readFromFile(file); if (allStorageOutForm.containsKey(NO)) { StorageOutFormPO po = (StorageOutFormPO) allStorageOutForm.get(NO); System.out.println(po.getNO()); System.out.println("Find StorageOutFormPO Over!!"); return po; } else { System.out.print("exception"); } return null; }