最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

java實(shí)現(xiàn)客房管理系統(tǒng)

 更新時(shí)間:2019年02月21日 10:37:00   作者:Break丶It  
這篇文章主要為大家詳細(xì)介紹了java實(shí)現(xiàn)客房管理系統(tǒng),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了java實(shí)現(xiàn)客房管理系統(tǒng)的具體代碼,供大家參考,具體內(nèi)容如下

AddClient.java

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.Calendar;

import javax.naming.spi.DirStateFactory.Result;
import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
import javax.swing.UIManager;
import javax.swing.UIManager.LookAndFeelInfo;


 public class AddClient extends JFrame implements ActionListener{
 JTextField sname,ID,age,home_addr,employer,phone,cno,rno,intime,outtime,days,cashpledge;
 JButton save,cancel,save1;
 JPanel pl,pl1,pl2,pl3,pl4,pl5,pl6,pl7,pl8,pl9,pl10,pl11,pl12,pl13,pl14,pl15,pl16;
 JRadioButton man,wuman,yes,no;
 ButtonGroup group,group1;
 String sex,vip;
 int k,k1,k2;
 public AddClient(){
 pl=new JPanel();
 pl1=new JPanel();
 pl2=new JPanel();
 pl3=new JPanel();
 pl4=new JPanel();
 pl5=new JPanel();
 pl6=new JPanel();
 pl7=new JPanel();
 pl8=new JPanel();
 pl9=new JPanel();
 pl10=new JPanel();
 pl11=new JPanel();
 pl12=new JPanel();
 pl13=new JPanel();
 pl14=new JPanel();
 pl15=new JPanel();
 pl16=new JPanel(new FlowLayout(FlowLayout.CENTER,20,20));

 sname=new JTextField(15);
 ID=new JTextField(15);
 age=new JTextField(15);
 home_addr=new JTextField(15);
 employer=new JTextField(15);
 phone=new JTextField(15);
 cno=new JTextField(15);
 rno=new JTextField(15);
 intime=new JTextField(15);
 outtime=new JTextField(15);
 days=new JTextField(15);
 cashpledge=new JTextField(15);
 
 
 group=new ButtonGroup();
 group1=new ButtonGroup();
 man=new JRadioButton("男",true);
 wuman=new JRadioButton("女",false);
 yes=new JRadioButton("是",true);
 no=new JRadioButton("否",false);
 group.add(man);
 group.add(wuman);
 group1.add(yes);
 group1.add(no);
 

 pl1.add(new JLabel("姓名:  ",JLabel.RIGHT));
 pl1.add(sname);
 pl2.add(new JLabel("身份證號(hào):",JLabel.RIGHT));
 pl2.add(ID);
 pl3.add(new JLabel("性別:  ",JLabel.RIGHT));
 pl3.add(man);
 pl3.add(wuman);
 pl4.add(new JLabel("VIP客戶:"));
 pl4.add(yes);
 pl4.add(no);
 pl5.add(new JLabel("年齡:  ",JLabel.RIGHT));
 pl5.add(age);
 pl6.add(new JLabel("家庭地址:",JLabel.RIGHT));
 pl6.add(home_addr);
 pl7.add(new JLabel("工作單位:",JLabel.RIGHT));
 pl7.add(employer);
 pl8.add(new JLabel("手機(jī)號(hào): ",JLabel.RIGHT));
 pl8.add(phone);
 
 
 pl.setBorder(BorderFactory.createTitledBorder("客戶 信息"));
 pl.setLayout(new GridLayout(4,2,10,10));
 pl.add(pl1);
 pl.add(pl2);
 pl.add(pl3);
 pl.add(pl4);
 pl.add(pl5);
 pl.add(pl8);
 pl.add(pl7);
 pl.add(pl6);


 pl9.add(new JLabel("房號(hào):   ",JLabel.RIGHT));
 pl9.add(rno);
 pl10.add(new JLabel("入住時(shí)間:",JLabel.RIGHT));
 pl10.add(intime);
 pl11.add(new JLabel("預(yù)離店時(shí)間",JLabel.RIGHT));
 pl11.add(outtime);
 pl12.add(new JLabel("入住天數(shù):",JLabel.RIGHT));
 pl12.add(days);
 pl13.add(new JLabel("預(yù)交押金:",JLabel.RIGHT));
 pl13.add(cashpledge);
 pl14.add(new JLabel("入住序號(hào):",JLabel.RIGHT));
 pl14.add(cno);
 
 pl15.setBorder(BorderFactory.createTitledBorder("客戶入住 信息"));
 pl15.setLayout(new GridLayout(3,2,15,15));
 pl15.add(pl14);
 pl15.add(pl9);
 pl15.add(pl10);
 pl15.add(pl11);
 pl15.add(pl12);
 pl15.add(pl13);
 
 
 save=new JButton("登記入住");
 cancel=new JButton("取消");
 save1=new JButton("添加家屬");
 save.addActionListener(this);
 cancel.addActionListener(this);
 save1.addActionListener(this);
 pl16.add(save);
 pl16.add(save1);
 pl16.add(cancel);
 
 add(pl,BorderLayout.NORTH);
 add(pl15,BorderLayout.CENTER);
 add(pl16,BorderLayout.SOUTH);
 
 setBounds(600,300,600,600);
 setTitle("客戶入住信息");
 setVisible(true);
 }
 @Override
 public void actionPerformed(ActionEvent e) {
 if(e.getSource()==save){
 int result=JOptionPane.showConfirmDialog(null, "確認(rèn)提交嗎", "溫馨提示", JOptionPane.YES_NO_OPTION);
 if (result==0) {
 if(man.isSelected()){ 
  sex="男";
  } 
 else{ 
  sex="女";
  } 
 if(yes.isSelected()){ 
  vip="是";
  } 
 else{ 
  vip="否";
  }
 try
  {
  Class.forName(Url.driver);
  Connection con=DriverManager.getConnection(Url.url,Url.username,Url.userpwd);
  Statement sql=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
  k=sql.executeUpdate("insert into Client values('"+sname.getText()+"','"+ID.getText()+"','"+sex+"','"+age.getText()+"','"+home_addr.getText()+"','"+employer.getText()+"','"+vip+"','"+phone.getText()+"')");
  k1=sql.executeUpdate("insert into Check_in(Cno,Rno,Intime,Outtime,Dayss,Cashpledge) values('"+cno.getText()+"','"+rno.getText()+"','"+intime.getText()+"','"+outtime.getText()+"','"+days.getText()+"','"+cashpledge.getText()+"')");
  k2=sql.executeUpdate("insert into Type_in values('"+cno.getText()+"','"+ID.getText()+"')");
  if (k==1&&k1==1&&k2==1) {
  int result1=JOptionPane.showConfirmDialog(null, "入住成功!是否添加家屬信息?", "溫馨提示", JOptionPane.YES_NO_OPTION);
  if(result1==0){
  ID.setText("");
  sname.setText("");
  age.setText("");
  home_addr.setText("");
  phone.setText("");
  employer.setText("");
  }
  else {
  dispose();
  }
 }
  }catch(Exception e1){
  JOptionPane.showMessageDialog(this, "入住失敗");
  }
 }
 }
 if(e.getSource()==cancel){
 dispose();
 }
 
 if(e.getSource()==save1){
 int result=JOptionPane.showConfirmDialog(null, "確認(rèn)提交嗎", "溫馨提示", JOptionPane.YES_NO_OPTION);
 if (result==0) {
 if(man.isSelected()){ 
  sex="男";
  } 
 else{ 
  sex="女";
  } 
 if(yes.isSelected()){ 
  vip="是";
  } 
 else{ 
  vip="否";
  }
 try
  {
  Class.forName(Url.driver);
  Connection con=DriverManager.getConnection(Url.url,Url.username,Url.userpwd);
  Statement sql=con.createStatement();
  k=sql.executeUpdate("insert into Client values('"+sname.getText()+"','"+ID.getText()+"','"+sex+"','"+age.getText()+"','"+home_addr.getText()+"','"+employer.getText()+"','"+vip+"','"+phone.getText()+"')");
  k2=sql.executeUpdate("insert into Type_in values('"+cno.getText()+"','"+ID.getText()+"')");
  if (k==1&&k2==1) {
  int result1=JOptionPane.showConfirmDialog(null, "入住成功!是否繼續(xù)添加家人信息?", "溫馨提示", JOptionPane.YES_NO_OPTION);
  if(result1==0){
  ID.setText("");
  sname.setText("");
  age.setText("");
  home_addr.setText("");
  phone.setText("");
  employer.setText("");
  }
  else {
  dispose();
  }
 }
  }catch(Exception e1){
  JOptionPane.showMessageDialog(this, "添加失敗");
  }
 }
 }
 
 
 }
}

