8182838485868788
} } public void add() { User obj = (User) viewToObj(null); UserDao dao = new UserDao(); add(dao, obj); }
8788899091929394959697
add(dao, obj); } public void delete() { UserForm obj = (UserForm) objListbox.getSelectedItem().getValue(); UserDao dao = new UserDao(); delete(dao, obj); // empty all fields UserForm emptyObj = new UserForm(); objToView(emptyObj);
160161162163164165166167
refreshObjEntities("User.getAll", objListRenderer); } public void update() { UserForm obj = (UserForm) objListbox.getSelectedItem().getValue(); UserDao dao = new UserDao(); update(dao, obj); }
119120121122123124125126127128129130
// SAVE THE MD5 VALUE OF CLIENT'S PASSWORD if (obj.getPasswd() != null) { obj.setPasswd(Utility.getInstance().md5(obj.getPasswd())); } UserDao dao = new UserDao(); dao.create(obj); dao = null; refreshObjEntities(); }
146147148149150151152153154155156157
// encode password to md5 if (obj.getPasswd() != null) { obj.setPasswd(Utility.getInstance().md5(obj.getPasswd())); } UserDao dao = new UserDao(); dao.update(obj); dao = null; refreshObjEntities(); }
175176177178179180181182183184185186
} dutyList = null; obj = (User) viewToObj(item.getValue()); UserDao dao = new UserDao(); dao.delete(obj); dao = null; onCreate(); refreshObjEntities();
8384858687888990
8990919293949596979899
162163164165166167168169170171172
refreshObjEntities("User.getAll", objListRenderer); } public void update() { UserForm obj = (UserForm) objListbox.getSelectedItem().getValue(); UserDao dao = new UserDao(); update(dao, obj);