📄 addmovestoragetable_frm.java~
字号:
}
}
catch (Exception ex1) {
}
}
void this_mouseClicked(MouseEvent e) {
}
void jComboBox3_actionPerformed(ActionEvent e) {
String clientid = (String) jComboBox3.getSelectedItem();
ResultSet rs = null;
//实例化ConnectDBBean
ConnectDBBean conndb = new ConnectDBBean();
//sql查询语句
String sql =
"select clientname from clientsinfo where clientid='" +
Integer.parseInt(clientid) + "'";
try {
rs = conndb.executeQuery(sql);
if (rs.next()) {
String proname = String.valueOf(rs.getString(1));
jTextField6.setText(proname);
}
}
catch (Exception ex1) {
}
}
void jButton1_actionPerformed(ActionEvent e) {
String osid = jTextField1.getText();
String whid = (String) jComboBox1.getSelectedItem();
String wsid = (String) jComboBox2.getSelectedItem();
String clientid = (String) jComboBox3.getSelectedItem();
String[] paraStr = new String[] {
osid, whid, wsid, clientid
};
ErrorCheck errmsg = new ErrorCheck();
if (errmsg.isNum(osid) && !errmsg.isEmpty(whid) && !errmsg.isEmpty(wsid)) {
ResultSet rs = null;
ConnectDBBean conn = new ConnectDBBean();
//sql语句
String sql = "select * from outstorage where osid='" +
osid + "'";
try {
rs = conn.executeQuery(sql);
if (rs.next()) {
JOptionPane.showMessageDialog(null, "该单据编号已存在,请重新输入!");
}
else {
//实例化GetFrmCentershow,该类是由我们创建的用于实现窗口中心显示
GetFrmCenterShow gfc = new GetFrmCenterShow();
//实例化Main_frame
AddOutGoods_Frm frame = new AddOutGoods_Frm(paraStr);
//让frame显示在屏幕中心
gfc.get_center(frame);
//frame的显示
frame.show();
}
}
catch (Exception ex) {
System.out.println(ex.getMessage());
}
}
else {
JOptionPane.showMessageDialog(null, "请填写完单据号,并确认了库房、货位等有关信息后再进行该操作。");
}
}
void jButton2_actionPerformed(ActionEvent e) {
String osid = jTextField1.getText();
try {
parameterRow1.setInt("osid", Integer.parseInt(osid));
queryDataSet1.refresh();
}
catch (Exception ex) {
ex.printStackTrace();
}
}
void jButton3_actionPerformed(ActionEvent e) {
this.dispose();
}
void jButton4_actionPerformed(ActionEvent e) {
String osid = jTextField1.getText();
String charger = jTextField4.getText();
String ostime = jTextField5.getText();
String remarks = jTextField7.getText();
ErrorCheck errmsg = new ErrorCheck();
if (errmsg.isNum(osid)) {
ResultSet rs = null;
ConnectDBBean conn = new ConnectDBBean();
//sql语句
String sql = "select * from osgoods where osid='" +
osid + "'";
try {
rs = conn.executeQuery(sql);
if (rs.next()) {
Connection conndb = null;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conndb = DriverManager.getConnection("jdbc:odbc:KcglSys", "sa", "sa");
//创建调用存储过程得SQL语句
String insertsql = "{call sp_InsertOutStorage(?,?,?,?)}";
//创建CallableStatement接口调用存储过程
CallableStatement cStatement = conndb.prepareCall(insertsql);
cStatement.setInt(1, Integer.parseInt(osid));
cStatement.setString(2, ostime);
cStatement.setString(3, charger);
cStatement.setString(4, remarks);
cStatement.executeUpdate();
cStatement.close();
JOptionPane.showMessageDialog(null, "出库操作成功!");
}
else {
JOptionPane.showMessageDialog(null, "您还未录入货物,请录入后再进行出库操作!");
}
}
catch (Exception ex) {
System.out.println(ex.getMessage());
}
}
else {
JOptionPane.showMessageDialog(null, "入库失败,请正确操作!");
}
}
}
class AddOutStorageTable_Frm_jComboBox1_actionAdapter
implements java.awt.event.ActionListener {
AddOutStorageTable_Frm adaptee;
AddOutStorageTable_Frm_jComboBox1_actionAdapter(AddOutStorageTable_Frm
adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jComboBox1_actionPerformed(e);
}
}
class AddOutStorageTable_Frm_jComboBox2_actionAdapter
implements java.awt.event.ActionListener {
AddOutStorageTable_Frm adaptee;
AddOutStorageTable_Frm_jComboBox2_actionAdapter(AddOutStorageTable_Frm
adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jComboBox2_actionPerformed(e);
}
}
class AddOutStorageTable_Frm_this_mouseAdapter
extends java.awt.event.MouseAdapter {
AddOutStorageTable_Frm adaptee;
AddOutStorageTable_Frm_this_mouseAdapter(AddOutStorageTable_Frm adaptee) {
this.adaptee = adaptee;
}
public void mouseClicked(MouseEvent e) {
adaptee.this_mouseClicked(e);
}
}
class AddOutStorageTable_Frm_jComboBox3_actionAdapter
implements java.awt.event.ActionListener {
AddOutStorageTable_Frm adaptee;
AddOutStorageTable_Frm_jComboBox3_actionAdapter(AddOutStorageTable_Frm
adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jComboBox3_actionPerformed(e);
}
}
class AddOutStorageTable_Frm_jButton1_actionAdapter
implements java.awt.event.ActionListener {
AddOutStorageTable_Frm adaptee;
AddOutStorageTable_Frm_jButton1_actionAdapter(AddOutStorageTable_Frm adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton1_actionPerformed(e);
}
}
class AddOutStorageTable_Frm_jButton2_actionAdapter
implements java.awt.event.ActionListener {
AddOutStorageTable_Frm adaptee;
AddOutStorageTable_Frm_jButton2_actionAdapter(AddOutStorageTable_Frm adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton2_actionPerformed(e);
}
}
class AddOutStorageTable_Frm_jButton3_actionAdapter
implements java.awt.event.ActionListener {
AddOutStorageTable_Frm adaptee;
AddOutStorageTable_Frm_jButton3_actionAdapter(AddOutStorageTable_Frm adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton3_actionPerformed(e);
}
}
class AddOutStorageTable_Frm_jButton4_actionAdapter
implements java.awt.event.ActionListener {
AddOutStorageTable_Frm adaptee;
AddOutStorageTable_Frm_jButton4_actionAdapter(AddOutStorageTable_Frm adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton4_actionPerformed(e);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -