| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3304 人关注过本帖
标题:[原创]小弟准备做个小项目 不定期公开所有代码的喔 希望大家支持,关注
只看楼主 加入收藏
曾阿牛
Rank: 1
等 级:新手上路
帖 子:68
专家分:0
注 册:2005-10-14
收藏
得分:0 
现在做这个程序可是大家都对药店方面都不是很熟悉 我下了个医药软件的例子 想看看它究竟实现了什么

功能以它为模板 实现它能实现的功能 有什么我们觉得还不够人性化的咱们自己在补充 你们说这样好不好

我下的是博信药店管理系统(含GSP管理) 你们有兴趣的话下载来看看吧

什么时候才能成为论坛游民啊....
2005-11-09 19:13
曾阿牛
Rank: 1
等 级:新手上路
帖 子:68
专家分:0
注 册:2005-10-14
收藏
得分:0 

上回我贴了几个数据库的表 其实具体概念我也都不是很明白 那个货位指的是货物存放的位置

比如哪一个货家架


什么时候才能成为论坛游民啊....
2005-11-09 19:16
曾阿牛
Rank: 1
等 级:新手上路
帖 子:68
专家分:0
注 册:2005-10-14
收藏
得分:0 

不好意思 进度有点慢 那个模拟银行的代码我正在弄 太多了 估计要晚一点才能弄好


什么时候才能成为论坛游民啊....
2005-11-09 20:47
九层楼
Rank: 1
等 级:新手上路
帖 子:33
专家分:0
注 册:2005-11-9
收藏
得分:0 
期待源码贴出来
2005-11-09 22:16
曾阿牛
Rank: 1
等 级:新手上路
帖 子:68
专家分:0
注 册:2005-10-14
收藏
得分:0 

谢谢大家的鼓励和支持 大家是不是可以一起写一点啊 可以讨论一下啊 我也很菜 也是新手上路 也是一个

人在宿舍里憋代码 也没有老师指导 大家不要对我期望过高啊


什么时候才能成为论坛游民啊....
2005-11-09 22:39
曾阿牛
Rank: 1
等 级:新手上路
帖 子:68
专家分:0
注 册:2005-10-14
收藏
得分:0 

那个药店的管理程序我现在还没写出来 不过我可以帖一个我前几天写的一个

程序 时间匆忙 连批注也没写上 而且还没有通过编译 还有很多错误

大家帮我看看好吗 不过说好了 可以批评我 可不要笑话我啊



lKAZKAA4.rar (798 Bytes) [原创]小弟准备做个小项目 不定期公开所有代码的喔 希望大家支持,关注

这是数据库的表格

下面是代码

import java.awt.*;
import java.awt.event.*;
import java.sql.*;
import java.text.*;
import javax.swing.*;
import javax.swing.event.*;

public class Yinhang extends JFrame {
private JTextArea xianshiJTextArea;

private JTextField zhanghuJTextField;
private JTextField jineJTextField;

private JPasswordField mimaJPasswordField;

private JButton JButton0;
private JButton JButton1;
private JButton JButton2;
private JButton JButton3;
private JButton JButton4;
private JButton JButton5;
private JButton JButton6;
private JButton JButton7;
private JButton JButton8;
private JButton JButton9;
private JButton guanliyuanJButton;
private JButton yonghuJButton;
private JButton chaxunJButton;
private JButton lishiJButton;
private JButton cunkuanJButton;
private JButton qukuanJButton;
private JButton fenghaoJButton;
private JButton tuichuJButton;
private JButton xinjianJButton;
private JButton quedingJButton;
private JButton jiechufenghaoJButton;
private JButton genggaimimaJButton;

private JLabel zhanghuJLabel;
private JLabel mimaJLabel;
private JLabel jineJLabel;

private JComboBox bizongJComboBox;

private String guanliyuanzhanghao="123";
private String guanliyuanmima="123";
private String jzhanghu,jmima;
private String guanzhanghu,guanmima;
private String zhanghu,mima;
private String DATEBASEDRIVER="sun.jdbc.odbc.JdbcOdbcDriver";
private String DATEBASEURL="jdbc:odbc:myfrist";
private String[] countries;

private int dengluzhi=1;
private int janquan,jsuoding;

private Connection myConnection;
private Statement myStatement;
private PreparedStatement myPreparedStatement;
private ResultSet myResultSet;

private Date jshijian,jsuodingdate,jjinggaodate;

private double jjine;
private double MEIYUAN=8.6;
private double RENMINBI=1;
private double RIYUAN=0.07;

public Yinhang{
creatuserinterface();
}

private void creatuserinterface(){
Container contentPane=getContentPane();
contentPane.setLayout(null);

xianshiJTextArea=new JTextArea();
xianshiJTextArea.setBounds(0,0,560,300);
xianshiJTextArea.setEditable(false);
contentPane.add(xianshiJTextArea);

zhanghuJLabel=new JLabel();
zhanghuJLabel.setBounds(0,300,100.60);
zhanghuJLabel.setText("帐户");
contentPane.add(zhanghuJLabel);

mimaJLabel=new JLabel();
mimaJLabel.setBounds(0,360,100.60);
mimaJLabel.setText("密码");
contentPane.add(mimaJLabel);

jineJLabel=new JLabel();
jineJLabel.setBounds(0,420,100.60);
jineJLabel.setText("金额");
contentPane.add(jineJLabel);

zhanghuJTextField=new JTextField();
zhanghuJTextField.setBounds(100,300,160,60);
contentPane.add(zhanghuJTextField);

jineJTextField=new JTextField();
jineJTextField.setBounds(100,420,160,60);
contentPane.add(jineJTextField);

mimaJPasswordField=new JPasswordField();
mimaJPasswordField.setBounds(100,360,160,60);
contentPane.add(mimaJPasswordField);

bizongJComboBox=new JComboBox(countries);
bizongJComboBox.setBounds(0,480,260,60);
bizongJComboBox.setMaximumRowCount(3);
contentPane.add(bizongJComboBox);

JButton0=new JButton();
JButton0.setBounds(150.840.100.80);
JButton0.setText("0");
JButton0.setEditable(false);
contentPane.add(JButton0);
JButton1.addActionListener(

new ActionListener() {
public void actionPerformed( ActionEvent event ){
oneTonineJButtonActionPerformed( event );
}
}
);

JButton1=new JButton();
JButton1.setBounds(50.600.100.80);
JButton1.setText("1");
JButton1.setEditable(false);
contentPane.add(JButton1);
JButton1.addActionListener(

new ActionListener() {
public void actionPerformed( ActionEvent event ){
oneTonineJButtonActionPerformed("1");
}
}
);

JButton2=new JButton();
JButton2.setBounds(150.600.100.60);
JButton2.setText("2");
JButton2.setEditable(false);
contentPane.add(JButton2);
JButton2.addActionListener(

new ActionListener() {
public void actionPerformed( ActionEvent event ){
oneTonineJButtonActionPerformed("2");
}
}
);

JButton3=new JButton();
JButton3.setBounds(250.600.100.80);
JButton3.setText("3");
JButton3.setEditable(false);
contentPane.add(JButton3);
JButton3.addActionListener(

new ActionListener() {
public void actionPerformed( ActionEvent event ){
oneTonineJButtonActionPerformed("3");
}
}
);

JButton4=new JButton();
JButton4.setBounds(50.680.100.80);
JButton4.setText("4");
JButton4.setEditable(false);
contentPane.add(JButton4);
JButton4.addActionListener(

new ActionListener() {
public void actionPerformed( ActionEvent event ){
oneTonineJButtonActionPerformed("4");
}
}
);

JButton5=new JButton();
JButton5.setBounds(150.680.100.80);
JButton5.setText("5");
JButton5.setEditable(false);
contentPane.add(JButton5);
JButton5.addActionListener(

new ActionListener() {
public void actionPerformed( ActionEvent event ){
oneTonineJButtonActionPerformed("5");
}
}
);

JButton6=new JButton();
JButton6.setBounds(250.680.100.80);
JButton6.setText("6");
JButton6.setEditable(false);
contentPane.add(JButton6);
JButton6.addActionListener(

new ActionListener() {
public void actionPerformed( ActionEvent event ){
oneTonineJButtonActionPerformed( "6" );
}
}
);

JButton7=new JButton();
JButton7.setBounds(50.760.100.80);
JButton7.setText("7");
JButton7.setEditable(false);
contentPane.add(JButton7);
JButton7.addActionListener(

new ActionListener() {
public void actionPerformed( ActionEvent event ){
oneTonineJButtonActionPerformed("7");
}
}
);

JButton8=new JButton();
JButton8.setBounds(150.760.100.80);
JButton8.setText("8");
JButton8.setEditable(false);
contentPane.add(JButton8);
JButton8.addActionListener(

new ActionListener() {
public void actionPerformed( ActionEvent event ){
oneTonineJButtonActionPerformed("8");
}
}
);

JButton9=new JButton();
JButton9.setBounds(250.760.100.80);
JButton9.setText("9");
JButton9.setEditable(false);
contentPane.add(JButton9);
JButton9.addActionListener(

new ActionListener() {
public void actionPerformed( ActionEvent event ){
oneTonineJButtonActionPerformed("9");
}
}
);

guanliyuanJButton =new JButton();
guanliyuanJButton.setBounds(360.300.200.60);
guanliyuanJButton.setText("管理员登陆");
guanliyunanJButton.addActionListener(

new ActionListener() {
public void actionPerformed( ActionEvent event ){
guanliyuanJButtonActionPerformed( event );
}
}
);
contentPane.add(guanliyuanJButton);

yonghuJButton =new JButton();
yonghuJButton.setBounds(360.360.200.60);
yonghuJButton.setText("用户登陆");
yonghuJButton.addActionListener(

new ActionListener() {
public void actionPerformed( ActionEvent event ){
yonghuJButtonActionPerformed( event );
}
}
);
contentPane.add(yonghuJButton);


什么时候才能成为论坛游民啊....
2005-11-10 22:13
曾阿牛
Rank: 1
等 级:新手上路
帖 子:68
专家分:0
注 册:2005-10-14
收藏
得分:0 

chaxunJButton =new JButton();
chaxunJButton.setBounds(360.420.200.60);
chaxunJButton.setText("查询");
chaxunJButton.setEditable(false);
chaxunJButton.addActionListener(

new ActionListener() {
public void actionPerformed( ActionEvent event ){
chaxunJButtonActionPerformed( event );
}
}
);
contentPane.add(chaxunJButton);

lishiJButton =new JButton();
lishiJButton.setBounds(360.480.200.60);
lishiJButton.setText("历史记录");
lishiJButton.setEditable(false);
lishiJButton.addActionListener(

new ActionListener() {
public void actionPerformed( ActionEvent event ){
lishiJButtonActionPerformed( event );
}
}
);
contentPane.add(lishiJButton);


cunkuanJButton =new JButton();
cunkuanJButton.setBounds(360.520.200.60);
cunkuanJButton.setText("存款");
cunkuanJButton.setEditable(false);
cunkuanJButton.addActionListener(

new ActionListener() {
public void actionPerformed( ActionEvent event ){
cunkuanJButtonActionPerformed( event );
}
}
);
contentPane.add(cunkuanJButton);

qukuanJButton =new JButton();
qukuanJButton.setBounds(360.580.200.60);
qukuanJButton.setText("取款");
qukuanJButton.setEditable(false);
qukuanJButton.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent event ){
qukuanJButtonActionPerformed( event );
}
}
);
contentPane.add(qucunkuanJButton);

