📄 takeclotheslistener.java
字号:
package view.control.takeclothes;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Vector;
import javax.swing.JOptionPane;
import view.dialog.takeClothes.NormalTakeClothesDlg;
import view.dialog.takeClothes.RefundDlg;
import view.dialog.takeClothes.RewashDlg;
import view.panel.takeClothes.TakeClothesPanel;
import vo.OrderVo;
import vo.VipVo;
import dao.common.DbException;
import dao.getClothesDao.GetClothesDao;
import dao.getClothesDao.getClothesDaoImpl.GetClothesDaoImpl;
import dao.takeClothesDao.TakeClothesDao;
import dao.takeClothesDao.takeClothesDaoImpl.TakeClothesDaoImpl;
public class TakeClothesListener implements ActionListener{
private TakeClothesPanel takeClothesPanel;
public TakeClothesListener(TakeClothesPanel takeClothesPanel) {
super();
this.takeClothesPanel = takeClothesPanel;
}
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
String command = e.getActionCommand();
if(command.equals("取衣")){
showNormalTakeClothesDlg();
}else if(command.equals("重洗")){
showRewashClothesDlg();
}else if(command.equals("赔款")){
showRefundClothesDlg();
}
}
public void showNormalTakeClothesDlg(){
OrderVo orderVo = takeClothesPanel.getSelectedOrderVo();
if(orderVo == null){
return;
}
VipVo vipVo = null;
GetClothesDao getClothesDao = new GetClothesDaoImpl();
try{
vipVo = getClothesDao.getVipVoById(orderVo.getCustomerId());
}catch(DbException de){
JOptionPane.showMessageDialog(null, de.getMessage());
return;
}
NormalTakeClothesDlg normalTakeClothesDlg = new NormalTakeClothesDlg(takeClothesPanel);
normalTakeClothesDlg.getNmTakeClothesPanel().initiallize(orderVo, vipVo);
normalTakeClothesDlg.setVisible(true);
}
public void showRewashClothesDlg(){
OrderVo orderVo = takeClothesPanel.getSelectedOrderVo();
if(orderVo == null){
return;
}
VipVo vipVo = null;
GetClothesDao getClothesDao = new GetClothesDaoImpl();
try{
vipVo = getClothesDao.getVipVoById(orderVo.getCustomerId());
}catch(DbException de){
JOptionPane.showMessageDialog(null, de.getMessage());
return;
}
RewashDlg rewashDlg = new RewashDlg(takeClothesPanel);
rewashDlg.getRewashPanel().initiallize(orderVo, vipVo);
rewashDlg.setVisible(true);
}
public void showRefundClothesDlg(){
OrderVo orderVo = takeClothesPanel.getSelectedOrderVo();
if(orderVo == null){
return;
}
VipVo vipVo = null;
Vector operatorNames = null;
GetClothesDao getClothesDao = new GetClothesDaoImpl();
TakeClothesDao takeClothesDao = new TakeClothesDaoImpl();
try{
vipVo = getClothesDao.getVipVoById(orderVo.getCustomerId());
operatorNames = takeClothesDao.getAllOperatorName();
}catch(DbException de){
JOptionPane.showMessageDialog(null, de.getMessage());
return;
}
RefundDlg refundDlg = new RefundDlg(takeClothesPanel);
refundDlg.getRefundPanel().initiallize(orderVo, vipVo,operatorNames);
refundDlg.setVisible(true);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -