lendhandler.java
来自「一个企业小型固定资产系统的源代码。发布出来让刚学习java的人研究。」· Java 代码 · 共 83 行
JAVA
83 行
package project;
/*
*LendHandler.java:建立固定资产借用与归还实体类的控制类。
*/
import java.awt.event.*;
import javax.swing.event.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
public class LendHandler extends MyHandler implements ActionListener {
LendModel em;
public LendView lenEv;
public LendView retEv;
int pno;
public void actionPerformed( ActionEvent e) {
ShareDialog mydialog;
if (e.getActionCommand() == "len") {
float num= (Float.parseFloat(lenEv.p1.jtfEmpno.getText()))*1.0f;
float p= (Float.parseFloat(lenEv.p1.jtfUsedate.getText()))*1.0f;
float nump=(float)(num*p)*1.00f;
em = new LendModel(lenEv.p1.jtfAssetId.getText());
em.select();
em.setlend("出库", lenEv.p1.jtfprocess.getText(),num,p,nump,
lenEv.p1.jtfdate.getText(),
lenEv.p1.jtalenRemark.getText() );
em.updatedepot();
em.update();
}
if (e.getActionCommand() == "ret") {
float num= (Float.parseFloat(retEv.p1.jtfEmpno.getText()))*1.0f;
float p= (Float.parseFloat(retEv.p1.jtfUsedate.getText()))*1.0f;
float nump=(float)(num*p)*1.00f;
em = new LendModel(retEv.p1.jtfAssetId.getText());
em.seldo();
if(em.getAssetName()==null||em.getAssetName().length()==0){
em.setlend("入库", retEv.p1.jtfprocess.getText(),num,p,nump,
retEv.p1.jtfdate.getText(),
retEv.p1.jtalenRemark.getText() );
em.insertde();
}else{
em.setlend("入库", retEv.p1.jtfprocess.getText(),num,p,nump,
retEv.p1.jtfdate.getText(),
retEv.p1.jtalenRemark.getText() );
em.updated(); }
em.update();
}
if (e.getActionCommand() == "lensel") {
em = new LendModel(lenEv.p1.jtfAssetId.getText());
em.select();
if(em.getAssetName()==null||em.getAssetName().length()==0){
mydialog = new ShareDialog("NNP"); return; }
lenEv.p1.jtfAssetName.setText(em.getAssetName());
lenEv.p1.jtfModel.setText(em.getModel());
lenEv.p1.jtfPrice.setText(em.getPrice());
lenEv.p1.jtfUsedate.setText(em.getUsedate());
lenEv.p1. jtfEmpno.setText(em.getEmpno());
lenEv.p1.jtfRetdate.setText(em.getRetdate());
}
if (e.getActionCommand() == "retsel") {
em = new LendModel(retEv.p1.jtfAssetId.getText());
em.selno();
if(em.getAssetName()==null||em.getAssetName().length()==0){
mydialog = new ShareDialog("NNP"); return; }
retEv.p1.jtfAssetName.setText(em.getAssetName());
retEv.p1.jtfModel.setText(em.getModel());
retEv.p1.jtfPrice.setText(em.getPrice());
retEv.p1.jtfRetdate.setText(em.getRetdate());
}
if (e.getActionCommand() == "del") {
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?