开发工具:eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
}
public boolean judge() {
if("".equals(movieNameText.getText())) {
JOptionPane.showMessageDialog(null, "电影名字不能为空");
return false;
}
if("".equals(movielangText.getText())) {
JOptionPane.showMessageDialog(null, "电影语言不能为空");
return false;
}
if("".equals(mlocaText.getText())) {
JOptionPane.showMessageDialog(null, "电影地址不能为空");
return false;
}
if("".equals(moviepicadreText.getText())) {
JOptionPane.showMessageDialog(null, "海报地址不能为空");
};
sessiontable.setModel(new DefaultTableModel(
new Object[][] {
},
new String[] {
"场次编号", "场厅编号", "影院编号","电影编号","开始时间","价格","剩余座位"
}
) {
boolean[] columnEditables = new boolean[] {
false, false, false, false,false,false,false
};
public boolean isCellEditable(int row, int column) {
return columnEditables[column];
}
}
protected void updateactionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
if(judge()) {
try {
int cId=Integer.parseInt(cIdtext.getText());
int capacity=Integer.parseInt(capacitytext.getText());
String hName=hallnametext.getText();
if(halrow!=-1) {
halllist.get(halrow).setCapacity(capacity);
halllist.get(halrow).setcId(cId);
if(cinemaservice.queryCinemaById(cId)!=null) {
halllist.get(halrow).sethName(hName);
if(hallservice.updateHall(halllist.get(halrow))) {
JOptionPane.showMessageDialog(null, "修改成功");
fillhalltableTable(halllist);
}
}else {
JOptionPane.showMessageDialog(null, "不存在此影院");
}
}
}catch (NumberFormatException e2) {
JOptionPane.showMessageDialog(null, "格式错误");
import java.awt.EventQueue;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.List;
import java.util.Vector;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JButton;
import javax.swing.JInternalFrame;
JOptionPane.showMessageDialog(null, "格式错误");
}
}
}
protected void updateactionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
if(judge()) {
try {
int cId=Integer.parseInt(cIdtext.getText());
int capacity=Integer.parseInt(capacitytext.getText());
String hName=hallnametext.getText();
if(halrow!=-1) {
halllist.get(halrow).setCapacity(capacity);
halllist.get(halrow).setcId(cId);
if(cinemaservice.queryCinemaById(cId)!=null) {
halllist.get(halrow).sethName(hName);
if(hallservice.updateHall(halllist.get(halrow))) {
JOptionPane.showMessageDialog(null, "修改成功");
fillhalltableTable(halllist);
}
}else {
JOptionPane.showMessageDialog(null, "不存在此影院");
}
}
JOptionPane.showMessageDialog(null, "删除影票成功");
ticketlist=ticketservice.queryAllTicket();
filltickettable(ticketlist);
}else {
JOptionPane.showMessageDialog(null, "删除影票失败");
}
}else {
JOptionPane.showMessageDialog(null, "请选择影票");
}
}
protected void tickettablemousePressed(MouseEvent me) {
// TODO Auto-generated method stub
trow=tickettable.getSelectedRow();
}
private void filltickettable(List<Ticket> ticketlist2) {
// TODO Auto-generated method stub
DefaultTableModel dtm=(DefaultTableModel) tickettable.getModel();
JOptionPane.showMessageDialog(null, "无法删除,此场次有用户购票");
}else {
if(sessionservice.delSession(sId)) {
JOptionPane.showMessageDialog(null, "删除成功");
sessionlist.remove(sessionrow);
fillsessiontable(sessionlist);
}else {
JOptionPane.showMessageDialog(null, "删除失败");
}
}
}else {
JOptionPane.showMessageDialog(null, "不存在此电影");
}
}else {
JOptionPane.showMessageDialog(null, "不存在此场厅");
import com.demo.service.impl.CinemaServiceImpl;
import com.demo.service.impl.CommentServiceImpl;
import com.demo.service.impl.HallServiceImpl;
import com.demo.service.impl.MovieServiceImpl;
import com.demo.service.impl.SessionServiceImpl;
import com.demo.service.impl.TicketServiceImpl;
import com.demo.service.impl.UserServiceImpl;
public class UserUi implements ActionListener {
private User user;
private UserService uo=new UserServiceImpl();
private MovieService mo = new MovieServiceImpl();
private TicketService ticketservice=new TicketServiceImpl();
private CommentService commentservice=new CommentServiceImpl();
private CinemaService cinemaservice=new CinemaServiceImpl();
private SessionService sessionservice=new SessionServiceImpl();
private HallService hallservice=new HallServiceImpl();
private int size=0;
private int size1=0;
private int size2=0;
private int size3=0;
private int size4=0;
private int row = -1;// 行
private int row1=-1;
private int defaultcard;
private Comment ccomment;
if("".equals(jpriceText.getText())) {
JOptionPane.showMessageDialog(null, "电影价格不能为空");
return false;
}
if("".equals(jtimeText.getText())) {
JOptionPane.showMessageDialog(null, "场次时间不能为空");
return false;
}
if("".equals(jremainText.getText())) {
JOptionPane.showMessageDialog(null, "剩余座位不能为空");
return false;
}
return true;
}
public void reset() {
jcIdText.setText("");
jhallText.setText("");
jmIdText.setText("");
jpriceText.setText("");
jtimeText.setText("");
jremainText.setText("");
}
}
}catch (NumberFormatException e2) {
JOptionPane.showMessageDialog(null, "格式错误");
}
}
}
protected void updateactionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
if(judge()) {
try {
int cId=Integer.parseInt(cIdtext.getText());
int capacity=Integer.parseInt(capacitytext.getText());
String hName=hallnametext.getText();
if(halrow!=-1) {
halllist.get(halrow).setCapacity(capacity);
halllist.get(halrow).setcId(cId);
if(cinemaservice.queryCinemaById(cId)!=null) {
halllist.get(halrow).sethName(hName);
if(hallservice.updateHall(halllist.get(halrow))) {
JOptionPane.showMessageDialog(null, "修改成功");
fillhalltableTable(halllist);
}
}else {
JOptionPane.showMessageDialog(null, "不存在此影院");
运行环境
Java≥6、MySQL≥5.5
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
技术框架
Java Swing MySQL
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
后台管理员:管理电影、影院、场次等
前台用户:查看电影、购票、评论等
eclipse/myeclipse
idea
后台管理员:
前台用户: