电影院售票管理系统
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
电影院售票管理系统
package util;
public class DomUtil {
public static Document getDocument(String fileAddress){
Document doc=null;
try {
DocumentBuilderFactory dbf=();
if ())) { etChildNodes();
for (int j = 0; j < (); j++) { etAttribute("value");
if ())) {ppendChild(seat);
(docTickets, ticketsAddress);
return;
}
}
}
if(!existTime){ppendChild(myTime);
}
}
}
}
}
quals(strElementName)){
if(name)){
filmName=strText;
exist=true;
}
else{quals(strElementName)){
myPoster=strText;
}else if("Director".equals(strElementName)){
}
else{etElementsByTagName("Item");
for(int j=0;j<();j++){etTextContent();
if())){etParentNode().removeChild(j));
}
}
}
if(!existItem){
return false;etElementsByTagName("Name");
myPrice=strText;
}
else if("Schedule".equals(strElementName)){
NodeList scheduleChildList=();
for(int k=0;k<();k++){
if (k) instanceof Element) {
id++;
Element scheduleChild = (Element) (k);
myPoster=strText;
}else if("Director".equals(strElementName)){
myDirector=strText;
}else if("Acotr".equals(strElementName)){
myAcotr=strText;
}
else if("Type".equals(strElementName)){
*找到该电影并修改对应的场次
*/
existItem=true;
(j).setTextContent(value);
}
}
}
if(!existItem){
return 2;
}
}
(docFilms,filmsAddress);
return 0;
}
}
return 1;
}
public void buyTicket(Film film,String index,String ticketType){
myPrice=strText;
}
}
}
id++;
Film film=new Film(id,filmName,myPoster,myDirector,myAcotr,myType,
myPrice,myItem);
(film);
}
}
}
}
if(exist){
return listFilm;
}
else{
return null;
/*
*创建Seat节点,添加ticket属性,添加文本内容;
*/
Element seat=("Seat");
("ticket", ticketType);
Node seatText=(index);
(seatText);
boolean existName=false;
for (int i = 0; i < (); i++) { etAttribute("value");
quals(index)){
return true;
}
else
return false;
}
}
package entity;
public class Film {
private int id; quals(strElementName)){
filmName=strText;
}else if("Poster".equals(strElementName)){
DocumentBuilder db=();
doc=(fileAddress);
} catch (Exception e) {
();
}
if(doc!=null)
return doc;
else return null;
}
public static void saveDocument(Document doc,String fileAddress){
case 3:delFilm();break;
case 4:upFilm();break;
case 5:getTicket();break;
case 6:break;
case 7:(0);break;
default :
();
break;
}
}
public void getAll() {
int num=0;
if (k) instanceof Element) {
id++;
Element scheduleChild = (Element) (k);
Film film=new Film(id,filmName,myPoster,myDirector,myAcotr,myType,
myPrice,());
(film);
}
}
public void addFilm(Film film) {
Element movie=("Movie");
Element name=("Name");
Node Textname=());
(Textname);
(name);
Element poster=("Poster");
Node Textposter=());
(Textposter);
(poster);
Element director=("Director");
Node Textdirector=());
(Textdirector);
(director);
Element actor=("Acotr");
Node Textactor=());
(Textactor);
myDirector=strText;
}else if("Acotr".equals(strElementName)){
myAcotr=strText;
}
else if("Type".equals(strElementName)){
myType=strText;
}
else if("Price".equals(strElementName)){
Element item=("Item");
Node Textitem=());
(Textitem);
(item);
(schedule);
("Film").item(0).appendChild(movie);
(docFilms,filmsAddress);
}
public boolean delateFilm(Film film) {
myDirector=strText;
}else if("Acotr".equals(strElementName)){
myAcotr=strText;
}
else if("Type".equals(strElementName)){
myType=strText;
}
else if("Price".equals(strElementName)){
break;
}
();
}
}
package ;
import ;
import ;
import ;
public class AdminLogin implements AdminService{
Scanner input=new Scanner;
List<Film> list=new ArrayList<Film>();
String itemTime=(j).getTextContent();
if(time)){quals(strElementName)){
filmName=strText;
}else if("Posteቤተ መጻሕፍቲ ባይዱ".equals(strElementName)){
myPoster=strText;
}else if("Director".equals(strElementName)){
(actor);
Element type=("Type");
Node Texttype=());
(Texttype);
(type);
Element price=("Price");
Node Textprice=());
(Textprice);
(price);
Element schedule=("Schedule");
Film film=new Film(id,filmName,myPoster,myDirector,myAcotr,myType,
myPrice,());
(film);
}
}
}
}
}
etElementsByTagName("Item");
for(int j=0;j<();j++){
if (j) instanceof Element) {
String name=();
String poster=();
String director=();
String acotr=();
String type=();
String price=();
String item=();
Film film=new Film(name, poster, director, acotr, type, price, item);
myType=strText;
}
else if("Price".equals(strElementName)){
myPrice=strText;
}
else if("Schedule".equals(strElementName)){
NodeList scheduleChildList=();
for(int k=0;k<();k++){
FilmDaoImpl fdi=new FilmDaoImpl();
public void menu() {
"4:修改电影;5:售票查询;6:返回上一层;7:退出;");
int chose=();
switch(chose){
case 1:getAll() ;break;
case 2:addFilm();break;
for(int i=0;i<();i++){etElementsByTagName("Name");
Node nameNode=(0);
String moveName=();
if().equals(moveName)){quals("all")){etParentNode().removeChild(i));
NodeList itemList = ((Element) (i)).getElementsByTagName("Item");
for (int j = 0; j < (); j++) {
if (j) instanceof Element) {
etTextContent();
if ())) {
/*
tart();
}
}
package service;
public interface UserService {
public void menu();
enu();
break;
case 2:
new UserLogin().menu();
break;
case 3:(0);break;
default :
();
+"\t"+"影片类型"+"\t"+"票价"+"\t"+"播放时间");
list=();
for(Film film:list){
num++;
+()+"\t"+()+"\t"
+()+"\t"+()+"\t"
+()+"\t"+());
}
();
menu();
}
public void addFilm() {
Node nameNode = (0);
String moveName = ();
if ().equals(moveName)) {
if (!("Item")) {etElementsByTagName(property);
(0).setTextContent(value);
}
else {
boolean existItem=false;
package util;
public class DomUtil {
public static Document getDocument(String fileAddress){
Document doc=null;
try {
DocumentBuilderFactory dbf=();
if ())) { etChildNodes();
for (int j = 0; j < (); j++) { etAttribute("value");
if ())) {ppendChild(seat);
(docTickets, ticketsAddress);
return;
}
}
}
if(!existTime){ppendChild(myTime);
}
}
}
}
}
quals(strElementName)){
if(name)){
filmName=strText;
exist=true;
}
else{quals(strElementName)){
myPoster=strText;
}else if("Director".equals(strElementName)){
}
else{etElementsByTagName("Item");
for(int j=0;j<();j++){etTextContent();
if())){etParentNode().removeChild(j));
}
}
}
if(!existItem){
return false;etElementsByTagName("Name");
myPrice=strText;
}
else if("Schedule".equals(strElementName)){
NodeList scheduleChildList=();
for(int k=0;k<();k++){
if (k) instanceof Element) {
id++;
Element scheduleChild = (Element) (k);
myPoster=strText;
}else if("Director".equals(strElementName)){
myDirector=strText;
}else if("Acotr".equals(strElementName)){
myAcotr=strText;
}
else if("Type".equals(strElementName)){
*找到该电影并修改对应的场次
*/
existItem=true;
(j).setTextContent(value);
}
}
}
if(!existItem){
return 2;
}
}
(docFilms,filmsAddress);
return 0;
}
}
return 1;
}
public void buyTicket(Film film,String index,String ticketType){
myPrice=strText;
}
}
}
id++;
Film film=new Film(id,filmName,myPoster,myDirector,myAcotr,myType,
myPrice,myItem);
(film);
}
}
}
}
if(exist){
return listFilm;
}
else{
return null;
/*
*创建Seat节点,添加ticket属性,添加文本内容;
*/
Element seat=("Seat");
("ticket", ticketType);
Node seatText=(index);
(seatText);
boolean existName=false;
for (int i = 0; i < (); i++) { etAttribute("value");
quals(index)){
return true;
}
else
return false;
}
}
package entity;
public class Film {
private int id; quals(strElementName)){
filmName=strText;
}else if("Poster".equals(strElementName)){
DocumentBuilder db=();
doc=(fileAddress);
} catch (Exception e) {
();
}
if(doc!=null)
return doc;
else return null;
}
public static void saveDocument(Document doc,String fileAddress){
case 3:delFilm();break;
case 4:upFilm();break;
case 5:getTicket();break;
case 6:break;
case 7:(0);break;
default :
();
break;
}
}
public void getAll() {
int num=0;
if (k) instanceof Element) {
id++;
Element scheduleChild = (Element) (k);
Film film=new Film(id,filmName,myPoster,myDirector,myAcotr,myType,
myPrice,());
(film);
}
}
public void addFilm(Film film) {
Element movie=("Movie");
Element name=("Name");
Node Textname=());
(Textname);
(name);
Element poster=("Poster");
Node Textposter=());
(Textposter);
(poster);
Element director=("Director");
Node Textdirector=());
(Textdirector);
(director);
Element actor=("Acotr");
Node Textactor=());
(Textactor);
myDirector=strText;
}else if("Acotr".equals(strElementName)){
myAcotr=strText;
}
else if("Type".equals(strElementName)){
myType=strText;
}
else if("Price".equals(strElementName)){
Element item=("Item");
Node Textitem=());
(Textitem);
(item);
(schedule);
("Film").item(0).appendChild(movie);
(docFilms,filmsAddress);
}
public boolean delateFilm(Film film) {
myDirector=strText;
}else if("Acotr".equals(strElementName)){
myAcotr=strText;
}
else if("Type".equals(strElementName)){
myType=strText;
}
else if("Price".equals(strElementName)){
break;
}
();
}
}
package ;
import ;
import ;
import ;
public class AdminLogin implements AdminService{
Scanner input=new Scanner;
List<Film> list=new ArrayList<Film>();
String itemTime=(j).getTextContent();
if(time)){quals(strElementName)){
filmName=strText;
}else if("Posteቤተ መጻሕፍቲ ባይዱ".equals(strElementName)){
myPoster=strText;
}else if("Director".equals(strElementName)){
(actor);
Element type=("Type");
Node Texttype=());
(Texttype);
(type);
Element price=("Price");
Node Textprice=());
(Textprice);
(price);
Element schedule=("Schedule");
Film film=new Film(id,filmName,myPoster,myDirector,myAcotr,myType,
myPrice,());
(film);
}
}
}
}
}
etElementsByTagName("Item");
for(int j=0;j<();j++){
if (j) instanceof Element) {
String name=();
String poster=();
String director=();
String acotr=();
String type=();
String price=();
String item=();
Film film=new Film(name, poster, director, acotr, type, price, item);
myType=strText;
}
else if("Price".equals(strElementName)){
myPrice=strText;
}
else if("Schedule".equals(strElementName)){
NodeList scheduleChildList=();
for(int k=0;k<();k++){
FilmDaoImpl fdi=new FilmDaoImpl();
public void menu() {
"4:修改电影;5:售票查询;6:返回上一层;7:退出;");
int chose=();
switch(chose){
case 1:getAll() ;break;
case 2:addFilm();break;
for(int i=0;i<();i++){etElementsByTagName("Name");
Node nameNode=(0);
String moveName=();
if().equals(moveName)){quals("all")){etParentNode().removeChild(i));
NodeList itemList = ((Element) (i)).getElementsByTagName("Item");
for (int j = 0; j < (); j++) {
if (j) instanceof Element) {
etTextContent();
if ())) {
/*
tart();
}
}
package service;
public interface UserService {
public void menu();
enu();
break;
case 2:
new UserLogin().menu();
break;
case 3:(0);break;
default :
();
+"\t"+"影片类型"+"\t"+"票价"+"\t"+"播放时间");
list=();
for(Film film:list){
num++;
+()+"\t"+()+"\t"
+()+"\t"+()+"\t"
+()+"\t"+());
}
();
menu();
}
public void addFilm() {
Node nameNode = (0);
String moveName = ();
if ().equals(moveName)) {
if (!("Item")) {etElementsByTagName(property);
(0).setTextContent(value);
}
else {
boolean existItem=false;