毕业论文论文范文课程设计实践报告法律论文英语论文教学论文医学论文农学论文艺术论文行政论文管理论文计算机安全
您现在的位置: 毕业论文 >> 课程设计 >> 正文

Java程序设计课程设计产品管理系统 第5页

更新时间:2008-6-28:  来源:毕业论文

Java程序设计课程设计产品管理系统 第5页

  sql = sql + "" + jText42.getText() + ",";

                sql = sql + "" + jText43.getText() + ",";

                sql = sql + "" + jText44.getText() + "";

                sql = sql + ")";

            //使用DBManager对象执行操作 ,并返回成功或失败信息

                  if(db.executeSql(sql)){

                    //执行操作后清空文本框

                        reSetAllTextbox();

                     JOptionPane.showMessageDialog(null,"操作成功!");

                   }

                   else

                           {

                            JOptionPane.showMessageDialog(null,"操作失败  !");

                            }

  }

4.3产品入库管理模块

这部分要实现将产品数量信息更新到数据库的功能,用户需要提供产品的数量和其他相关信息。

还要实现对产品出库的历史记录进行查询及修改的操作。我们所要显示的信息包括:款型、出库日期、颜色、操作员、备注和相应鞋码的鞋的数量。由于查询结果是多条的,因此要可以显示查询结果集中的所有记录。

 

431此部分功能代码

void jButtonAdd_mouseClicked(MouseEvent e) {

    //判断款型和颜色是否为空,若有为空的弹出警告信息

     if(jTextkuanxing.getText().trim().equals("")&&jTextkuanxing.getText().trim().equals(""))

     {

        JOptionPane.showMessageDialog(null," 款型和颜色不许为空!");

       return;

     }

       String sql;

       //生成sql语句

       sql="select * from ProductStore ";

       sql=sql+"  where  Model='"+jTextkuanxing.getText().trim()+"'";

       sql=sql+" and Color='"+jCombocolor.getSelectedItem().toString().trim() +"'";

        //执行搜索,检验此款型和颜色对应的鞋是否已存在

       rs =db.getResult(sql);

           try {

             //如果已存在,则将原数据库中的数目加上新加入的数目并执行更新操作

            if (rs.first() ) {

              sql = "update ProductStore set Number36= Number36+" +jText36.getText().trim()+",";

              sql = sql + " Number37 =Number37+" +  jText37.getText().trim() + ",";

              sql = sql + " Number38 =Number38 +" +  jText38.getText().trim() + ",";

              sql = sql + " Number39=Number39 +" + jText39.getText().trim() + ",";

              sql = sql + " Number40=Number40+" +  jText40.getText().trim() +",";

              sql = sql + " Number41=Number41+" +  jText41.getText().trim() +",";

              sql = sql + " Number42=Number42+" +  jText42.getText().trim() +",";

              sql = sql + " Number43=Number43+"  +  jText43.getText().trim() +",";

              sql = sql + " Number44=Number44+"+ jText44.getText().trim() +" ";

              sql = sql + " where Model='" + jTextkuanxing.getText().trim() + "'";

              sql = sql + " and Color ='" +  jCombocolor.getSelectedItem().toString().trim() + "'";

              }

            //如果不存在,则执行插入操作,插入新信息

            else {

              sql="insertinto ProductStore(Model,Color,Number36,Number37,Number38,Number39,Number40,Number41,Number42,Number43,Number44)values(  ";

              sql = sql + "'" + jTextkuanxing.getText() + "',";

              sql = sql + "'" + jCombocolor.getSelectedItem().toString() + "',";

              sql = sql + "" + jText36.getText() + ",";

              sql = sql + "" + jText37.getText() + ",";

              sql = sql + "" + jText38.getText() + ",";

              sql = sql + "" + jText39.getText() + ",";

              sql = sql + "" + jText40.getText() + ",";

              sql = sql + "" + jText41.getText() + ",";

              sql = sql + "" + jText42.getText() + ",";

              sql = sql + "" + jText43.getText() + ",";

              sql = sql + "" + jText44.getText() + "";

              sql = sql + ")";

            }

          }

          catch (SQLException ex) {

          }

     //使用DBManager对象执行操作 ,并返回成功或失败信息

     (null,"操作成功!");

       }

               //当然对于产品入库信息表始终是插入新值

       sql="insertintoProductIn(Model,Color,Datein,Operator, Comment,Number36,Number37,Number38,Number39,Number40,Number41,Number42,Number43,Number44)values(  ";

              sql = sql + "'" + jTextkuanxing.getText() + "',";

              sql = sql + "'" + jCombocolor.getSelectedItem().toString() + "',";

              sql = sql + "" + jText38.getText() + ",";

              sql = sql + "" + jText39.getText() + ",";

              sql = sql + "" + jText40.getText() + ",";

              sql = sql + "" + jText41.getText() + ",";

              sql = sql + "" + jText42.getText() + ",";

              sql = sql + "" + jText43.getText() + ",";

              sql = sql + "" + jText44.getText() + "";

              sql = sql + ")";

                 }

                 else

                          {

                          JOptionPane.showMessageDialog(null,"操作失败  !");

                          }

  }

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]  ... 下一页  >> 

Java程序设计课程设计产品管理系统 第5页下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©youerw.com 优文论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。