电影院售票管理系统.docx
- 文档编号:6388198
- 上传时间:2023-01-05
- 格式:DOCX
- 页数:15
- 大小:17.51KB
电影院售票管理系统.docx
《电影院售票管理系统.docx》由会员分享,可在线阅读,更多相关《电影院售票管理系统.docx(15页珍藏版)》请在冰豆网上搜索。
电影院售票管理系统
Revisedat2pmonDecember25,2020.
电影院售票管理系统
packageutil;
publicclassDomUtil{
publicstaticDocumentgetDocument(StringfileAddress){
Documentdoc=null;
try{
DocumentBuilderFactorydbf=();
DocumentBuilderdb=();
doc=(fileAddress);
}catch(Exceptione){
();
}
if(doc!
=null)
returndoc;
elsereturnnull;
}
publicstaticvoidsaveDocument(Documentdoc,StringfileAddress){
tart();
}
}
packageservice;
publicinterfaceUserService{
publicvoidmenu();
enu();
break;
case2:
newUserLogin().menu();
break;
case3:
(0);break;
default:
();
break;
}
();
}
}
package;
import;
import;
import;
publicclassAdminLoginimplementsAdminService{
Scannerinput=newScanner;
List
FilmDaoImplfdi=newFilmDaoImpl();
publicvoidmenu(){
"4:
修改电影;5:
售票查询;6:
返回上一层;7:
退出;");
intchose=();
switch(chose){
case1:
getAll();break;
case2:
addFilm();break;
case3:
delFilm();break;
case4:
upFilm();break;
case5:
getTicket();break;
case6:
break;
case7:
(0);break;
default:
();
break;
}
}
publicvoidgetAll(){
intnum=0;
+"\t"+"影片类型"+"\t"+"票价"+"\t"+"播放时间");
list=();
for(Filmfilm:
list){
num++;
+()+"\t"+()+"\t"
+()+"\t"+()+"\t"
+()+"\t"+());
}
();
menu();
}
publicvoidaddFilm(){
Stringname=();
Stringposter=();
Stringdirector=();
Stringacotr=();
Stringtype=();
Stringprice=();
Stringitem=();
Filmfilm=newFilm(name,poster,director,acotr,type,price,item);
quals(index)){
returntrue;
}
else
returnfalse;
}
}
packageentity;
publicclassFilm{
privateintid;quals(strElementName)){
filmName=strText;
}elseif("Poster".equals(strElementName)){
myPoster=strText;
}elseif("Director".equals(strElementName)){
myDirector=strText;
}elseif("Acotr".equals(strElementName)){
myAcotr=strText;
}
elseif("Type".equals(strElementName)){
myType=strText;
}
elseif("Price".equals(strElementName)){
myPrice=strText;
}
elseif("Schedule".equals(strElementName)){
NodeListscheduleChildList=();
for(intk=0;k<();k++){
if(k)instanceofElement){
id++;
ElementscheduleChild=(Element)(k);
Filmfilm=newFilm(id,filmName,myPoster,myDirector,myAcotr,myType,
myPrice,());
(film);
}
}
}
}
}
quals(strElementName)){
if(name)){
filmName=strText;
exist=true;
}
else{quals(strElementName)){
myPoster=strText;
}elseif("Director".equals(strElementName)){
myDirector=strText;
}elseif("Acotr".equals(strElementName)){
myAcotr=strText;
}
elseif("Type".equals(strElementName)){
myType=strText;
}
elseif("Price".equals(strElementName)){
myPrice=strText;
}
elseif("Schedule".equals(strElementName)){
NodeListscheduleChildList=();
for(intk=0;k<();k++){
if(k)instanceofElement){
id++;
ElementscheduleChild=(Element)(k);
Filmfilm=newFilm(id,filmName,myPoster,myDirector,myAcotr,myType,
myPrice,());
(film);
}
}
}
}
}
etElementsByTagName("Item");
for(intj=0;j<();j++){
if(j)instanceofElement){
StringitemTime=(j).getTextContent();
if(time)){quals(strElementName)){
filmName=strText;
}elseif("Poster".equals(strElementName)){
myPoster=strText;
}elseif("Director".equals(strElementName)){
myDirector=strText;
}elseif("Acotr".equals(strElementName)){
myAcotr=strText;
}
elseif("Type".equals(strElementName)){
myType=strText;
}
elseif("Price".equals(strElementName)){
myPrice=strText;
}
}
}
id++;
Filmfilm=newFilm(id,filmName,myPoster,myDirector,myAcotr,myType,
myPrice,myItem);
(film);
}
}
}
}
if(exist){
returnlistFilm;
}
else{
returnnull;
}
}
publicvoidaddFilm(Filmfilm){
Elementmovie=("Movie");
Elementname=("Name");
NodeTextname=());
(Textname);
(name);
Elementposter=("Poster");
NodeTextposter=());
(Textposter);
(poster);
Elementdirector=("Director");
NodeTextdirector=());
(Textdirector);
(director);
Elementactor=("Acotr");
NodeTextactor=());
(Textactor);
(actor);
Elementtype=("Type");
NodeTexttype=());
(Texttype);
(type);
Elementprice=("Price");
NodeTextprice=());
(Textprice);
(price);
Elementschedule=("Schedule");
Elementitem=("Item");
NodeTextitem=());
(Textitem);
(item);
(schedule);
("Film").item(0).appendChild(movie);
(docFilms,filmsAddress);
}
publicbooleandelateFilm(Filmfilm){
for(inti=0;i<();i++){etElementsByTagName("Name");
NodenameNode=(0);
StringmoveName=();
if().equals(moveName)){quals("all")){etParentNode().removeChild(i));
}
else{etElementsByTagName("Item");
for(intj=0;j<();j++){etTextContent();
if())){etParentNode().removeChild(j));
}
}
}
if(!
existItem){
returnfalse;etElementsByTagName("Name");
NodenameNode=(0);
StringmoveName=();
if().equals(moveName)){
if(!
("Item")){etElementsByTagName(property);
(0).setTextContent(value);
}
else{
booleanexistItem=false;
NodeListitemList=((Element)(i)).getElementsByTagName("Item");
for(intj=0;j<();j++){
if(j)instanceofElement){
etTextContent();
if())){
/*
*找到该电影并修改对应的场次
*/
existItem=true;
(j).setTextContent(value);
}
}
}
if(!
existItem){
return2;
}
}
(docFilms,filmsAddress);
return0;
}
}
return1;
}
publicvoidbuyTicket(Filmfilm,Stringindex,StringticketType){
/*
*创建Seat节点,添加ticket属性,添加文本内容;
*/
Elementseat=("Seat");
("ticket",ticketType);
NodeseatText=(index);
(seatText);
booleanexistName=false;
for(inti=0;i<();i++){etAttribute("value");
if())){etChildNodes();
for(intj=0;j<();j++){etAttribute("value");
if())){ppendChild(seat);
(docTickets,ticketsAddress);
return;
}
}
}
if(!
existTime){ppendChild(myTime);
(docTickets,ticketsAddress);
return;
}
}
}
if(!
existName){tem(0).appendChild(myName);
(docTickets,ticketsAddress);
}
}
publicSeatgetSeates(Filmfilm){
if(!
isExist(film)){etAttribute("value");
if())){etChildNodes();
for(intj=0;j<();j++){etAttribute("value");
if())){etChildNodes();
for(intk=0;k<();k++){etAttribute("ticket");
StringmySeat=(k).getTextContent();
(mySeat);
etAttribute("value");
if())){etChildNodes();
for(intj=0;j<();j++){etAttribute("value");
if())){etChildNodes();
for(intk=0;k<();k++){etAttribute("ticket");
(myTicket);
StringmySeat=(k).getTextContent();
(mySeat);
}
}
(ticket);
returnseat;
}
}
}
returnseat;
}
}
returnseat;
}
publicList
returnnull;
}
publicbooleanisExist(Filmfilm){
for(inti=0;i<();i++){etElementsByTagName("Name");
NodenameNode=(0);
StringmoveName=();
if().equals(moveName)){etElementsByTagName("Item");
for(intj=0;j<();j++){etTextContent();
if())){//找到该场次
existItem=true;
}
}
}
if(!
existItem){//没找到该电影播放时间
returnfalse;
}
returntrue;//因为有唯一值,所以找到该电影后,不再往下寻找,直接返回true即可
}
}
returnfalse;//没有找到该电影
}
}
xmlversion=""encoding="UTF-8"standalone="no"
>
00"> 50"> xmlversion=""encoding="UTF-8"standalone="no" > 00 00 00 00 30 02 00 00 00 25
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 电影院 售票 管理 系统
![提示](https://static.bdocx.com/images/bang_tan.gif)