Example #1
0
 public boolean add(User user) {
   return dbOperator.add(
       String.format(
           ADD_USER,
           user.getUser_id(),
           user.getUser_name(),
           user.getPwd(),
           user.getDepartment_id() > 0 ? user.getDepartment_id() : null,
           user.getStaff_position() != null ? "'" + user.getStaff_position() + "'" : null,
           user.getTotal_annual_leave() != 0 ? user.getTotal_annual_leave() : null));
 }
Example #2
0
 public boolean updateByAnnualleave(User user) {
   return dbOperator.update(
       String.format(UPDATE_USER_BY_ANNUALLEAVE, user.getTotal_annual_leave(), user.getUser_id()));
 }