"供应商信息添加失败,存在同名供应商", "供应商添加信息",
JOptionPane.INFORMATION_MESSAGE);
return;
}
ResultSet set = Dao.query("select max(id) from tb_gysinfo");
String id = null;
if (set != null && set.next()) {
String sid = set.getString(1).trim();
if (sid == null)
id = "gys1001";
else {
String str = sid.substring(3);
id = "gys" + (Integer.parseInt(str) + 1);
}
}
TbGysinfo gysInfo = new TbGysinfo();
gysInfo.setId(id);
gysInfo.setAddress(diZhiF.getText().trim());
gysInfo.setBianma(bianMaF.getText().trim());
gysInfo.setFax(chuanZhenF.getText().trim());
gysInfo.setYh(yinHangF.getText().trim());
gysInfo.setJc(jianChengF.getText().trim());
gysInfo.setName(quanChengF.getText().trim());
gysInfo.setLian(lianXiRenF.getText().trim());
gysInfo.setLtel(lianXiRenDianHuaF.getText().trim());
gysInfo.setMail(EMailF.getText().trim());
gysInfo.setTel(dianHuaF.getText().trim());
Dao.addGys(gysInfo);
JOptionPane.showMessageDialog(GysTianJiaPanel.this, "已成功添加客户",
"客户添加信息", JOptionPane.INFORMATION_MESSAGE);
resetButton.doClick();
} catch (SQLException e1) { JAVA进销存管理系统的研究与应用+ER图(13):http://www.751com.cn/jisuanji/lunwen_2885.html