package com.lyt.action;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import com.lyt.bean.Worklog;
import com.lyt.service.WorklogService;
import com.lyt.util.Pager;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
public class WorklogAction extends ActionSupport {
/**
*
*/
private static final long serialVersionUID = 1L;
WorklogService worklogService;
public WorklogService getWorklogService() {
return worklogService;
}
public void setWorklogService(WorklogService worklogService) {
this.worklogService = worklogService;
}
private int pageSize=10;
private int pageNo=1;
private Integer id;
private String username;
private Integer year;
private Integer month;
private Integer day;
private String title;
private String description;
private String logtime;
public String worklogList(){
ActionContext act=ActionContext.getContext();
Pager pager=worklogService.list(act.getSession().get("username").toString(), pageSize, pageNo);
act.put("pager", pager);
return Action.SUCCESS;
}
public String worklogAdd(){
Map<String,String> map=new HashMap<String, String>();
map.put("year", new SimpleDateFormat("yyyy").format(new Date()));
map.put("month", new SimpleDateFormat("MM").format(new Date()));
map.put("day", new SimpleDateFormat("dd").format(new Date()));
ActionContext.getContext().put("date", map);
return Action.SUCCESS;
}
public String worklogInsert(){
Worklog record=new Worklog();
record.setUsername(ActionContext.getContext().getSession().get("username").toString());
record.setYear(year);
record.setMonth(month);
record.setDay(day);
record.setTitle(title);
record.setDescription(description);
record.setLogtime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
worklogService.insert(record);
this.worklogList();
return Action.SUCCESS;
}
public String worklogEdit(){
Worklog record=worklogService.select(id);
ActionContext.getContext().put("worklog", record);
return Action.SUCCESS;
}
public String worklogUpdate(){
Worklog record=new Worklog();
record.setId(id);
record.setUsername(ActionContext.getContext().getSession().get("username").toString());
record.setYear(year);
record.setMonth(month);
record.setDay(day);
record.setTitle(title);
record.setDescription(description);
record.setLogtime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
worklogService.update(record);
this.worklogList();
return Action.SUCCESS;
}
public String worklogDel(){
worklogService.delete(id);
this.worklogList();
return Action.SUCCESS;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public int getPageNo() {
return pageNo;
}
public void setPageNo(int pageNo) {
this.pageNo = pageNo;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public Integer getYear() {
return year;
}
public void setYear(Integer year) {
this.year = year;
}
public Integer getMonth() {
return month;
}
public void setMonth(Integer month) {
this.month = month;
}
public Integer getDay() {
return day;
}
public void setDay(Integer day) {
this.day = day;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getLogtime() {
return logtime;
}
public void setLogtime(String logtime) {
this.logtime = logtime;
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
企业信息管理系统 ssh2 (233个子文件)
WorklogAction.class 5KB
SmsDAOImpl.class 5KB
AddressAction.class 5KB
ScheduleAction.class 4KB
WorklogDAOImpl.class 4KB
ScheduleDAOImpl.class 4KB
AddressDAOImpl.class 4KB
MeetingAction.class 4KB
SmsAction.class 4KB
MeetingDAOImpl.class 4KB
NoticeDAOImpl.class 4KB
NoticeAction.class 4KB
Address.class 4KB
Pager.class 3KB
WorklogServiceTest.class 3KB
AddressServiceTest.class 3KB
MeetingServiceTest.class 3KB
ScheduleServiceTest.class 3KB
NoticeServiceTest.class 3KB
SmsServiceTest.class 3KB
Worklog.class 3KB
RegisterAction.class 2KB
UserDAOImpl.class 2KB
Meeting.class 2KB
Sms.class 2KB
Schedule.class 2KB
HibernateSessionFactory.class 2KB
Notice.class 2KB
LoginAction.class 2KB
User.class 2KB
SmsServiceImpl.class 2KB
UserServiceTest.class 2KB
UserServiceImpl.class 2KB
ScheduleServiceImpl.class 1KB
WorklogServiceImpl.class 1KB
AddressServiceImpl.class 1KB
NoticeServiceImpl.class 1KB
MeetingServiceImpl.class 1KB
AllTests.class 922B
SmsService.class 498B
SmsDAO.class 461B
ScheduleService.class 403B
WorklogService.class 398B
AddressService.class 398B
MeetingService.class 380B
ScheduleDAO.class 366B
AddressDAO.class 361B
WorklogDAO.class 361B
NoticeService.class 357B
MeetingDAO.class 343B
NoticeDAO.class 338B
UserService.class 281B
UserDAO.class 268B
.classpath 1KB
org.eclipse.wst.common.component 481B
org.eclipse.wst.jsdt.ui.superType.container 49B
mm_spa.css 3KB
validatorTidyMode.css 2KB
validatorAuto.css 1KB
validator.css 907B
tidymode.css 333B
bt.gif 2KB
onShow.gif 951B
onLoad.gif 781B
onCorrect.gif 634B
onSuccess.gif 634B
onFocus.gif 633B
onError.gif 633B
mm_product_sm.gif 464B
new.gif 360B
mm_bullet_yellow.gif 44B
mm_spacer.gif 43B
mm_bg_red.gif 43B
showCalendar.html 16KB
templement.html 5KB
index.html 307B
spring.jar 2.57MB
struts2-core-2.0.9.jar 2.1MB
hibernate3.jar 1.53MB
freemarker-2.3.8.jar 784KB
mysql-connector-java-5.0.4-bin.jar 484KB
xwork-2.0.4.jar 445KB
c3p0-0.8.5.jar 389KB
antlr-2.7.2.jar 350KB
log4j-1.2.9.jar 344KB
antlr.jar 344KB
dom4j-1.6.jar 306KB
dom4j-1.5.2.jar 305KB
standard.jar 287KB
cglib-2.1.jar 275KB
commons-collections-2.1.1.jar 171KB
commons-lang-2.0.jar 166KB
ognl-2.6.11.jar 164KB
junit-3.8.1.jar 118KB
commons-validator-1.3.0.jar 117KB
commons-beanutils-1.6.jar 116KB
commons-dbcp-1.2.1.jar 105KB
commons-chain-1.1.jar 88KB
oro-2.0.8.jar 64KB
ehcache-1.1.jar 46KB
共 233 条
- 1
- 2
- 3
资源评论
- yueyashan12013-10-23有问题,无法直接跑起来。
- rjlinpr2014-03-21学习参考用,虽然没法直接跑。
- 风fly2013-10-15学习有用,少些好多代码了
- 「已注销」2013-11-04多谢 还是感觉有一点作用额
mynnnn
- 粉丝: 2
- 资源: 14
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功