房屋中介管理系統(tǒng)設(shè)計說明書_第1頁
房屋中介管理系統(tǒng)設(shè)計說明書_第2頁
房屋中介管理系統(tǒng)設(shè)計說明書_第3頁
房屋中介管理系統(tǒng)設(shè)計說明書_第4頁
房屋中介管理系統(tǒng)設(shè)計說明書_第5頁
已閱讀5頁,還剩29頁未讀 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

1、山東建筑大學(xué)計算機科學(xué)與技術(shù)學(xué)院程序設(shè)計實用案例選講大作業(yè)說明書題 目: 房地產(chǎn)中介管理系統(tǒng)課 程: 程序設(shè)計實用案例選講 院 (部): 計算機科學(xué)與技術(shù)專 業(yè): 網(wǎng)絡(luò)工程班 級: 網(wǎng)絡(luò)131學(xué)生姓名: 高雷學(xué) 號: 20131113033指導(dǎo)教師: 袁衛(wèi)華完成日期: 2014/01/08山東建筑大學(xué)計算機學(xué)院大作業(yè)設(shè)計說明書目 錄房地產(chǎn)中介管理系統(tǒng)1一、問題描述1二、設(shè)計思想1三、系統(tǒng)結(jié)構(gòu)1四、程序流程(或模塊劃分)2五、源程序3六、系統(tǒng)測試及操作界面22結(jié)論30參考文獻(xiàn)31I山東建筑大學(xué)計算機學(xué)院大作業(yè)設(shè)計說明書房地產(chǎn)中介管理系統(tǒng)一、問題描述某房屋中介公司主要的業(yè)務(wù)包括房屋出租和二手房買賣

2、,請編程實現(xiàn)“房屋中介管理系統(tǒng)”,具體要求如下:一、房源基本信息管理,(房屋編號,戶型(如兩室一廳,三室兩廳),具體地址(坐落位置),建造年月,狀態(tài)(待售,待出租,已售,已出租等),價格(租金/月或售價),房主姓名,聯(lián)系方式等),請編程實現(xiàn)這些基本信息的增、刪、改、查等操作。二、房屋出租操作,對于所有“待出租”狀態(tài)的房屋,可以執(zhí)行出租操作,其狀態(tài)轉(zhuǎn)換為“已出租”,根據(jù)出租的月數(shù),計算租金,并征收中介費(中介費一般等于一個月的租金);處于“已出租”狀態(tài)的房屋不能執(zhí)行該操作.3、 房屋出售操作,對于所有“待出售"狀態(tài)的房屋,可以執(zhí)行出手操作,其狀態(tài)轉(zhuǎn)換為“已售”,根據(jù)房價和中介費計算方法

3、(自己查),計算應(yīng)該征收的中介費二、設(shè)計思想此管理系統(tǒng)主要實現(xiàn)對房源的增刪改查四個主要功能,以及將數(shù)據(jù)輸出保存文件。本系統(tǒng)分為管理員和普通用戶兩個類別用戶,管理員可以對房源信息的增刪改查等操作,普通用戶無法更改信息,可以查詢信息.另外,針對大量的用戶,可以注冊新的用戶。管理員在添加新的房源信息時需要確保輸入每一個信息,否則會提醒管理員輸入完整。修改信息可以修改一個信息,也可以同時修改多個信息,修改成功會依次提示。查詢時主要可以通過查詢戶型以及房屋狀態(tài)查詢。用戶查詢到需要的房源時通過管理員修改房源信息,并將房屋的狀態(tài)改變出租或出售給用戶。3、 系統(tǒng)結(jié)構(gòu)房地產(chǎn)管理系統(tǒng)包括7個主要類:Buildin

4、gSystem。Java:主操作界面,登錄界面、選擇用戶類型等信息Admin.java管理員登錄界面Admin1。java管理員操作界面RegisterException。java用于兩次密碼不一致時拋異常User。java普通用戶登錄界面User1。java普通用戶操作界面ZhuCe。java新用戶注冊四、程序流程(或模塊劃分) 圖41 程序流程圖五、源程序BuildingStystempackagegaolei;publicclassBuildingSystemimplementsRunnable,ActionListenerJFramef1;JPanelp1, p2,p3,p4;JLab

5、ell21;JButtonfunction1, function2, function3, function4;JButtonend;ThreadscollWorsThread;booleanstopScorlling;BuildingSystem() f1 = new JFrame(”-房屋中介管理系統(tǒng)-");p1 = new JPanel();p1。setBackground(Color。white);p1。setLayout(new GridLayout(5, 1, 5, 5));function1 = new JButton(” 【管理員登錄通道】 ”);p1。add(fun

6、ction1);function1。setBackground(Color。getHSBColor(100, 152, 188);function1。addActionListener(this);function2 = new JButton(”【普通用戶登陸通道】”);function2。setBackground(Color.getHSBColor(100, 152, 188);p1.add(function2);function2.addActionListener(this);function3 = new JButton(" 【新用戶注冊】 ”);p1。add(funct

7、ion3);function3。setBackground(Color。getHSBColor(100, 152, 188);function3。addActionListener(this);function4 = new JButton(" 【系統(tǒng)信息】 ”);p1.add(function4);function4.setBackground(Color。getHSBColor(100, 152, 188);function4。addActionListener(this);end = new JButton(” 【 退 出 程 序 】 ");p1。add(end);e

8、nd。setBackground(Color。getHSBColor(100, 152, 188));end。addActionListener(this);f1。add(BorderLayout.EAST, p1);p2 = new JPanel();p2。setBackground(Color。getHSBColor(100, 10,255));p2。setLayout(new GridLayout(3, 1);JLabelempty1=newJLabel(”);p2。add(empty1);l21 = new JLabel(" 高雷房地產(chǎn)公司歡迎您O(_)O ”);l21。se

9、tForeground(Color。DARK_GRAY);l21.setFont(new Font(”華文行楷”,1,17);p2。add(l21);JLabel empty2 = new JLabel(” ”);p2。add(empty2);f1.add(BorderLayout。NORTH, p2);p3 = new JPanel()private static final long serialVersionUID = 1L;public void paint(Graphics g) ImageIcon icon=new ImageIcon(”F:Java information12。p

10、ng”); Image image=icon.getImage(); g.drawImage(image, 0,0, null); ;p3.setBackground(Color。white);JLabel nn = new JLabel(" ”);p3.add(nn);f1。add(BorderLayout.SOUTH, p3);p4 = new JPanel()private static final long serialVersionUID = 1L;public void paint(Graphics g) ImageIcon icon=new ImageIcon(”F:J

11、ava information12。png”); Image image=icon.getImage(); g。drawImage(image, 0,0, null); ;p4。setBackground(Color。white);f1。add(BorderLayout.CENTER, p4);scollWorsThread = new Thread(this);scollWorsThread。start();f1.setResizable(false);f1。setSize(470, 285);f1。setVisible(true);f1.setLocation(400, 180);f1。s

12、etDefaultCloseOperation(JFrame。EXIT_ON_CLOSE);public void run() while (true) int x = l21.getBounds()。x;int y = l21。getBounds()。y;x += 5;l21。setLocation(x, y);if (x 420) x = 0;l21。setLocation(x, y);try Thread。sleep(1000); catch (InterruptedException e) if (stopScorlling = true) return;public void act

13、ionPerformed(ActionEvent e)try if (e.getSource() = function1) new Admin(); else if (e.getSource() = function2) new User(); else if (e。getSource() = function3) new ZhuCe(); else if (e。getSource() = function4) JOptionPane.showMessageDialog(null, this, ”系統(tǒng)簡介 ”, 3); else if (e.getSource() = end) System。

14、exit(1); catch (Exception e1) e1。printStackTrace();public static void main(String args) throws Exceptionnew BuildingSystem();Adminpackage gaolei;public class BuildingSystem implements Runnable,ActionListener JFrame f1;JPanel p1, p2,p3,p4;JLabel l21;JButton function1, function2, function3, function4;

15、JButton end;Thread scollWorsThread;boolean stopScorlling; BuildingSystem() f1 = new JFrame(”-房屋中介管理系統(tǒng)-");p1 = new JPanel();p1.setBackground(Color。white);p1。setLayout(new GridLayout(5, 1, 5, 5);function1 = new JButton(” 【管理員登錄通道】 ”);p1.add(function1);function1.setBackground(Color。getHSBColor(100

16、, 152, 188);function1。addActionListener(this);function2 = new JButton("【普通用戶登陸通道】");function2.setBackground(Color。getHSBColor(100, 152, 188);p1。add(function2);function2.addActionListener(this);function3 = new JButton(” 【新用戶注冊】 ”);p1。add(function3);function3。setBackground(Color。getHSBColor(

17、100, 152, 188);function3。addActionListener(this);function4 = new JButton(" 【系統(tǒng)信息】 ”);p1.add(function4);function4.setBackground(Color.getHSBColor(100, 152, 188);function4。addActionListener(this);end = new JButton(” 【 退 出 程 序 】 ");p1。add(end);end.setBackground(Color。getHSBColor(100, 152, 188

18、));end。addActionListener(this);f1.add(BorderLayout。EAST, p1);p2 = new JPanel();p2。setBackground(Color。getHSBColor(100, 10,255));p2.setLayout(new GridLayout(3, 1));JLabel empty1 = new JLabel(” ");p2。add(empty1);l21 = new JLabel(” 高雷房地產(chǎn)公司歡迎您O(_)O ”);l21。setForeground(Color。DARK_GRAY);l21。setFont(

19、new Font(”華文行楷”,1,17));p2.add(l21);JLabel empty2 = new JLabel(” ");p2。add(empty2);f1。add(BorderLayout.NORTH, p2);p3 = new JPanel()private static final long serialVersionUID = 1L;public void paint(Graphics g) ImageIcon icon=new ImageIcon(”F:Java information12。png”); Image image=icon。getImage();

20、g.drawImage(image, 0,0, null); ;p3.setBackground(Color.white);JLabel nn = new JLabel(” ");p3。add(nn);f1。add(BorderLayout。SOUTH, p3);p4 = new JPanel()private static final long serialVersionUID = 1L;public void paint(Graphics g) ImageIcon icon=new ImageIcon("F:Java information12。png”); Image

21、 image=icon。getImage(); g。drawImage(image, 0,0, null); ;p4。setBackground(Color.white);f1.add(BorderLayout。CENTER, p4)scollWorsThread = new Thread(this);scollWorsThread.start();f1。setResizable(false);f1。setSize(470, 285);f1.setVisible(true);f1.setLocation(400, 180);f1。setDefaultCloseOperation(JFrame。

22、EXIT_ON_CLOSE);public void run() while (true) int x = l21。getBounds()。x;int y = l21。getBounds()。y;x += 5;l21。setLocation(x, y);if (x > 420) x = 0;l21。setLocation(x, y);try Thread.sleep(1000); catch (InterruptedException e) if (stopScorlling = true) return;public void actionPerformed(ActionEvent e

23、)try if (e.getSource() = function1) new Admin(); else if (e.getSource() = function2) new User(); else if (e.getSource() = function3) new ZhuCe(); else if (e。getSource() = function4) JOptionPane。showMessageDialog(null, this, "系統(tǒng)簡介 ", 3); else if (e。getSource() = end) System。exit(1); catch (

24、Exception e1) e1。printStackTrace();public static void main(String args) throws Exceptionnew BuildingSystem();Admin1package gaolei;public class Admin1 extends JFrame implements ActionListenerJFrame f;JLabel jl,j2,j3,j4,j5,j6,j7,j8;JTextField jf1,jf2,jf3,jf4,jf5,jf6,jf7,jf8;JButton jb1,jb2,jb3,jb4,jb5

25、,jb6,jb7,jb8;JPanel jp1;int id;int m=0;JTextArea result;String DBDriver=”sun。jdbc。odbc。JdbcOdbcDriver"String connectionStr=”jdbc:odbc:HouseInfo1"Statement stmt=null,s1=null;Connection con=null;ResultSet rs=null;PreparedStatement stmt1=null,stmt2=null,stmt3=null,stmt4=null;public Admin1() f

26、 = new JFrame(”房源基本信息”);jp1=new JPanel();jp1。setLayout(new GridLayout(5, 2));jl=new JLabel(”編號:”);j2=new JLabel(”房主姓名:”);j3=new JLabel("聯(lián)系方式:”);j4=new JLabel(”坐落位置:”);j5=new JLabel(”建造年月:”);j6=new JLabel(”價格:");j7=new JLabel("戶型");j8=new JLabel("房屋狀態(tài)");jf1=new JTextFiel

27、d(10);jf2=new JTextField(10);jf3=new JTextField(10);jf4=new JTextField(10);jf5=new JTextField(10);jf6=new JTextField(10);jf7=new JTextField(10);jf8=new JTextField(10);jb1=new JButton(”錄入”);jb2=new JButton("修改");jb3=new JButton(”刪除”);jb4=new JButton("查詢”);jp1.add(jl);jp1。add(jf1);jp1.a

28、dd(j2);jp1.add(jf2);jp1。add(j3);jp1。add(jf3);jp1。add(j4);jp1。add(jf4);jp1.add(j5);jp1。add(jf5);jp1。add(j6);jp1.add(jf6);jp1。add(j7);jp1。add(jf7);jp1。add(j8);jp1.add(jf8);jp1。add(jb1);jp1。add(jb2);jp1。add(jb3);jp1.add(jb4);jb1。addActionListener(this);jb2。addActionListener(this);jb3.addActionListener(

29、this);jb4。addActionListener(this);f。add(BorderLayout。NORTH, jp1);result = new JTextArea(60, 100);result.setEditable(false);JScrollPane jScrollPane=new JScrollPane(result);f。add(BorderLayout.CENTER, jScrollPane);f。setSize(500, 600);f.setLocation(600, 80);f.setVisible(true);f.validate();public void in

30、sert()int m=0;tryClass.forName(DBDriver);/加載驅(qū)動器表達(dá)式catch(ClassNotFoundException e1)e1。printStackTrace();String id=jf1。getText();String name=jf2。getText();String tel=jf3。getText();String loc=jf4.getText();String riqi=jf5.getText();String price=jf6。getText();String type=jf7.getText();String zt=jf8。getT

31、ext();if(!id.equals(”)!name。equals("”)&!tel.equals(”)&&!loc。equals("")!riqi.equals(”)!price。equals(”")!type。equals(”)!zt。equals("”))trycon=DriverManager.getConnection(connectionStr,”",”);/建立數(shù)據(jù)庫連接String sql1="INSERT INTO house(id,name,tel,loc,riqi,price,

32、type,zt) values (?,?,?,?,?,?,?,?)"PreparedStatement stmt1=con.prepareStatement(sql1);stmt1。setString(1,id);stmt1。setString(2,name);stmt1.setString(3,tel);stmt1。setString(4,loc);stmt1。setString(5,riqi);stmt1。setString(6,price);stmt1。setString(7,type);stmt1.setString(8,zt);stmt1。execute();stmt1。c

33、lose();con.close();m=1;catch (SQLException e1) e1。printStackTrace();if(m=1)JOptionPane.showMessageDialog(this, ”信息已經(jīng)成功錄入");if(m=0)JOptionPane。showMessageDialog(this, ”您輸入的不符合要求”);public void xiugai()tryClass。forName(DBDriver);/加載驅(qū)動器表達(dá)式catch(ClassNotFoundException e1)e1。printStackTrace();int n=0

34、;String id=jf1.getText();String name=jf2。getText();String tel=jf3.getText();String loc=jf4.getText();String riqi=jf5.getText();String price=jf6。getText();String type=jf7.getText();String zt=jf8.getText();if(!id.equals(”)trycon=DriverManager。getConnection(connectionStr,”,"”);/建立數(shù)據(jù)庫連接if(!name。equ

35、als(""))String sql2=”Update house set name=? where id=?";stmt1=con。prepareStatement(sql2);stmt1。setString(2,id);stmt1。setString(1,name);stmt1.execute();JOptionPane。showMessageDialog(this, ”房主姓名已經(jīng)成功修改”);if(!tel.equals(”))String sql3=”Update house set tel=? where id=?”;stmt1=con。prepare

36、Statement(sql3);stmt1.setString(2,id);stmt1.setString(1,tel);stmt1。execute();stmt1.close();JOptionPane.showMessageDialog(this, ”聯(lián)系方式已經(jīng)成功修改");if(!loc。equals(”)String sql3="Update house set loc=? where id=?”;stmt1=con。prepareStatement(sql3);stmt1.setString(2,id);stmt1。setString(1,loc);stmt1。

37、execute();stmt1。close();JOptionPane.showMessageDialog(this, ”坐落位置已經(jīng)成功修改”);if(!riqi。equals(”"))String sql3=”Update house set riqi=? where id=?";stmt1=con.prepareStatement(sql3);stmt1。setString(2,id);stmt1.setString(1,riqi);stmt1.execute();stmt1。close();JOptionPane.showMessageDialog(this, &q

38、uot;建造日期已經(jīng)成功修改”);if(!price。equals(”)String sql3=”Update house set price=? where id=?”;stmt1=con.prepareStatement(sql3);stmt1。setString(2,id);stmt1.setString(1,price);stmt1。execute();stmt1.close();JOptionPane。showMessageDialog(this, ”價格已經(jīng)成功修改”);if(!type.equals(”))String sql3=”Update house set type=?

39、where id=?"stmt1=con.prepareStatement(sql3);stmt1。setString(2,id);stmt1。setString(1,type);stmt1。execute();stmt1.close();JOptionPane.showMessageDialog(this, ”戶型已經(jīng)成功修改”);if(!zt。equals("”))String sql3=”Update house set zt=? where id=?";stmt1=con.prepareStatement(sql3);stmt1。setString(2,i

40、d);stmt1。setString(1,zt);stmt1。execute();stmt1。close();JOptionPane。showMessageDialog(this, "房屋狀態(tài)已經(jīng)成功修改”);con。close();n=1;catch (SQLException e1) / TODO Auto-generated catch blocke1.printStackTrace();if(n=0)JOptionPane。showMessageDialog(this, ”您輸入的不符合要求");public void delete()int n=0;tryClas

41、s。forName(DBDriver);/加載驅(qū)動器表達(dá)式catch(ClassNotFoundException e1)e1。printStackTrace();String id=jf1.getText();String name=jf2。getText();String tel=jf3。getText();String loc=jf4。getText();String riqi=jf5。getText();String price=jf6。getText();String type=jf7.getText();String zt=jf8。getText();if(!id。equals(”

42、)|!name。equals(”)!tel.equals("”)|!loc.equals("")|!riqi.equals("”)|!price。equals(”)!type。equals(”")!zt。equals(""))trycon=DriverManager。getConnection(connectionStr,”,”);/建立數(shù)據(jù)庫連接String sql2=”delete from house where id=?”;stmt1=con.prepareStatement(sql2);stmt1.setStrin

43、g(1,id);stmt1.execute();stmt1.close();con。close();n=1;catch (SQLException e1) / TODO Auto-generated catch blocke1.printStackTrace();if(n=1)JOptionPane。showMessageDialog(this, ”信息已經(jīng)成功刪除”);if(n=0)JOptionPane。showMessageDialog(this, ”對不起,您輸入的信息有誤,未成功刪除。");public void search()int n=0;tryClass.forNa

44、me(DBDriver);/加載驅(qū)動器表達(dá)式catch(ClassNotFoundException e1)e1。printStackTrace();String id=jf1.getText();String name=jf2。getText();String tel=jf3.getText();String loc=jf4.getText();String riqi=jf5.getText();String price=jf6。getText();String type=jf7.getText();String zt=jf8。getText();if(!id.equals(”)!name。

45、equals(”)|!tel。equals(”)!loc.equals(”)!riqi。equals(”)|!price。equals(”")|!type。equals("")|!zt.equals(”)trycon=DriverManager.getConnection(connectionStr,”,"”);/建立數(shù)據(jù)庫連接Statement stmt=con.createStatement();String sql="Selectfrom house where id=";sql=sql+”"+id+”;rs=stmt

46、.executeQuery(sql);while(rs.next()String id1=rs.getString("id”);String name1=rs.getString(”name");String tel1=rs。getString("tel");String loc1=rs.getString("loc");String riqi1=rs。getString(”riqi”);String price1=rs.getString("price”);String type1=rs。getString("t

47、ype”);String zt1=rs。getString(”zt");String str=”房屋編號-”+id1+”n客戶姓名-”+name1+”n聯(lián)系方式”+tel1+"n坐落位置-”+loc1+"n建造日期-”+riqi1+"n價格-”+price1+”n戶型-”+type1+”n房屋狀態(tài)-”+zt1;result。append(str);result。append("n");JOptionPane.showMessageDialog(this, ”成功查詢到所需信息");stmt。close();con。close

48、();n=1;catch (SQLException e1) / TODO Autogenerated catch blocke1。printStackTrace();if(n=0)JOptionPane。showMessageDialog(this, ”對不起,您所查詢的信息不存在”);public static void main(String args)new Admin1();public void actionPerformed(ActionEvent e) if(e。getSource()=jb1)insert();if(e。getSource()=jb2)xiugai(); if

49、(e。getSource()=jb3)delete(); if(e.getSource()=jb4)search(); RegisterExceptionpackage gaolei;public class RegisterException extends RuntimeExceptionpublic RegisterException() super(”用于登錄異常的情況,例如密碼兩次輸入不一致等情況”);Userpackage gaolei;public class User extends JFrame implements ActionListenerJLabel jl1,jl2;

50、JTextField jf1,jf2;JPanel jp1,jp2,jp3;JButton jb;String DBDriver="sun.jdbc。odbc.JdbcOdbcDriver”;String connectionStr=”jdbc:odbc:NewUser"Statement stmt=null,s1=null;Connection con=null;int number=0;User()number=0;setTitle("普通用戶登陸");setLayout(new FlowLayout());jp1=new JPanel();jp2=new JPanel();jp3=new JPanel();jl1=new JLabel(”請輸入賬戶ID:”);jp1.add(jl1);jf1=new JTextField(20);jp1.add(jf1);add(jp1);jl2=new JLabel(”請輸入密碼 : ”);jp2。add(jl2);jf2=new JTextField(20);jp2。add(

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論