예제 #1
0
  @Override
  public boolean login(String staffid, String password) {
    Staff staff = staffDao.findByStaffId(staffid);
    if (staff == null) {
      return false;
    }

    if (password.equals(staff.getPassword())) return true;
    else return false;
  }
예제 #2
0
  private Staff convertInfo(StaffInfo info) {
    Staff temp = new Staff();
    if (info.getId() != 0) {
      temp.setId(info.getId());
    }

    temp.setStaffid(info.getStaffid());
    temp.setPosition(info.getPosition());
    temp.setStaffname(info.getStaffname());
    temp.setPassword(info.getPassword());
    temp.setRemarks(info.getRemarks());
    return temp;
  }
예제 #3
0
 private StaffInfo convertEntity(Staff entity) {
   StaffInfo temp = new StaffInfo();
   temp.setId(entity.getId());
   temp.setStaffid(entity.getStaffid());
   temp.setPosition(entity.getPosition());
   temp.setStaffname(entity.getStaffname());
   temp.setPassword(entity.getPassword());
   temp.setRemarks(entity.getRemarks());
   return temp;
 }
예제 #4
0
 @Override
 public void addNewStaff(StaffInfo staffinfo) {
   Staff staff = convertInfo(staffinfo);
   staff.setStaffid(newStaffId(staffinfo.getPosition()));
   staffDao.create(staff);
 }