固定资产管理系统源代码.docx

上传人:b****8 文档编号:11317552 上传时间:2023-02-26 格式:DOCX 页数:65 大小:28.66KB
下载 相关 举报
固定资产管理系统源代码.docx_第1页
第1页 / 共65页
固定资产管理系统源代码.docx_第2页
第2页 / 共65页
固定资产管理系统源代码.docx_第3页
第3页 / 共65页
固定资产管理系统源代码.docx_第4页
第4页 / 共65页
固定资产管理系统源代码.docx_第5页
第5页 / 共65页
点击查看更多>>
下载资源
资源描述

固定资产管理系统源代码.docx

《固定资产管理系统源代码.docx》由会员分享,可在线阅读,更多相关《固定资产管理系统源代码.docx(65页珍藏版)》请在冰豆网上搜索。

固定资产管理系统源代码.docx

固定资产管理系统源代码

/////////////////////////////////////////////////////////////////////////////////////////////////////

用户登录

/////////////////////////////////////////////////////////////////////////////////////////////////////

packagecom.newer.property;

importjava.awt.GridLayout;

importjava.awt.event.ActionEvent;

importjava.awt.event.ActionListener;

importjava.sql.*;

importjava.sql.Statement;

importjava.sql.ResultSet;

importjavax.swing.JButton;

importjavax.swing.JLabel;

importjavax.swing.JTextField;

importjavax.swing.JPasswordField;

importjavax.swing.JPanel;

importjavax.swing.JFrame;

publicclassuser_landextendsJFrameimplementsActionListener{

staticConnectionconn=null;

staticStatementstat=null;

staticResultSetrs=null;

staticStringurl="jdbc:

sqlserver:

//127.0.0.1:

1433;DatabaseName=_Property";

staticStringuser="sa";

staticStringpassword="";

JPanelp1,p2,p3,p4,p5;

JLabellbl1,lbl2,lbl3,lbl4;

JTextFieldtxt_name;

JPasswordFieldtxt_pwd;

JButtonbtn1,btn2,btn3;

static{

try{

Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");

}catch(Exceptione){

System.out.println("加载驱动失败");

e.printStackTrace();

}

}

publicuser_land(){

this.setTitle("固定资产及设备用户登录");

p1=newJPanel();

p2=newJPanel();

p3=newJPanel();

p4=newJPanel();

p5=newJPanel();

lbl1=newJLabel("欢迎登录");

lbl2=newJLabel("用户名:

");

lbl3=newJLabel("密码:

");

lbl4=newJLabel();

txt_name=newJTextField(10);

txt_pwd=newJPasswordField(10);

btn1=newJButton("登录");

btn2=newJButton("清空");

btn3=newJButton("退出");

p1.add(lbl1);

p2.add(lbl2);

p2.add(txt_name);

p3.add(lbl3);

p3.add(txt_pwd);

p4.add(btn1);

p4.add(btn2);

p4.add(btn3);

p5.add(lbl4);

this.setLayout(newGridLayout(5,1));

this.add(p1);

this.add(p2);

this.add(p3);

this.add(p4);

this.add(p5);

this.setBounds(400,300,400,300);

this.setDefaultCloseOperation(EXIT_ON_CLOSE);

this.setVisible(true);

//添加按钮登录事件

btn1.addActionListener(

newActionListener(){

publicvoidactionPerformed(ActionEvente){

if((txt_name.getText().equals("")==true)&&(txt_pwd.getText().equals("")==false))

lbl4.setText("登录失败,用户名不能为空");

if((txt_name.getText().equals("")==false)&&(txt_pwd.getText().equals("")==true))

lbl4.setText("登录失败,密码不能为空");

if((txt_name.getText().equals("")==true)&&(txt_pwd.getText().equals("")==true))

lbl4.setText("登录失败,用户名/密码不能为空");

if(is_Property()){

newSys_interface().show();

}

elseif((txt_name.getText().equals("")==false)&&(txt_pwd.getText().equals("")==false))

lbl4.setText("登录失败,用户名/密码错误");

}

}

);

btn1.addActionListener(this);

//清空用户名和密码

btn2.addActionListener(

newActionListener(){

publicvoidactionPerformed(ActionEvente){

txt_name.setText(null);

txt_pwd.setText(null);

lbl4.setText(null);

}

}

);

//退出

btn3.addActionListener(

newActionListener(){

publicvoidactionPerformed(ActionEvente){

System.exit(0);

}

}

);

}

protectedvoiduser_land(ObjectsetVisible){

//TODOAuto-generatedmethodstub

}

publicbooleanis_Property(){

try{

conn=DriverManager.getConnection(url,user,password);

//System.out.println("连接成功");

stat=conn.createStatement();

Stringsql="select*fromAdmin_Info";

rs=stat.executeQuery(sql);

while(rs.next()){

//System.out.println(rs.getString("A_name")+"\t"+rs.getString("A_pwd"));

Stringname=txt_name.getText();

Stringpwd=txt_pwd.getText();

if(name.equals(rs.getString("A_name"))&&pwd.equals(rs.getString("A_pwd"))){

//System.out.println("登录成功!

");

returntrue;

}

}

}catch(SQLExceptione){

System.out.println("连接失败!

!

!

");

e.printStackTrace();

}

//关闭数据库

finally{

try{

if(rs!

=null){

rs.close();

}

if(stat!

=null){

stat.close();

}

if(conn!

=null){

conn.close();

}

}catch(Exceptione2){

System.out.println("关闭失败");

e2.printStackTrace();

}

}

returnfalse;

}

publicstaticvoidmain(String[]args){

newuser_land();

}

publicvoidactionPerformed(ActionEvente){

//System.exit(0);

this.setVisible(false);

}

}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

主界面

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

packagecom.newer.property;

importjava.awt.BorderLayout;

importjava.awt.Color;

importjava.awt.Dialog;

importjava.awt.FlowLayout;

importjava.awt.Font;

importjava.awt.event.ActionEvent;

importjava.awt.event.ActionListener;

importjavax.swing.JFrame;

importjavax.swing.JLabel;

importjavax.swing.JMenuBar;

importjavax.swing.JMenuItem;

importjavax.swing.JMenu;

importjavax.swing.JPanel;

importjavax.swing.JTextArea;

importjavax.swing.JTextField;

publicclassSys_interfaceextendsJFrameimplementsActionListener{

JPanelp=null;

JMenuItemjmi_1,jmi_2,jmi_3,jmi_4,jmi_5,jmi_6,jmi_7,jmi_8,jmi_9,jmi_10;

JMenuBarjmb=null;

JMenujm_1=null,jm_2=null,jm_3=null,jm_4=null;

JLabeltext;

publicSys_interface(){

this.setTitle("固定资产及设备管理系统");

text=newJLabel("欢迎进入固定资产及设备管理系统");

text.setFont(newFont("宋体",1,28));

text.setForeground(Color.blue);

p=newJPanel();

jmb=newJMenuBar();

jm_1=newJMenu("系统功能");

jm_2=newJMenu("资产管理");

jm_3=newJMenu("系统查询");

jm_4=newJMenu("帮助");

jmi_1=newJMenuItem("用户登录");

jmi_2=newJMenuItem("注销用户");

jmi_3=newJMenuItem("用户添加");

jmi_4=newJMenuItem("退出系统");

jmi_5=newJMenuItem("资产借出管理");

jmi_6=newJMenuItem("资产信息管理");

jmi_7=newJMenuItem("资产信息查询");

jmi_8=newJMenuItem("资产借出查询");

jmi_9=newJMenuItem("资产归还查询");

jmi_10=newJMenuItem("关于");

jm_1.add(jmi_1);

jm_1.add(jmi_2);

jm_1.add(jmi_3);

jm_1.add(jmi_4);

jm_2.add(jmi_5);

jm_2.add(jmi_6);

jm_3.add(jmi_7);

jm_3.add(jmi_8);

jm_3.add(jmi_9);

jm_4.add(jmi_10);

jmb.add(jm_1);

jmb.add(jm_2);

jmb.add(jm_3);

jmb.add(jm_4);

add(text,BorderLayout.CENTER);

this.setJMenuBar(jmb);

//this.setLayout(newBorderLayout());

//this.add(p,BorderLayout.NORTH);

jmi_1.addActionListener(

newActionListener(){

publicvoidactionPerformed(ActionEvente){

newuser_land().show();

}

}

);

jmi_2.addActionListener(this);

jmi_2.addActionListener(newActionListener(){

@Override

publicvoidactionPerformed(ActionEventarg0){

newuser_land().show();

}

});

jmi_3.addActionListener(

newActionListener(){

publicvoidactionPerformed(ActionEvente){

newPass_word().show();

}

}

);

jmi_4.addActionListener(

newActionListener(){

publicvoidactionPerformed(ActionEvente){

System.exit(0);

}

}

);

jmi_5.addActionListener(

newActionListener(){

publicvoidactionPerformed(ActionEvente){

newloan_prop_manage().show();

}

}

);

jmi_6.addActionListener(

newActionListener(){

publicvoidactionPerformed(ActionEvente){

newproperty_Info().show();

}

}

);

jmi_7.addActionListener(

newActionListener(){

publicvoidactionPerformed(ActionEvente){

newprop_info_select().show();

}

}

);

jmi_8.addActionListener(

newActionListener(){

publicvoidactionPerformed(ActionEvente){

newLoan_prop_select().show();

}

}

);

jmi_9.addActionListener(

newActionListener(){

publicvoidactionPerformed(ActionEvente){

newback_prop_select().show();

}

}

);

jmi_10.addActionListener(

newActionListener(){

publicvoidactionPerformed(ActionEvente){

newabout().show();

}

}

);

this.setBounds(200,200,500,400);

this.setDefaultCloseOperation(EXIT_ON_CLOSE);

}

publicvoidactionPerformed(ActionEvente){

//System.exit(0);

this.setVisible(false);

}

publicstaticvoidmain(String[]args){

newSys_interface().show();

}

}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

资产借出管理

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

packagecom.newer.property;

importjava.awt.*;

importjava.awt.event.ActionEvent;

importjava.awt.event.ActionListener;

importjava.sql.*;

importjava.util.Vector;

importjavax.swing.*;

importjava.awt.event.FocusEvent;

importjava.awt.event.FocusListener;

importjava.awt.event.MouseEvent;

importjava.awt.event.MouseListener;

importjavax.swing.event.ListSelectionEvent;

importjavax.swing.event.ListSelectionListener;

importjavax.swing.event.TableModelListener;

importjavax.swing.event.TableModelEvent;

importjavax.swing.table.DefaultTableModel;

importjavax.swing.table.TableModel;

publicclassloan_prop_manageextendsJFrameimplementsActionListener{

Vectordata=null;

DefaultTableModelmodel=null;

Connectionconn=null;

Statementstat=null;

ResultSetrs1=null;

JTableloan_prop=null;

JLabellabel;

JTextFieldtext;

JTextFieldtxt01,txt02,txt03,txt04,txt05,txt06;

JPanelp1=null,p2=null,p3=null,p4,p5,p6,p7,p8,p9,p10;

Choicec1=null,c2=null;

JLabellb1=null,lb2=n

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 求职职场 > 简历

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1