fenghaoJButton =new JButton();
fenghaoJButton.setBounds(360.640.200.60);
fenghaoJButton.setText("封号");
fenghaoJButton.setEditable(false);
fenghaoJButton.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent event ){
fenghaoJButtonActionPerformed( event );
}
}
);
contentPane.add(fenghaoJButton);

jiechufenghaoJButton =new JButton();
jiechufenghaoJButton.setBounds(360.700.200.60);
jiechufenghaoJButton.setText("解除封号");
jiechuJButton.setEditable(false);
jiechufenghaoJButton.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent event ){
jiechufenghaoJButtonActionPerformed( event );
}
}
);
contentPane.add(jiechufenghaoJButton);

xinjianJButton =new JButton();
xinjianJButton.setBounds(360.760.200.60);
xinjianJButton.setText("新建帐号");
xinjianJButton.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent event ){
xinjianJButtonActionPerformed( event );
}
}
);
contentPane.add(xinjianJButton);

tuichuJButton =new JButton();
tuichuJButton.setBounds(360.820.200.60);
tuichuJButton.setText("退出当前帐号");
tuichuJButton.setEditable(false);
tuichuJButton.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent event ){
tuichuJButtonActionPerformed( event );
}
}
);
contentPane.add(tuichuJButton);

genggaiJButton =new JButton();
genggaiJButton.setBounds(360.880.200.60);
genggaiJButton.setText("更改密码");
genggaiJButton.setEditable(false);
genggaiJButton.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent event ){
genggaiJButtonActionPerformed( event );
}
}
);
contentPane.add(genggaiJButton);

quedingJButton=new JButton();
quedingJButton.setEditable(false);
quedingJButton.setBounds(260.300.60.60);
quedingJButton.setText("确定");
quedingJButton.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent event ){
quedingJButtonActionPerformed( event );
}
}
);
contentPane.add(quedingJButton);

setTitle("银行帐户系统");
setSize(560,960);
setVisible(true);


}

private void guanliyuanJButtonActionPerformed(ActionEvent event ){
if((zhanghuJTextField.getText()=="")||(mimaJTextField.getText()==""))
{xianshiJTextArea.setText("请输入帐号和密码");
zhanghuJTextField.setEditable(true);
xinjianJButton.setEditable(false);
yonghuJButton.setEditable(false);
mimaPasswordField.setEditable(true);
quedingJButton.setEditable(true);
JButton0.setEditable(true);
JButton1.setEditable(true);
JButton2.setEditable(true);
JButton3.setEditable(true);
JButton4.setEditable(true);
JButton5.setEditable(true);
JButton6.setEditable(true);
JButton7.setEditable(true);
JButton8.setEditable(true);
JButton9.setEditable(true);
}
else{
guanzanghu=zhanghuJTextField.getText();
guanmima=mimaPasswordField.getText();
if((guanzhanghu==guanliyuanzhanghu)&&(guanmima==gnanliyuanmima))
{dengluzhi=1;
zhanghuJTextField.setEditable(false);
mimaPasswordField.setEditable(false);
zhanghuJTextField.setText("");
mimaPasswordField.setText("");
xianshiJTextArea.setText("管理员登陆成功");
yonghuJButton.setEditable(false);
guanliyuanJButton.setEditable(false);
xinjianJButton.setEditable(true);
chaxunJButton.setEditable(true);
lishiJButton.setEditable(true);
fenghaoJButton.setEditable(true);
jiechufenghaoJButton.setEditable(true);
tuichuJButton.setEditable(true);
JButton0.setEditable(false);
JButton1.setEditable(false);
JButton2.setEditable(false);
JButton3.setEditable(false);
JButton4.setEditable(false);
JButton5.setEditable(false);
JButton6.setEditable(false);
JButton7.setEditable(false);
JButton8.setEditable(false);
JButton9.setEditable(false);
}
else {xianshiJTextArea.setText("管理员帐号密码不正确请重新登陆");
guanliyuanJButtonActionPerformed(event );
}

}
}

