-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNoticeAction.java
More file actions
98 lines (76 loc) · 2.02 KB
/
NoticeAction.java
File metadata and controls
98 lines (76 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
package com.nxdcms.action;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.nxdcms.dao.impl.*;
import com.nxdcms.entity.Notice;
import com.nxdcms.service.impl.*;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionSupport;
public class NoticeAction extends ActionSupport {
private Notice notice;
private String message;
private HttpServletRequest request;
private HttpServletResponse response;
Noticeserviceimpl usi = new Noticeserviceimpl();
Noticedaoimpl udi = new Noticedaoimpl();
List<Notice> list = new ArrayList<Notice>();
public List<Notice> getList() {
return list;
}
public void setList(List<Notice> list) {
this.list = list;
}
public String getMessage() {
return message;
}
public Notice getNotice() {
return notice;
}
public void setNotice(Notice notice) {
this.notice = notice;
}
public void setMessage(String message) {
this.message = message;
}
public String add() throws Exception {
if (usi.addNotice(notice)) {
message = "��ӹ���ɹ�";
return Action.SUCCESS;
} else {
message = "��ӹ���ʧ��";
return Action.ERROR;
}
}
public String del() throws Exception {
if (usi.delNotice(notice)) {
message = "ɾ������ɹ�";
return Action.SUCCESS;
} else {
message = "ɾ������ʧ��";
return Action.ERROR;
}
}
public String update() throws Exception {
if (usi.modifyNotice(notice)) {
message = "�Ĺ���ɹ�";
return Action.SUCCESS;
} else {
message = "�Ĺ���ʧ��";
return Action.ERROR;
}
}
public String list() throws Exception {
this.setList(udi.Query(notice));
return Action.SUCCESS;
}
public String mes() throws Exception{
this.setList(usi.showMessage(notice));
return Action.SUCCESS;
}
public String search() throws Exception{
this.setList(udi.Search(notice));
return Action.SUCCESS;
}
}