AdminFrame.java

import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.ImageIcon;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;

class AdminFrame extends JDialog implements ActionListener{
 JLabel label = new JLabel();
 JMenuBar mBar= new JMenuBar();
 private JMenu Quarto,message,Clinet;
 private JMenuItem item1,item2,item3,item4,item5,item6,item7,item8,item9;
 JPanel pl1;
 Container con;
 AdminFrame(){
 pl1=new JPanel();
 setJMenuBar(mBar);
 ImageIcon icon = new ImageIcon("src/picture/1.jpg");
 label.setIcon(icon);
 label.setBounds(0,0, 600, 500);
 pl1.add(label);
 add(pl1);
 setBounds(600,300,600,500);
 
 Quarto=new JMenu("客房操作");
 message=new JMenu("信息查詢");
 Clinet=new JMenu("統(tǒng)計(jì)客房相關(guān)信息");
 mBar.add(Quarto);
 mBar.add(message);
 mBar.add(Clinet);
 item3=new JMenuItem("查詢客房");
 item1=new JMenuItem("入住登記"); 
 item2=new JMenuItem("退房操作");
 Quarto.add(item1);
 Quarto.addSeparator();
 Quarto.add(item2);
 Quarto.addSeparator();
 Quarto.add(item3);
 item4=new JMenuItem("客人信息查詢");
 item5=new JMenuItem("客房時(shí)間查詢");
 item6=new JMenuItem("客人費(fèi)用查詢");
 message.add(item4);
 message.addSeparator();
 message.add(item5);
 message.addSeparator();
 message.add(item6);
 item7=new JMenuItem("各類房型入住情況");
 item8=new JMenuItem("各月份客房收入");
 Clinet.add(item7);
 Clinet.addSeparator();
 Clinet.add(item8);
 item1.addActionListener(this);
 item2.addActionListener(this);
 item3.addActionListener(this);
 item4.addActionListener(this);
 item5.addActionListener(this);
 item6.addActionListener(this);
 item7.addActionListener(this);
 item8.addActionListener(this);
 setVisible(false);
 setTitle("客房管理系統(tǒng)");
 validate();
 }
 @Override
 public void actionPerformed(ActionEvent e) {
 if(e.getSource()==item1){
 AddClient stu=new AddClient();
 stu.setVisible(true);
 }
 
 if(e.getSource()==item2){
 Left left=new Left();
 left.setVisible(true);
 }
 
 if (e.getSource()==item3) {
 QueryRoom qr=new QueryRoom();
 qr.setVisible(true);
 }
 if (e.getSource()==item4) {
 QueryClient qc=new QueryClient();
 qc.setVisible(true);
 }
 
 if(e.getSource()==item5){
 QueryTime qt=new QueryTime();
 qt.setVisible(true);
 }
 
 if(e.getSource()==item6){
 QueryCost qc=new QueryCost();
 qc.setVisible(true);
 }
 
 if(e.getSource()==item7){
 StatisticsInformation si=new StatisticsInformation();
 si.setVisible(true);
 }
 
 if(e.getSource()==item8){
 Income income=new Income();
 income.setVisible(true);
 }
}
}

完整代碼:java實(shí)現(xiàn)客房管理系統(tǒng)

以上就是本文的全部內(nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • Spring MVC 文件上傳下載的實(shí)例

    Spring MVC 文件上傳下載的實(shí)例

    本篇文章主要介紹了Spring MVC 文件上傳下載的實(shí)例,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2017-01-01
  • Java中的PrintWriter 介紹_動(dòng)力節(jié)點(diǎn)Java學(xué)院整理

    Java中的PrintWriter 介紹_動(dòng)力節(jié)點(diǎn)Java學(xué)院整理

    PrintWriter 是字符類型的打印輸出流,它繼承于Writer。接下來通過本文給大家介紹java中的 PrintWriter 相關(guān)知識(shí),感興趣的朋友一起學(xué)習(xí)吧
    2017-05-05
  • springboot上傳文件并返回url過程

    springboot上傳文件并返回url過程

    這篇文章主要介紹了springboot上傳文件并返回url過程,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2022-11-11
  • springboot全局配置文件與多環(huán)境配置的全過程

    springboot全局配置文件與多環(huán)境配置的全過程

    SpringBoot項(xiàng)目在多環(huán)境配置上表現(xiàn)的非常優(yōu)秀,只需要非常簡單的操作就可以完成配置,下面這篇文章主要給大家介紹了關(guān)于springboot全局配置文件與多環(huán)境配置的相關(guān)資料,需要的朋友可以參考下
    2021-12-12
  • SpringBoot中自定義參數(shù)綁定步驟詳解

    SpringBoot中自定義參數(shù)綁定步驟詳解

    這篇文章主要介紹了SpringBoot中自定義參數(shù)綁定步驟詳解,非常不錯(cuò),具有參考借鑒價(jià)值 ,需要的朋友可以參考下
    2018-02-02
  • IntelliJ IDEA2020.2.2創(chuàng)建Servlet方法及404問題

    IntelliJ IDEA2020.2.2創(chuàng)建Servlet方法及404問題

    這篇文章主要介紹了IntelliJ IDEA2020.2.2創(chuàng)建Servlet方法及404問題,這里小編使用的2020.2.2企業(yè)破解版本,本文通過圖文并茂的形式給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2020-09-09
  • 使用linux部署Spring Boot程序

    使用linux部署Spring Boot程序

    springboot程序在linux服務(wù)器上應(yīng)該怎么部署?這次就分享下linux下如何正確部署springboot程序,感興趣的朋友一起看看吧
    2018-01-01
  • Java TimedCache 帶時(shí)間緩存工具類詳解使用

    Java TimedCache 帶時(shí)間緩存工具類詳解使用

    工具類是包含集合框架、遺留的 collection 類、事件模型、日期和時(shí)間設(shè)施、國際化和各種實(shí)用工具類(字符串標(biāo)記生成器、隨機(jī)數(shù)生成器和位數(shù)組、日期Date類、堆棧Stack類、向量Vector類等)。集合類、時(shí)間處理模式、日期工具等各類常用工具包,本文將介紹帶時(shí)間緩存工具類
    2021-10-10
  • SpringBoot進(jìn)行數(shù)據(jù)加密和解密的詳細(xì)指南

    SpringBoot進(jìn)行數(shù)據(jù)加密和解密的詳細(xì)指南

    對(duì)稱加密算法使用相同的密鑰進(jìn)行加密和解密,其主要優(yōu)點(diǎn)包括速度快和實(shí)現(xiàn)簡單,常見的對(duì)稱加密算法有 AES、DES 等,本文將以 AES 為例,展示如何在 Spring Boot 項(xiàng)目中進(jìn)行數(shù)據(jù)加密和解密,需要的朋友可以參考下
    2024-11-11
  • springboot使用事物注解方式代碼實(shí)例

    springboot使用事物注解方式代碼實(shí)例

    這篇文章主要介紹了springboot使用事物注解方式代碼實(shí)例,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下
    2019-11-11

最新評(píng)論

仁化县| 五原县| 安阳县| 丽江市| 大理市| 城市| 沽源县| 太白县| 湖口县| 山阴县| 湖南省| 清远市| 封开县| 兖州市| 吐鲁番市| 东山县| 邯郸县| 岐山县| 南通市| 锡林郭勒盟| 沙田区| 焉耆| 腾冲县| 安泽县| 石嘴山市| 阿荣旗| 天等县| 栖霞市| 武穴市| 屏边| 从化市| 黔南| 渝中区| 阜平县| 麻江县| 马关县| 兴国县| 渑池县| 都安| 荥经县| 盘山县|