基于javaweb+Swing+Java+MySQL电影院购票电影票管理系统(管理员、用户)

开发工具: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

20220319010212

idea

20220319010211

后台管理员:

20220319010153

20220319010154

20220319010155

20220319010156

20220319010157

20220319010158

20220319010159

20220319010200

20220319010201

20220319010202

20220319010203

前台用户:

20220319010204

20220319010205

20220319010206

20220319010207

20220319010208

20220319010209

20220319010210


  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值