private void yonghuJButtonActionPerformed(ActionEvent event ){
if((zhanghuJTextField.getText()=="")||(mimaPasswordField.getText()==""))
{xianshiJTextArea.setText("请输入帐号和密码");
mimaPasswordField.setEditable(true);
yonghuJButton.setEditable(true);
quedingJButton.setEditable(true);
guanliyuanJButton.setEditable(false);
xinjianJButton.setEditable(false);
JButton0.setEditable(true);
JButton1.setEditable(true);
JButton2.setEditable(true);
JButton3.setEditable(true);
JButton4.setEditable(true);
JButton5.setEditable(true);
JButton6.setEditable(true);
JButton7.setEditable(true);
JButton8.setEditable(true);
JButton9.setEditable(true);
}
else {
zhanghu=zhanghuJTextField.getText();
mima=mimaPasswordField.getText();
Class.forName(DATEBASEDRIVER);
myConnection=DriverManager.getConnection(DATEBASEURL);
myStatement=myConnection.creatStatement();
myResultSet=myStatement.executeQuery("SELECT zhanghuku FROM Yinhangzhanghu");
int t=0;
String a;
while (myResultSet.next()&&(t==o))
{a=myResultSet.getString("zhanghuku");
if (a==zhanghu) t=1;
}
if(t==0)
{xianshiJTextArea.setText("数据库无此信息");
myResultSet.close();
myStatement.close();
myConnection.close();
tuichuJButtonActionPerformed( event );
}
else{myResultSet.close();
myResultSet=myStatement.executeQuery("SELECT zhanghuku,mimaku,anquanku,suodingku,suodingdateku,jingbaodateku FROM Yinhangzhanghu WHERE zhanghuku='"+zhanghu+"'");
jsuoding=myResultSet.getInt("suodingku");
Date dangqiandate=new Date();
jsuodingdate=myResultSet.getDate("suodingdateku");
if((jsuoding==0)&&panduansuoding(jsuodingdate,dangqiandate))
{
myResultSet.close();
myStatement.close();
myConnection.close();
xianshiJTextArea.setText("此帐号已经被锁定 锁定日期为"+jsuodingdate+"锁定时间为60秒");

tuichuJButtonActionPerformed( event );
}
else{
jmima=myResultSet.getString("mimaku");
janquan=myResultSet.getInt("anquanku");

if(jmima=mima)

{
if(janquan==0)

{
myResultSet.close();

myStatement.executeUpdate("UPDATE Yinhangzhanghu SET jinbaoku=1 WHERE zhanghuku='"+zhanghu+"'");

Date nowdate =new Date();

myStatement.executeUpdate("UPDATE Yinhangzhanghu SET jingbaodateku='"+nowdate +"'"+"WHERE zhanghuku='"+zhanghu+"'");

myStatement.close();
myConnection.close();
tuichuJButtonActionPerformed( event );
xianshiJTextArea.setText("帐号密码错误 第一次警告 若30秒内再错两次 将对此帐号封号");
}
else if (janquan==1){
jjinggaodate =myResultSet.getDate("jinggaodateku");
Date nowdate =new Date();

if(panduanjinggao(jjinggaodate,nowdate)){
myResultSet.close();

myStatement.executeUpdate("UPDATE Yinhangzhanghu SET jingbaodateku='"+nowdate+"'"+"WHERE zhanghuku='"+zhanghu+"'");
myStatement.close();
myConnection.close();
tuichuJButtonActionPerformed();
xianshiJTextArea.setText("帐号密码错误 第一次警告 若30秒内再错两次 将对此帐号封号");
}

else if(!(panduanjinggao(jjinggaodate,nowdate))){
myResultSet.close();
myStatement.executeUpdate("UPDATE Yinhangzhanghu SET jinbaoku=2 WHERE zhanghuku='"+zhanghu+"'");

myStatement.close();
myConnection.close();
tuichuJButtonActionPerformed();
xianshiJTextArea.setText("帐号密码错误 第二次警告
若30秒内再错两次 将对此帐号封号");
}
}
else if(janquan==2){
jjinggaodate=myResultSet.getDate("jinggaodateku");
Date nowdate =new Date();
if(panduanjinggao(jjinggaodate,nowdate)){
fenghaoJButtonActionPerformed( event );
myResultSet.close();
myStatement.close();
myConnection.close();
tuichuJButtonActionPerformed( event );
xianshiJTextArea.setText("已经连帐号连续3次输错 此帐号已经被封号 60秒内无法登陆 请与管理员联系");
}
else if {
myResultSet.close();
myStatement.executeUpdate("UPDATE Yinhangzhanghu SET jingbaodateku='"+nowdate+"'"+"WHERE zhanghuku='"+zhanghu+"'");

myStatement.executeUpdate("UPDATE Yinhangzhanghu SET jinbaoku=1 WHERE zhanghuku='"+zhanghu+"'");

myStatement.close();
myConnection.close();
tuichuJButtonActionPerformed();
xianshiJTextArea.setText("帐号密码错误 第一次警告
若30秒内再错两次 将对此帐号封号");
}
}
else {
myResultSet.close();
myStatement.executeUpdate("UPDATE Yinhangzhanghu SET jinbaoku=2 WHERE zhanghuku='"+zhanghu+"'");
myStatement.close();
myConnection.close();
xianshiJTextArea.setText("用户登陆成功");
zhanghuJTextField.setText("");
mimaPasswordField.setText("");
yonghuJButton.setEditable(false);
guanliyuanJButton.setEditable(false);
xinjianJButton.setEditable(false);
chaxunJButton.setEditable(true);
lishiJButton.setEditable(true);
fenghaoJButton.setEditable(false);
jiechufenghaoJButton.setEditable(false);
tuichuJButton.setEditable(true);
cunkuanJButton.setEditable(true);
qukuanJButton.setEditable(true);
genggaimimaJButton.setEditable(true);
quedingJButton.setEditable(false);
JButton0.setEditable(false);
JButton1.setEditable(false);
JButton2.setEditable(false);
JButton3.setEditable(false);
JButton4.setEditable(false);
JButton5.setEditable(false);
JButton6.setEditable(false);
JButton7.setEditable(false);
JButton8.setEditable(false);
JButton9.setEditable(false);
dengluzhi=0;
}

}
}
}
}//定义结束


什么时候才能成为论坛游民啊....
2005-11-10 22:14
曾阿牛
Rank: 1
等 级:新手上路
帖 子:68
专家分:0
注 册:2005-10-14
收藏
得分:0 

private void chaxunJButtonActionPerformed(ActionEvent event ){
if(dengluzhi==1){
String s=zhanghufuzhi();
if(s=='0'){
chaxunJButtonActionPerformed();

}
}
Class.forName(DATEBASEDRIVER);
myConnection=DriverManager.getConnection(DATEBASEURL);
myStatement=myConnection.creatStatement();
myResultSet=myStatement.executeQuery("SELECT zhanghuku jineku shijianku FROM Yinhangzhanghu WHERE zhanghuku='"+zhanghu+"'");
jjine=myResultSet.getDouble("jineku");
jshijian=myResultSet.getDate("shijianku");
xianshiJTextArea.setText("余额\t时间\n"+jjine+"\t"+jshijian+"\n");
myResultSet.close();
myStatement.close();
myConnection.close();
}//查询触发事件定义结束

private void cunkuanJButtonActionPerformed(ActionEvent event ){
if(jineJTextField.getText()==""){
jineJTextField.setEditable(true);
bizhongJComboBox.setEditable(true);
JButton0.setEditable(true);
JButton1.setEditable(true);
JButton2.setEditable(true);
JButton3.setEditable(true);
JButton4.setEditable(true);
JButton5.setEditable(true);
JButton6.setEditable(true);
JButton7.setEditable(true);
JButton8.setEditable(true);
JButton9.setEditable(true);
xianshiJTextArea.setText("请输入你要存的币种和金额");

}
else {
double jine1;
jine1=Integer.DoubleValue(jineJTextField.getText());
Class.forName(DATEBASEDRIVER);
myConnection=DriverManager.getConnection(DATEBASEURL);
myStatement=myConnection.creatStatement();
myResultSet=myStatement.executeQuery("SELECT zhanghuku jineku FROM Yinhangzhanghu WHERE zhanghuku='"+zhanghu+"'");
jjine=myResultSet.getDouble("jineku");
double bizhong;
else if(bizongJComboBox.getSelectedIndex()==0) bizhong=MEIYUAN;
else if(bizongJComboBox.getSelectedIndex()==1) bizhong=RENMINBI;
if(bizongJComboBox.getSelectedIndex()==2) bizhong=RIYUAN;
jine1=jjine+jine1*bizhong;
myResultSet.close();
myStatement.executeUpdate("UPDATE Yinhangzhanghu SET jineku='"+jine1+"'"+ WHERE zhanghuku='"+zhanghu+"'");
myStatement.close();
myConnection.close();
myConnection=DriverManager.getConnection(DATEBASEURL);
myStatement=myConnection.creatStatement
(myResultSet.TYPE_SCROLL_INSENSITIVE,myResultSet.CONCUR_UPDATABLE);
Date nowdate =new date();
myResultSet=myStatement.executeQuery(query);
myResultSet.moveToInsertRow();
myResultSet.updateDate("shijianjilu",nowdate);
myResultSet.updateDouble("jinejilu",jine1);
myResultSet.InsertRow();
myResultSet.close();
myStatement.close();
myConnection.close();
xianshiJTextArea.setText("存款成功 存款记录已经添加到您个人帐户记录中");
jineJTextField.setEditable(false);
jineJTextField.setText("");
bizhongJComboBox.setEditable(false);
JButton0.setEditable(false);
JButton1.setEditable(false);
JButton2.setEditable(false);
JButton3.setEditable(false);
JButton4.setEditable(false);
JButton5.setEditable(false);
JButton6.setEditable(false);
JButton7.setEditable(false);
JButton8.setEditable(false);
JButton9.setEditable(false);
}
}//存款定义结束

private void qukuanJButtonActionPerformed(ActionEvent event ){
if(jineJTextField.getText()==""){
jineJTextField.setEditable(true);
bizhongJComboBox.setEditable(true);
JButton0.setEditable(true);
JButton1.setEditable(true);
JButton2.setEditable(true);
JButton3.setEditable(true);
JButton4.setEditable(true);
JButton5.setEditable(true);
JButton6.setEditable(true);
JButton7.setEditable(true);
JButton8.setEditable(true);
JButton9.setEditable(true);
xianshiJTextArea.setText("请输入你要取的币种和金额");

}
else {
double jine1;
jine1=Integer.DoubleValue(jineJTextField.getText());
Class.forName(DATEBASEDRIVER);
myConnection=DriverManager.getConnection(DATEBASEURL);
myStatement=myConnection.creatStatement();
myResultSet=myStatement.executeQuery("SELECT zhanghuku jineku FROM Yinhangzhanghu WHERE zhanghuku='"+zhanghu+"'");
jjine=myResultSet.getDouble("jineku");
double bizhong;
if(bizongJComboBox.getSelectedIndex()==0) bizhong=MEIYUAN;
else if(bizongJComboBox.getSelectedIndex()==1) bizhong=RENMINBI;
else if(bizongJComboBox.getSelectedIndex()==2) bizhong=RIYUAN;

if(jjine<jine1*bizhong){
xianshiJTextArea.setText("余额不足 请重新输入");
jineJTextField.setText("");
qukuanJButtonActionPerformed(event );
}
else{
jine1=jine1-jine1*bizhong;
myResultSet.close();
myStatement.executeUpdate("UPDATE Yinhangzhanghu SET jineku='"+jine1+"'"+ WHERE zhanghuku='"+zhanghu+"'");
myStatement.close();
myConnection.close();
myConnection=DriverManager.getConnection(DATEBASEURL);
myStatement=myConnection.creatStatement(myResultSet.TYPE_SCROLL_INSENSITIVE,myResultSet.CONCUR_UPDATABLE);
Date nowdate =new date();
myResultSet=myStatement.executeQuery(query);
myResultSet.moveToInsertRow();
myResultSet.updateDate("shijianjilu",nowdate);
myResultSet.updateDouble("jinejilu",jine1);
myResultSet.InsertRow();
myResultSet.close();
myStatement.close();
myConnection.close();
xianshiJTextArea.setText("取款成功 取款记录已经添加到您个人帐户记录中");
jineJTextField.setEditable(false);
jineJTextField.setText("");
bizhongJComboBox.setEditable(false);
JButton0.setEditable(false);
JButton1.setEditable(false);
JButton2.setEditable(false);
JButton3.setEditable(false);
JButton4.setEditable(false);
JButton5.setEditable(false);
JButton6.setEditable(false);
JButton7.setEditable(false);
JButton8.setEditable(false);
JButton9.setEditable(false);
}
}//定义结束

private void xinjianJButtonActionPerformed(ActionEvent event ){
if(zhanghuJTextField.getText()==""){
mimaJPasswordField.setEditable(true);
zhanghuJTextField.setEditable(true);
quedingJButton.setEditable(true);
JButton0.setEditable(true);
JButton1.setEditable(true);
JButton2.setEditable(true);
JButton3.setEditable(true);
JButton4.setEditable(true);
JButton5.setEditable(true);
JButton6.setEditable(true);
JButton7.setEditable(true);
JButton8.setEditable(true);
JButton9.setEditable(true);
xianshiJTextArea.setText("请输入要建立的帐号的帐号名和密码");
}
else {
zhanghu=zhanghuJTextField.getText();
mima=mimaJPasswordField.getText();
Class.forName(DATEBASEDRIVER);
myConnection=DriverManager.getConnection(DATEBASEURL);
myStatement=myConnection.creatStatement();
myResultSet=myStatement.executeQuery("SELECT zhanghuku FROM Yinhangzhanghu");
int t=0;
String a;
while (myResultSet.next()&&(t==o))
{a=myResultSet.getString("zhanghuku");
if (a==zhanghu) t=1;
}
myResultSet.close();
myStatement.close();
if(t==1){
myConnection.close();
xianshiJTextArea.setText("此帐户已经被占用");
xinjianJButtonActionPerformed(event );
}
else {
myStatement=myConnection.creatStatement(myResultSet.TYPE_SCROLL_INSENSITIVE,
myResultSet.CONCUR_UPDATABLE);
Date nowdate=new Date();
myResultSet=myStatement.executeQuery(query);
myResultSet.moveToInsertRow();
myResultSet.updateSring("zhanghuku",zhanghu);
myResultSet.updateSring("mimaku",mima);
myResultSet.updateDouble("jineku",0);
myResultSet.updateDate("shijianku",nowdate);
myResultSet.updateDate("suodingdate",nowdate);
myResultSet.updateInt("anquanku",0);
myResultSet.updateInt("suodingku",0);
myResultSet.InsertRow();
myResultSet.close();
myStatement.close();
chuangjianxinbiao("Yinhangzhanghu"+zhanghu,"shijianjilu","jinejilu");
myStatement=myConnection.creatStatement
(myResultSet.TYPE_SCROLL_INSENSITIVE,
myResultSet.CONCUR_UPDATABLE);
myResultSet=myStatement.executeQuery(query);
myResultSet.moveToInsertRow();
myResultSet.updateDate("shijianjilu",nowdate);
myResultSet.updateDouble("jinejilu",0);
myResultSet.InsertRow();
myResultSet.close();
myStatement.close();
myConnection.close();
}
}
xianshiJTextArea.setText("创建成功");
mimaJPasswordField.setEditable(false);
zhanghuJTextField.setEditable(false);
quedingJButton.setEditable(false);
zhanghuJTextField.setText("");
mimaJPasswordField.setText("");
JButton0.setEditable(false);
JButton1.setEditable(false);
JButton2.setEditable(false);
JButton3.setEditable(false);
JButton4.setEditable(false);
JButton5.setEditable(false);
JButton6.setEditable(false);
JButton7.setEditable(false);
JButton8.setEditable(false);
JButton9.setEditable(false);
}//定义结束

private void lishiJButtonActionPerformed(ActionEvent event ){
if (dengluzhi=1){
String s=zhanghufuzhi();
if(s=='0'){
lishiJButtonActionPerformed();
xianshiJTextArea.setText("无此帐号");
}
else zhanghu=s;
}

Class.forName(DATEBASEDRIVER);
myConnection=DriverManager.getConnection(DATEBASEURL);
myStatement=myConnection.creatStatement();
myResultSet=myStatement.executeQuery(query);
xianshiJTextArea.setText("时间\t"+"金额\n");
while (myResultSet.next()){
xianshiJTextArea.setText(xianshiJTextArea.getText()+myResultSet.getDate("shijianjilu")+"\t"+"jinejilu"+"\n");

}
myResultSet.close();
myStatement.close();
myConnection.close();
}//定义结束

什么时候才能成为论坛游民啊....
2005-11-10 22:15
曾阿牛
Rank: 1
等 级:新手上路
帖 子:68
专家分:0
注 册:2005-10-14
收藏
得分:0 

private void genggaimimaJButtonActionPerformed(ActionEvent event ){
if(mimaJPasswordField.getText()==""){
mimaJPasswordField.setEditable(true);
JButton0.setEditable(true);
JButton1.setEditable(true);
JButton2.setEditable(true);
JButton3.setEditable(true);
JButton4.setEditable(true);
JButton5.setEditable(true);
JButton6.setEditable(true);
JButton7.setEditable(true);
JButton8.setEditable(true);
JButton9.setEditable(true);
xianshiJTextArea.setText("请输入新密码");
}

else {
mima=mimaJPasswordField.getText();
Class.forName(DATEBASEDRIVER);
myConnection=DriverManager.getConnection(DATEBASEURL);
myStatement=myConnection.creatStatement();
myStatement.executeUpdate("UPDATE Yinhangzhanghu SET mimaku='"+mima+"'"+"WHERE zhanghuku='"+zhanghu+"'");
myResultSet.close();
myStatement.close();
myConnection.close();
mimaJPasswordField.setText("");
mimaJPasswordField.setEditable(false);
JButton0.setEditable(false);
JButton1.setEditable(false);
JButton2.setEditable(false);
JButton3.setEditable(false);
JButton4.setEditable(false);
JButton5.setEditable(false);
JButton6.setEditable(false);
JButton7.setEditable(false);
JButton8.setEditable(false);
JButton9.setEditable(false);
xianshiJTextArea.setText("修改新密码成功");
}
}//定义结束

private void tuichuJButtonActionPerformed(ActionEvent event ){

framewinclose();

guanliyuanJButton.setEditable(true);
yonghuJButton.setEditable(true);
chaxunJButton.setEditable(false);
lishiJButton.setEditable(false);
cunkuanJButton.setEditable(false);
qukuanJButton.setEditable(false);
fenghaoJButton.setEditable(false);
tuichuJButton.setEditable(false);
xinjianJButton.setEditable(true);
quedingJButton.setEditable(false);
jiechufenghaoJButton.setEditable(false);
genggaimimaJButton.setEditable(false);

zhanghuJTextField.setEditable(false);
mimaJPasswordField.setEditable(false);
jineJTextField.setEditable(false);
zhanghuJTextField.setText("");
mimaJPasswordField.setText("");
jineJTextField.setText("");

bizongJComboBox.setEditable(false);

JButton0.setEditable(false);
JButton1.setEditable(false);
JButton2.setEditable(false);
JButton3.setEditable(false);
JButton4.setEditable(false);
JButton5.setEditable(false);
JButton6.setEditable(false);
JButton7.setEditable(false);
JButton8.setEditable(false);
JButton9.setEditable(false);
}//定义结束

private void fenghaoJButtonActionPerformed(ActionEvent event ){
if(zhanghuJTextField.getText()==""){
zhanghuJTextField.setEditable(true);
JButton0.setEditable(true);
JButton1.setEditable(true);
JButton2.setEditable(true);
JButton3.setEditable(true);
JButton4.setEditable(true);
JButton5.setEditable(true);
JButton6.setEditable(true);
JButton7.setEditable(true);
JButton8.setEditable(true);
JButton9.setEditable(true);
xianshiJTextArea.setText("请输入要封的号");
}
else {
zhanghu=zhanghuJTextField.getText();
Class.forName(DATEBASEDRIVER);
myConnection=DriverManager.getConnection(DATEBASEURL);
myStatement=myConnection.creatStatement();
myStatement.executeUpdate("UPDATE Yinhangzhanghu SET suodingku='"+1+"'"+"WHERE zhanghuku='"+zhanghu+"'");
myResultSet.close();
myStatement.close();
myConnection.close();
zhanghuJTextfield.setText("");
zhanghuJTextField.setEditable(false);
xianshiJTextArea.setText("封号成功");
}
}//结束

private void jiechufenghaoJButtonActionPerformed(ActionEvent event ){
if(zhanghuJTextField.getText()==""){
zhanghuJTextField.setEditable(true);
JButton0.setEditable(true);
JButton1.setEditable(true);
JButton2.setEditable(true);
JButton3.setEditable(true);
JButton4.setEditable(true);
JButton5.setEditable(true);
JButton6.setEditable(true);
JButton7.setEditable(true);
JButton8.setEditable(true);
JButton9.setEditable(true);
xianshiJTextArea.setText("请输入要封的号");
}

else {
zhanghu=zhanghuJTextField.getText();
Class.forName(DATEBASEDRIVER);
myConnection=DriverManager.getConnection(DATEBASEURL);
myStatement=myConnection.creatStatement();
myStatement.executeUpdate("UPDATE Yinhangzhanghu SET suodingku=0 anquanku=0 WHERE zhanghuku='"+zhanghu+"'");
myResultSet.close();
myStatement.close();
myConnection.close();
zhanghuJTextfield.setText("");
zhanghuJTextField.setEditable(false);
xianshiJTextArea.setText("解除封号成功");
}
}//结束

private boolean panduanjinggao(Date date1,Date date2){
if((date2.GetTime()-date1.GetTime())>30000) return true;
else return false;
}

private boolean panduansuoding(Date date1,Date date2){
if((date2.GetTime()-date1.GetTime())<60000) return true;
else return false;
}

private void oneTonineJButtonActionPerformed(String number){
if(zhanghuJTextField.getsetEditable())
zhanghuJTextField.setText(zhanghuJTextField.getText()+number);
else if(!zhanghuJTextField.getsetEditable()&&mimaJPasswordField.getsetEditable())
mimaJPasswordField.setText(mimaJPasswordField.getText()+number);
else if(!zhanghuJTextField.getsetEditable()&&!mimaJPasswordField.getsetEditable())
jineJTextField.setText(jineJTextField.getText()+number);
}

private void quedingJButtonActionPerformed(ActionEvent event ){
zhanghuJTextField.setEditable(false);
quedingJButton.setEditable(false);
}

private void chuangjianxinbiao(String a,String b,String,c){
Class.forName(DATEBASEDRIVER);
myConnection=DriverManager.getConnection(DATEBASEURL);
myStatement=myConnection.creatStatement();
myStatement.executeUpdate("CREATE TABLE Yinhangzhanghu"+zhanghu+"(shijianjilu CHAR(30),jinejilu CHAR(30);)");
myResultSet.close();
myStatement.close();
myConnection.close();
}

private void framewinclose(WindowEvent event){
if (!myResultSet.close()) myResultSet.close();
if (!myStatement.close()) myStatement.close();
if (!myConnection.close()) myConnection.close();
}

private String zhanghufuzhi(){
String a,b;
zhanghuJTextField.setEditable(true);
JButton0.setEditable(true);
JButton1.setEditable(true);
JButton2.setEditable(true);
JButton3.setEditable(true);
JButton4.setEditable(true);
JButton5.setEditable(true);
JButton6.setEditable(true);
JButton7.setEditable(true);
JButton8.setEditable(true);
JButton9.setEditable(true);
zhanghuJTextField.setText("");
quedingJButton.setEditable(true);
xianshiJTextArea.setText("请输入帐号并点击确定");
while (!zhanghuJTextField.getEditable()){
a=zhanghuJTextField.getText();
Class.forName(DATEBASEDRIVER);
myConnection=DriverManager.getConnection(DATEBASEURL);
myStatement=myConnection.creatStatement();
myResultSet=myStatement.executeQuery("SELECT zhanghuku FROM Yinhangzhanghu");
int i=0;
while (myResultSet.next()&&(i==0)){
b=myResultSet.getString("zhanghuku");
if(a==b) i=1;
}
if (i==0) a='0';
return a;

}
}

}

public static void main (String[] args){
Yinhang yinhang=new Yinghang();
application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}

}


什么时候才能成为论坛游民啊....
2005-11-10 22:16
曾阿牛
Rank: 1
等 级:新手上路
帖 子:68
专家分:0
注 册:2005-10-14
收藏
得分:0 

有好多错误啊 没法通过编译 大家帮我看看

还有 我知道我又在重复原来的错误和敝习 不是我不想改

实在是不会用高手说的方法 我学的实在是太浅了

但我真的很认真的在作了 这个程序很多类和方法我不是很会

用 可能用法不是很对 大家帮我纠正一下吧


什么时候才能成为论坛游民啊....
2005-11-10 22:23
快速回复:[原创]小弟准备做个小项目 不定期公开所有代码的喔 希望大家支持,关注
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.063352 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved