@Override public void updateTbUser(int id, String department, String work) { TbUser user = new TbUser(); user = userdao.queryUser(id); user.setTbDepartment((TbDepartment) userdao.loadTbDepartment(department).get(0)); if (work.equals("ÔÚÖ°")) { user.setWorkingState(true); } else { user.setWorkingState(false); } userdao.updatesave(user); }
public void saveUser( String name, String password, String gender, String department, String email, long tel) { tbuserapplication = new TbUserApplication(); tbuserapplication.setName(name); tbuserapplication.setPassword(password); if (gender.equals("ÄÐ")) { tbuserapplication.setGender(true); } else { tbuserapplication.setGender(false); } tbuserapplication.setEmail(email); tbuserapplication.setPhone(tel); tbuserapplication.setTbDepartment((TbDepartment) userdao.loadTbDepartment(department).get(0)); userdao.addUser(tbuserapplication); }