2008年3月14日星期五

LoadStaff.class //for loading and saving staff

Firstly, need to import data.LoadStaff class,


then

new a ArrayList for store the list of staff

Secondly, new a LoadStaff , using open() for open the staff.dat (local at the app. folder)

to get the list of staff, using getAllStaff() ;

after edited the list of staff,

must use saveAllStaff() for saving


eg:

import data.*;
ArrayList testStaffList=new ArrayList();
LoadStaff loadStaff=new loadStaff();
loadStaff.open();
testStaffList=loadStaff.getAllStaff();

testStaffList.get(i).setName("Hi");

loadStaff.saveAllStaff(testStaffList);

沒有留言: