📄 catehandler.java
字号:
/* *CateHandler.java:建立资产类别实体类的控制类。 */
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
public class CateHandler extends MyHandler implements ActionListener {
CateModel em;
public CateView addEv;
public CateView uptEv;
public void actionPerformed( ActionEvent e) {
if (e.getActionCommand() == "add") {
em = new CateModel(addEv.p1.jtfCateId.getText(),
addEv.p1.jtfCateName.getText(),
addEv.p1.jtfSubCateId.getText(),
addEv.p1.jtfSubCateName.getText());
em.insert();
}
if (e.getActionCommand() == "upt") {
em.setAll(uptEv.p1.jtfCateName.getText(),uptEv.p1.jtfSubCateName.getText());
em.update();
}
if (e.getActionCommand() == "sel") {
if (Share.verify(uptEv.p1.jtfSubCateId)) {
em = new CateModel(uptEv.p1.jtfCateId.getText(),null,uptEv.p1.jtfSubCateId.getText(),null);
em.select();
uptEv.p1.jtfCateId.setText(em.getCateId());
uptEv.p1.jtfCateName.setText(em.getCateName());
uptEv.p1.jtfSubCateName.setText(em.getSubCateName());
}
}
if (e.getActionCommand() == "del") {
em.delete();
uptEv.p1.jtfCateId.setText(em.getCateId());
uptEv.p1.jtfCateName.setText(em.getCateName());
uptEv.p1.jtfSubCateId.setText(em.getSubCateId());
uptEv.p1.jtfSubCateName.setText(em.getSubCateName());
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -