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

📄 chooseclothestypelistener.java

📁 一个优秀的干洗店管理系统
💻 JAVA
字号:
package control.getClothes;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Vector;

import javax.swing.JOptionPane;

import view.dialog.getClothes.ChooseClothesTypeDlg;
import view.dialog.getClothes.ClothesItemDlg;
import view.panel.getClothes.ChooseClothesPanel;
import vo.ClothesTypeVo;
import dao.common.DbException;
import dao.getClothesDao.GetClothesDao;
import dao.getClothesDao.getClothesDaoImpl.GetClothesDaoImpl;

public class ChooseClothesTypeListener implements ActionListener{
	private ChooseClothesTypeDlg chooseClothesTypeDlg;
	
	/**
	 * @param chooseClothesTypeDlg
	 */
	public ChooseClothesTypeListener(ChooseClothesTypeDlg chooseClothesTypeDlg) {
		super();
		this.chooseClothesTypeDlg = chooseClothesTypeDlg;
	}


	public void actionPerformed(ActionEvent e){
		String command = e.getActionCommand();
		if(command.equals("确定")){
			ClothesTypeVo clothesTypeVo = chooseClothesTypeDlg.buildChooseClothesPanel().
											getSelectedClothesTypeVo();
			if(clothesTypeVo != null){
				new ClothesItemDlg(chooseClothesTypeDlg.buildGetClothesPanel(),clothesTypeVo).setVisible(true);
				chooseClothesTypeDlg.dispose();
			}
		}else if(command.equals("取消")){
			chooseClothesTypeDlg.dispose();
		}else if(command.equals("搜素")){
			ChooseClothesPanel clothesTypePanel = this.chooseClothesTypeDlg.buildChooseClothesPanel();
			GetClothesDao getClothesDao = new GetClothesDaoImpl();
			String keyword = clothesTypePanel.buildKeywordTxFld().getText();
			Vector v = null;
			try {
				if (keyword != null
						&& clothesTypePanel.buildClothesNameRdBtn()
								.isSelected()) {
					v = getClothesDao.searchClothesTypeByNameAndService(
							keyword,
							GetClothesDaoImpl.SEARCH_CLOTHESTYPE_BY_NAME);
				}else if(keyword != null
						&& clothesTypePanel.buildServiceTypeRdBtn().isSelected()){
					v = getClothesDao.searchClothesTypeByNameAndService(
							keyword,
							GetClothesDaoImpl.SEARCH_CLOTHESTYPE_BY_SERVICE);
				}else{
					v = getClothesDao.searchClothesTypeByNameAndService(
							keyword,
							GetClothesDaoImpl.SEARCH_ALL_CLOTHESTYPE);
				}
			} catch (DbException de) {
				JOptionPane.showMessageDialog(null, de.getMessage());
			}
			clothesTypePanel.setClothesTypeTable(v);
		}
	}
}

⌨️ 快捷键说明

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