⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mainframe.java

📁 JAVA实现的酒店管理系统
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
			}
		}
		// "退出"
		if (e.getSource() == logout) {
			System.exit(1);
		}
		// 客户管理
		// "客户级别"
		if (e.getSource() == mArray[0]) {
			CTypeAndPre cTypeAndPre = new CTypeAndPre();
			addTitle();
			this.getContentPane().add(cTypeAndPre, BorderLayout.CENTER);
			this.setVisible(true);
		}
		// "客户"
		if (e.getSource() == mArray[1]) {
			Client client = new Client();
			addTitle();
			this.getContentPane().add(client, BorderLayout.CENTER);
			this.setVisible(true);
		}
		// "未按时入住客户"
		if (e.getSource() == mArray[2]) {
			NotInClientD notInClientD = new NotInClientD();
			addTitle();
			this.getContentPane().add(notInClientD, BorderLayout.CENTER);
			this.setVisible(true);
		}
		// "未入住原因"
		if (e.getSource() == mArray[3]) {
			NotInCause notInCause = new NotInCause();
			addTitle();
			this.getContentPane().add(notInCause, BorderLayout.CENTER);
			this.setVisible(true);
		}
		// 未入住客户降级标准
		if (e.getSource() == mArray[4]) {
			NotInPermitted notInPermitted = new NotInPermitted();
			addTitle();
			this.getContentPane().add(notInPermitted, BorderLayout.CENTER);
			this.setVisible(true);
		}
		// 客房管理
		// "客房级别"
		if (e.getSource() == mArray[5]) {
			HGrade hGrade = new HGrade();
			addTitle();
			this.getContentPane().add(hGrade, BorderLayout.CENTER);
			this.setVisible(true);
		}
		// "具体客房"
		if (e.getSource() == mArray[6]) {
			House house = new House();
			addTitle();
			this.getContentPane().add(house, BorderLayout.CENTER);
			this.setVisible(true);
		}
		// "客房预定与使用"
		if (e.getSource() == mArray[7]) {
			HouseBookAndUse hBookAndUse = new HouseBookAndUse();
			addTitle();
			this.getContentPane().add(hBookAndUse, BorderLayout.CENTER);
			this.setVisible(true);
		}
		// "结帐管理"
		if (e.getSource() == checkOutItem) {
			CheckOut checkOut = new CheckOut();
			addTitle();
			this.getContentPane().add(checkOut, BorderLayout.CENTER);
			this.setVisible(true);
		}
		// "职称管理"
		if (e.getSource() == mArray[8]) {
			ETitle eTitle = new ETitle();
			addTitle();
			this.getContentPane().add(eTitle, BorderLayout.CENTER);
			this.setVisible(true);
		}
		// "员工管理"
		if (e.getSource() == mArray[9]) {
			Employee employee = new Employee();
			addTitle();
			this.getContentPane().add(employee, BorderLayout.CENTER);
			this.setVisible(true);
		}
		// "部门管理"
		if (e.getSource() == mArray[10]) {
			Department department = new Department();
			addTitle();
			this.getContentPane().add(department, BorderLayout.CENTER);
			this.setVisible(true);
		}
		// "工资结算"
		if (e.getSource() == sSalary) {
			SSalary sSalary = new SSalary();
			addTitle();
			this.getContentPane().add(sSalary, BorderLayout.CENTER);
			this.setVisible(true);
		}
		if (e.getSource() == kSalary) {
			KSalary kSalary = new KSalary();
			addTitle();
			this.getContentPane().add(kSalary, BorderLayout.CENTER);
			this.setVisible(true);
		}
		if (e.getSource() == eSalary) {
			ESalary eSalary = new ESalary();
			addTitle();
			this.getContentPane().add(eSalary, BorderLayout.CENTER);
			this.setVisible(true);
		}
		// "出勤管理"
		if (e.getSource() == sws) {
			SWSituation sWSituation = new SWSituation();
			addTitle();
			this.getContentPane().add(sWSituation, BorderLayout.CENTER);
			this.setVisible(true);
		}
		if (e.getSource() == kws) {
			KWSituation kWSituation = new KWSituation();
			addTitle();
			this.getContentPane().add(kWSituation, BorderLayout.CENTER);
			this.setVisible(true);
		}
		if (e.getSource() == ews) {
			EWSituation eWSituation = new EWSituation();
			addTitle();
			this.getContentPane().add(eWSituation, BorderLayout.CENTER);
			this.setVisible(true);
		}
		if (e.getSource() == mArray[11]) {
			NotNormalWorkType notNormalWorkType = new NotNormalWorkType();
			addTitle();
			this.getContentPane().add(notNormalWorkType, BorderLayout.CENTER);
			this.setVisible(true);
		}
		if (e.getSource() == mArray[12]) {
			NNormalWorkRecord nNormalWorkRecord = new NNormalWorkRecord();
			addTitle();
			this.getContentPane().add(nNormalWorkRecord, BorderLayout.CENTER);
			this.setVisible(true);
		}
		if (e.getSource() == mArray[13]) {
			NNWPunishment nNWPunishment = new NNWPunishment();
			addTitle();
			this.getContentPane().add(nNWPunishment, BorderLayout.CENTER);
			this.setVisible(true);
		}
		// "酒店运营情况"
		// "总收入"统计
		if (e.getSource() == sMenuItems[0][0]) {
			StaticsByDate staticsByDate = new StaticsByDate();
			addTitle();
			this.getContentPane().add(staticsByDate, BorderLayout.CENTER);
			this.setVisible(true);
		}
		if (e.getSource() == sMenuItems[0][1]) {
			StaticsByMonth staticsByMonth = new StaticsByMonth();
			addTitle();
			this.getContentPane().add(staticsByMonth, BorderLayout.CENTER);
			this.setVisible(true);
		}
		if (e.getSource() == sMenuItems[0][2]) {
			StaticsByYear staticsByYear = new StaticsByYear();
			addTitle();
			this.getContentPane().add(staticsByYear, BorderLayout.CENTER);
			this.setVisible(true);
		}
		// "客房出租收入"统计
		if (e.getSource() == sMenuItems[1][0]) {
			StaticsRenderByDate staticsRenderByDate = new StaticsRenderByDate();
			addTitle();
			this.getContentPane().add(staticsRenderByDate, BorderLayout.CENTER);
			this.setVisible(true);
		}
		if (e.getSource() == sMenuItems[1][1]) {
			StaticsRenderByMonth staticsRenderByMonth = new StaticsRenderByMonth();
			addTitle();
			this.getContentPane()
					.add(staticsRenderByMonth, BorderLayout.CENTER);
			this.setVisible(true);
		}
		if (e.getSource() == sMenuItems[1][2]) {
			StaticsRenderByYear staticsRenderByYear = new StaticsRenderByYear();
			addTitle();
			this.getContentPane().add(staticsRenderByYear, BorderLayout.CENTER);
			this.setVisible(true);
		}
		// "最受欢迎客房级别"统计
		if (e.getSource() == sMenuItems[2][1]) {
			StaticsMostByMonth staticsMostByMonth = new StaticsMostByMonth();
			addTitle();
			this.getContentPane().add(staticsMostByMonth, BorderLayout.CENTER);
			this.setVisible(true);
		}
		if (e.getSource() == sMenuItems[2][2]) {
			StaticsMostByYear staticsMostByYear = new StaticsMostByYear();
			addTitle();
			this.getContentPane().add(staticsMostByYear, BorderLayout.CENTER);
			this.setVisible(true);
		}
		// "出租收入最大客房级别"统计
		if (e.getSource() == sMenuItems[3][1]) {
			StaticsMoneyMostByMonth staticsMoneyMostByMonth = new StaticsMoneyMostByMonth();
			addTitle();
			this.getContentPane().add(staticsMoneyMostByMonth,
					BorderLayout.CENTER);
			this.setVisible(true);
		}
		if (e.getSource() == sMenuItems[3][2]) {
			StaticsMoneyMostByYear staticsMoneyMostByYear = new StaticsMoneyMostByYear();
			addTitle();
			this.getContentPane().add(staticsMoneyMostByYear,
					BorderLayout.CENTER);
			this.setVisible(true);
		}
		if (e.getSource() == mArray[14]) {// 点击了"客户投诉管理"菜单项
			AppealFatherJPanel appealFatherJPanel = new AppealFatherJPanel();
			addTitle();
			this.getContentPane().add(appealFatherJPanel, BorderLayout.CENTER);
			this.setVisible(true);
		}
		if (e.getSource() == goodTypes) {// 点击了"货品的类型管理"菜单项
			GoodTypeFatherJPanel goodTypeFatherJPanel = new GoodTypeFatherJPanel();
			addTitle();
			this.getContentPane()
					.add(goodTypeFatherJPanel, BorderLayout.CENTER);
			this.setVisible(true);
		}
		if (e.getSource() == goods) {// 点击了"货品管理"菜单项
			GoodFatherJPanel goodFatherJPanel = new GoodFatherJPanel();
			addTitle();
			this.getContentPane().add(goodFatherJPanel, BorderLayout.CENTER);
			this.setVisible(true);
		}
		if (e.getSource() == goodsIn) {// 点击了"进货管理"菜单项
			GoodBuyFatherJPanel goodBuyFatherJPanel = new GoodBuyFatherJPanel();
			addTitle();
			this.getContentPane().add(goodBuyFatherJPanel, BorderLayout.CENTER);
			this.setVisible(true);
		}
		if (e.getSource() == goodNotEqual) {// 点击了"货品损益情况管理"菜单项
			GoodNotEqualFatherJPanel goodNotEqualFatherJPanel = new GoodNotEqualFatherJPanel();
			addTitle();
			this.getContentPane().add(goodNotEqualFatherJPanel,
					BorderLayout.CENTER);
			this.setVisible(true);
		}
	}

	private void setAllMenusDisabled() {
		/*
		 * 以下代码把除了登陆管理模块之外的所有模块置为不可用
		 */
		MenuBar menuBar = this.getMenuBar();
		for (int index = 0; index < menuBar.getMenuCount(); index++) {
			Menu menu = menuBar.getMenu(index);
			for (int itemCount = 0; itemCount < menu.getItemCount(); itemCount++) {
				if (!menu.getItem(itemCount).getActionCommand().equals("登录")
						&& !menu.getItem(itemCount).getActionCommand().equals(
								"退出")) {
					menu.getItem(itemCount).setEnabled(false);
				}
			}
		}
	}

	private void addTitle() {
		this.getContentPane().removeAll();
		this.getContentPane().add(lf, BorderLayout.NORTH);
	}

	public static MainFrame getMainFrame() {
		return mainFrame;
	}

	public static void main(String[] args) {
		MainFrame test = getMainFrame();
		test.setExtendedState(JFrame.MAXIMIZED_BOTH);
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -