1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.kpme.tklm.time.timehourdetail.service;
17
18 import java.util.List;
19
20 import org.kuali.kpme.tklm.time.timeblock.TimeBlock;
21 import org.kuali.kpme.tklm.time.timehourdetail.TimeHourDetail;
22 import org.kuali.kpme.tklm.time.timehourdetail.dao.TimeHourDetailDao;
23
24 public class TimeHourDetailServiceImpl implements TimeHourDetailService {
25
26 TimeHourDetailDao timeHourDetailDao;
27
28 @Override
29 public TimeHourDetail getTimeHourDetail(String timeHourDetailId) {
30 return timeHourDetailDao.getTimeHourDetail(timeHourDetailId);
31 }
32
33 @Override
34 public TimeHourDetail saveTimeHourDetail(TimeBlock tb) {
35
36 TimeHourDetail td = new TimeHourDetail();
37
38 td.setTkTimeBlockId(tb.getTkTimeBlockId());
39 td.setEarnCode(tb.getEarnCode());
40 td.setHours(tb.getHours());
41 tb.setAmount(tb.getAmount());
42
43 timeHourDetailDao.saveOrUpdate(td);
44
45 return td;
46 }
47
48 public void setTimeHourDetailDao(TimeHourDetailDao timeHourDetailDao) {
49 this.timeHourDetailDao = timeHourDetailDao;
50 }
51 @Override
52 public List<TimeHourDetail> getTimeHourDetailsForTimeBlock(String timeBlockId) {
53 return this.timeHourDetailDao.getTimeHourDetailsForTimeBlock(timeBlockId);
54 }
55
56 public void removeTimeHourDetails(String timeBlockId) {
57 this.timeHourDetailDao.remove(timeBlockId);
58 }
59
60 @Override
61 public void removeTimeHourDetail(String timeHourDetailId) {
62 timeHourDetailDao.removeById(timeHourDetailId);
63 }
64 }