From 8385480f0a345732f946fa5b577ed5b2209d889a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <9252971+qq783615077@user.noreply.gitee.com> Date: Thu, 26 Aug 2021 08:01:51 +0000 Subject: [PATCH 01/24] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20book?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/book/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/book/.keep diff --git a/src/book/.keep b/src/book/.keep new file mode 100644 index 0000000..e69de29 -- Gitee From 12034a0db54a3c2944ff1f8eb39dab828f6ad5a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <9252971+qq783615077@user.noreply.gitee.com> Date: Thu, 26 Aug 2021 08:02:07 +0000 Subject: [PATCH 02/24] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20sr?= =?UTF-8?q?c/book/.keep?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/book/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/book/.keep diff --git a/src/book/.keep b/src/book/.keep deleted file mode 100644 index e69de29..0000000 -- Gitee From f1889f464ef7085869b82e85ee0a5ddcd1c28ae7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <9252971+qq783615077@user.noreply.gitee.com> Date: Thu, 26 Aug 2021 08:02:28 +0000 Subject: [PATCH 03/24] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20book?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/book/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/book/.keep diff --git a/src/book/.keep b/src/book/.keep new file mode 100644 index 0000000..e69de29 -- Gitee From 14c27d302ad59cfac7ff036940362b0f8fb3d540 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <9252971+qq783615077@user.noreply.gitee.com> Date: Thu, 26 Aug 2021 08:05:21 +0000 Subject: [PATCH 04/24] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20dao?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/book/dao/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/book/dao/.keep diff --git a/src/book/dao/.keep b/src/book/dao/.keep new file mode 100644 index 0000000..e69de29 -- Gitee From 2c2bdc10d3075de0c4d2885107563902247504d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <9252971+qq783615077@user.noreply.gitee.com> Date: Thu, 26 Aug 2021 08:05:46 +0000 Subject: [PATCH 05/24] dao --- src/book/dao/dao/BookDao.java | 34 +++++++++++++++++++++++++ src/book/dao/dao/BookTypeDao.java | 41 +++++++++++++++++++++++++++++++ src/book/dao/dao/Userdao.java | 26 ++++++++++++++++++++ 3 files changed, 101 insertions(+) create mode 100644 src/book/dao/dao/BookDao.java create mode 100644 src/book/dao/dao/BookTypeDao.java create mode 100644 src/book/dao/dao/Userdao.java diff --git a/src/book/dao/dao/BookDao.java b/src/book/dao/dao/BookDao.java new file mode 100644 index 0000000..5903a88 --- /dev/null +++ b/src/book/dao/dao/BookDao.java @@ -0,0 +1,34 @@ +package book.dao; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; + +import book.model.Book; +import book.util.StringUtil; + +/** + * 图书Dao类 + * @author Administrator + * + */ +public class BookDao { + + + /** + * 图书信息删除 + * @param con + * @param id + * @return + * @throws Exception + */ + public int delete(Connection con,String id)throws Exception{ + String sql="delete from dbo.t_book where id=?"; + PreparedStatement pstmt=con.prepareStatement(sql); + pstmt.setString(1, id); + return pstmt.executeUpdate(); + } + + + +} diff --git a/src/book/dao/dao/BookTypeDao.java b/src/book/dao/dao/BookTypeDao.java new file mode 100644 index 0000000..b63bb0b --- /dev/null +++ b/src/book/dao/dao/BookTypeDao.java @@ -0,0 +1,41 @@ +package book.dao; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; + +import book.model.BookType; +import book.util.StringUtil; + +public class BookTypeDao { + + public int add(Connection con,BookType bookType)throws Exception{ + String sql="insert into dbo.booktype values(null,?,?)"; + PreparedStatement pstmt=con.prepareStatement(sql); + pstmt.setString(1, bookType.getBookTypeName()); + pstmt.setString(2, bookType.getBookTypeDesc()); + return pstmt.executeUpdate(); + } + public ResultSet list(Connection con,BookType bookType)throws Exception{ + StringBuffer sb=new StringBuffer("select * from dbo.booktype"); + if(StringUtil.isNotEmpty(bookType.getBookTypeName())){ + sb.append(" and bookTypeName like '%"+bookType.getBookTypeName()+"%'"); + } + PreparedStatement pstmt=con.prepareStatement(sb.toString().replaceFirst("and", "where")); + return pstmt.executeQuery(); + } + public int delete(Connection con,String id)throws Exception{ + String sql="delete from dbo.booktype where id=?"; + PreparedStatement pstmt=con.prepareStatement(sql); + pstmt.setString(1, id); + return pstmt.executeUpdate(); + } + public int update(Connection con,BookType bookType)throws Exception{ + String sql="update dbo.booktype set bookTypeName=?,bookTypeDesc=? where id=?"; + PreparedStatement pstmt=con.prepareStatement(sql); + pstmt.setString(1, bookType.getBookTypeName()); + pstmt.setString(2, bookType.getBookTypeDesc()); + pstmt.setInt(3, bookType.getId()); + return pstmt.executeUpdate(); + } +} diff --git a/src/book/dao/dao/Userdao.java b/src/book/dao/dao/Userdao.java new file mode 100644 index 0000000..a1374f5 --- /dev/null +++ b/src/book/dao/dao/Userdao.java @@ -0,0 +1,26 @@ +package book.dao; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; + +import book.model.User; +public class Userdao { + + public User login(Connection con,User user)throws Exception{ + User resultUser=null; + String sql="select * from dbo.book where userName=? and passWord=?"; + PreparedStatement pstmt=con.prepareStatement(sql); + pstmt.setString(1, user.getUserName()); + pstmt.setString(2, user.getPassWord()); + ResultSet rs=pstmt.executeQuery(); + if(rs.next()) { + resultUser=new User(); + resultUser.setId(rs.getInt("id")); + resultUser.setUserName(rs.getString("userName")); + resultUser.setPassWord(rs.getString("PassWord")); + } + return resultUser; + + } + } -- Gitee From 09225466396be7cb38e318f302c0010b6ea1f91f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <9252971+qq783615077@user.noreply.gitee.com> Date: Thu, 26 Aug 2021 08:06:05 +0000 Subject: [PATCH 06/24] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20sr?= =?UTF-8?q?c/book/dao/.keep?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/book/dao/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/book/dao/.keep diff --git a/src/book/dao/.keep b/src/book/dao/.keep deleted file mode 100644 index e69de29..0000000 -- Gitee From ddfb5cbb765bd6c78624af644d784b0c445dc556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <9252971+qq783615077@user.noreply.gitee.com> Date: Thu, 26 Aug 2021 08:06:14 +0000 Subject: [PATCH 07/24] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20sr?= =?UTF-8?q?c/book/.keep?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/book/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/book/.keep diff --git a/src/book/.keep b/src/book/.keep deleted file mode 100644 index e69de29..0000000 -- Gitee From f404e8d3ec8606f5f92ccdb5198cc513bca72087 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <9252971+qq783615077@user.noreply.gitee.com> Date: Thu, 26 Aug 2021 08:06:43 +0000 Subject: [PATCH 08/24] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20image?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/image/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/image/.keep diff --git a/src/image/.keep b/src/image/.keep new file mode 100644 index 0000000..e69de29 -- Gitee From 9801b9f530894603d717a819c98eff6778b2841d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <9252971+qq783615077@user.noreply.gitee.com> Date: Thu, 26 Aug 2021 08:07:13 +0000 Subject: [PATCH 09/24] =?UTF-8?q?=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/image/images/about.png | Bin 0 -> 664 bytes src/image/images/add.png | Bin 0 -> 805 bytes src/image/images/base.png | Bin 0 -> 852 bytes src/image/images/bookManager.png | Bin 0 -> 646 bytes src/image/images/bookTypeManager.png | Bin 0 -> 618 bytes src/image/images/delete.png | Bin 0 -> 666 bytes src/image/images/edit.png | Bin 0 -> 516 bytes src/image/images/exit.png | Bin 0 -> 755 bytes src/image/images/java1234.png | Bin 0 -> 12026 bytes src/image/images/login.png | Bin 0 -> 644 bytes src/image/images/logo.png | Bin 0 -> 5261 bytes src/image/images/me.png | Bin 0 -> 676 bytes src/image/images/modify.png | Bin 0 -> 611 bytes src/image/images/password.png | Bin 0 -> 481 bytes src/image/images/reset.png | Bin 0 -> 725 bytes src/image/images/search.png | Bin 0 -> 628 bytes src/image/images/userName.png | Bin 0 -> 575 bytes 17 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/image/images/about.png create mode 100644 src/image/images/add.png create mode 100644 src/image/images/base.png create mode 100644 src/image/images/bookManager.png create mode 100644 src/image/images/bookTypeManager.png create mode 100644 src/image/images/delete.png create mode 100644 src/image/images/edit.png create mode 100644 src/image/images/exit.png create mode 100644 src/image/images/java1234.png create mode 100644 src/image/images/login.png create mode 100644 src/image/images/logo.png create mode 100644 src/image/images/me.png create mode 100644 src/image/images/modify.png create mode 100644 src/image/images/password.png create mode 100644 src/image/images/reset.png create mode 100644 src/image/images/search.png create mode 100644 src/image/images/userName.png diff --git a/src/image/images/about.png b/src/image/images/about.png new file mode 100644 index 0000000000000000000000000000000000000000..11b183c6682cf5bf514a4692a7ad87cc8ba2bad0 GIT binary patch literal 664 zcmV;J0%!e+P)!MWIDYcBdIGtfg|Go89wp>*G+j)I~ht-$9uN&^?~{Fgzvn}EM6bU`{Xq!Yzg z6}lYmrg|f-vV3^g1wfI6U|Hk&yA_9yw<71W5~YCHhu3eWhM#vR@CEqY(w;LIeOP|l z7dUcD&)4epZJt7R;ZBTvH;4p^q5&YK4XPJwF++O(4`wozuompd?ALIomgn)e6qoy3 zRc!)1DbNyNc|b9cxN`X%aAwf8G`cqfc}{^StUR_5^M_p58scHcR2#RK?5$Nq5)=W7 z1=t`>kQtEaENv4q0$~*s8y@Zb`+ekw0x)(u2H8&z5!Iof2 zgzY2xe(c%o_{XbFotP^_9BfA`tq;8{J5Y84C7m@`u1dg>AUsS)Ci{PV8amT-4|~lT zo4T+Ur>6#3azV<51sfKe9CP<2m2`Z1Xt^0cTeVWdFuePjPlD=zYl8$biLQHt5HkRC zwSfv~Zq2A;F`aF6xv-pUK;0$4aX>n_HN7s^X9Hp-f!~ABRZ$HJRz@=QV{)Yb?Y9Sx zkoKvgHP_2)c7+T>MOVe1l6;7#);>W5eV9wLb2FJl>gVUN=>4-#%vZL^&PeSW?|X4& y;$+>y%A3-%b_aG~##4wjUwIYObp#OWxPpIrn)n+M)q2hV0000_uUJA0J9-^0d>LCa!f-L$Y zMNkmYi$sCaZGwWKhrm+F!cs@f#&Blz=AF6soOActd#@huIM~!;v0yDeKKRyJpRgic zY206qOuVOFTeov{b?pXKXmw`KwUW7SLhuJCb{)3Y;^o@r#V_xCXmtIScZb%Ft*aDk zIN!s@QIVv(!1=jf&Y!(_{Hd27oND}sVB+BB7j7GU;Pq;`ZoE1S21EcwRSD`TL?v3C zxo~WH@|o8jIr_me!E>K%y7%Uh9bebVb%O{-B8(VB1O-$BA$Wp11fi8&a=)INy6f%7 z&ioKR{o$}#Q@idhBgQOdmx(0Cn3$pZP3#!mhpO_~u?f0)2Ok_h>Rcl#nyR3I`DMk2a-+S4dPlC{Y4HeMaxJ6g#+{e6R5pL~C4Ja*P^_gK;_ zB{l`NjXX-JP-URHVR^aZ>+d7?mS$&$<9~jI^Okaf;(|j}@zxK--OReIn~=K<5#d7fB<12NDuo(rY8wIg>&owh z5SVRElXg3(f}w-6KEyW7Pp6#(L=h3*Z0rRQ#)o#Y@9qNt>~HKPwF{^!8hU3gc0u4jvzN`1w{)q42`)fEoYrLPvD(@cK0ncLlXr#k}> zUByfv@y(56;p4QG1@$_nK`R=R-~!G%vbLRDnD4ymtbbzifNlP-8?VMak4vn|W?*<} jbXG);e)mxbE3y9o#xa2up*(jW00000NkvXXu0mjf{V0uG literal 0 HcmV?d00001 diff --git a/src/image/images/base.png b/src/image/images/base.png new file mode 100644 index 0000000000000000000000000000000000000000..7965c690df19d50013f0dffd5f5d549ddd0691fd GIT binary patch literal 852 zcmV-a1FQUrP)}gTiV)gx3~BDz7_necH@AoJy z3^ji8bSWHOqDm>b{L8P0Iy<&^FGLi#g0~O9*K+2ov%ekv=;QAIJ#d$)rqUTypASXB zc;n4O>yCdJzuxoVCx_<`PylxC*&A(bZ5>@)Q==J%K{}J6y1JUl$v>&7xf>w_K2^o_ zJWSJ1fB*S+cXf5_2T%cYy=wE)a9I26?`b^G10a{nqbLfNmA#zbt{f4>5_^7Zbw zTGnr9-6W-GSlQ4}TPl@U5?ajI_*gQ2B7SOeaw55U^{NLd6&DYX0%2J5~Gf3`qkL-7^Pwn6ou)3rg?4K*7etu$s~}FKygRcu1Irp^E=BT5ySI9 zQ51v_ghC+^Fax-*i;xl_1XYHCwn%p`UA*u);Hm)mTyEXU`udRPfvzt?swz&|p;Ebd zr%&^tC<GstkYqiux6e0|NuuW5+%{eNS!es&F`rrfKx{ z_Ff(w9K0I4Hx?Tj8p@uG$G1+5j|~HN90r7+*!c8;hg&v01%$sie!}}>B;h5-#=Vzb zX+Hu)pJ{vk{l>-zTjsXk`GtAV02k2Oo_pa4ilUdxHg3iJ=G(JhpP8#WbDRYS%!e^A ew&xoEhyMTo8#0lR7YM}w0000&_CFolS7TN>^u@D6xLGcOHCL&r{*jNP8 zXf9$jA(QLOm`NscJ!fX`wfDA4V2HuO1q*&y{2%MWg8vNfu)n5!~`wOqD3kw^_9eKYsH3Wu~u>?MemT^WFj< zy8x==h+CF8G<3wUmCo|{>Uq9~ZK9U4Uw7geaAv+?(O-T9sSt zc}9zQesvmrH-a@5XAM?le+T}a5bdZGhoF3d%E}O`ZV1bDk`0AxIJWKM@Y5Z>$DAf?r_)ZYfn7{2H2t88i#C}TE(3~p~ z=Ub?FKdS5D-NXp68KH gr*X~^$ML@B4<95|3@6yi!~g&Q07*qoM6N<$f?_-=DgXcg literal 0 HcmV?d00001 diff --git a/src/image/images/bookTypeManager.png b/src/image/images/bookTypeManager.png new file mode 100644 index 0000000000000000000000000000000000000000..270b451172f50ceb62d749e6fa48d10794447220 GIT binary patch literal 618 zcmV-w0+s!VP)0w85Qd*~6KWEzy$Kg@Q9+c@CT$T~&_(RtkBzHJz^%Iq{sw=9#f2bo73fM(+`5u} zplA)YXhECS(CE!qlP0YpHGl;mrXFvOjZu9% zJ9RM!AcXkq;KmpLJkR6BPGo-V{^UYb_htU(?dhB`FdDNMjYrt+=|exzZa-u+X0h83 zIeFIRO04y04Hm3mug9lKkLB_{-)cVVKl(iX+@{%)y!+l`I5afclI8L~!=Zt`Vx_!K zz1{;L8Z^38Ykhj!uwx86K)o5TRg2Q?NM3!BaFE;dqI~@6Q|~Am1Ay+zV&(Ol>$B78 zT-eeGA(#+?tu+`L?86u)fUh46!^Yq?8mz9Hd4Nd!ZJ~DW*5&cLH)gJ#kGDA!sd4qv zDN?4&q$_ZvbtYUvZaj&tD$HDnbM8co=4#1{hdICUMmh~P84*}I`bp?0;B#r?H0S^d{Dm<2c0RVAEr4cgZiU0rr07*qoM6N<$ Eg0uw`wg3PC literal 0 HcmV?d00001 diff --git a/src/image/images/delete.png b/src/image/images/delete.png new file mode 100644 index 0000000000000000000000000000000000000000..0407734df7e58216eaa9371492c262857ccec0f8 GIT binary patch literal 666 zcmV;L0%iS)P)4+UW&vgo0d$cLiGJrx8!1VdZ&;Gdu#>aiz5 zVy?%SRQfD5d`PsZXfHjayKdq%w|TdF?zz2eGIi2RUpR2ikMsGS^ZT9y{4c!)>Z77~ z^iCU;*G#CbQhMx94oKSR_4@;V*i<1N}Uo zjHXiS)v%UKLZcMxtE(e}namUb7%C@(0j^&ZC*7j>5G)H;k_tc8*6wo#gQv^onyA1V zvOIEYcXzzP8LF@O6yR=);-s@|!bp;WQpreHR+w7wQ419%0NS3<$Lj&-IkQ>P(`k;T z(*~kx^k+K#{3Lu7VzpiZM77!0RF(x%RS-=BF`G(STU)Z$%bYU!;`fK$F4ve=EJ9IL zln4PmR7{;69n*22@6_uYYhlLc3%5HQ6NRNEsD$9x&Q2t+C|d%@NhMk4MXz@tXf!5c zvb=uEV5Yk}Y4&>>0ReG%m-sw>ORq zqAe|btuE)({`WB8wG%QfOZy(aY5IeJj+OjTU)%SvN{bs1!wti^L*| z6-hI#B}0Wt6Y}nL5oac5n&N@Wlj;=EY`)=6$>sR&E$%&d2xu7KC3_~3p#5Lpce$KB<>2QD z*NR0%WN`vSN`+rBD?gc(DJG`$dcQ zhk4f4u5fg8%y8(20iX;94rgaW->j;9+wZW%I@fR9q|@n;N~MU!V&{zzY~Pq*jP~AF z61jC&3k9;-4B2dkcsz0b2qMN$_FykIH`&-I5sfYZimDQc5C(u^S-}oO6jdRY%l&ho zo*D*hZ8cAOy~Ff01ui;wcHX)C{gE@xa0$rqe-fYvxPJgsq-mUR*XUCK0000A(ywvf?}5iuf!rt9)o45!o?;IrUE9G z63Yd$C0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EcE?i;h+)L6MPa zo3XKD;lc~mrjnLNor`?@@xVaw#EFPUAGH``+J$^I7SMLHGX7F7~c6 zNtK-CpRj-Tu3+~ufKHNfe+&`~NCNX^T2dk(e;j%L{Vwy#csyIS=$habgHf?Z#w#mT z+E9Bt^1JV>y%j`4LU66oHQDMDVuA|*%4{*P&SjQQh@f<#N6OO;yV}05L}4Km7po0S z3JVnrnV5)(i}P#aSltTIBTUT3e zyrG~!)^6!A!ziFz4zqyhFS)N+nGpAcJ)p&deU z;){?{TBHJHW$G;t6DLAinpyz&;DheF?3{fz;?qy{oqQsELbQe+=`jN`^br07BpiLY zz-ON!=gp%_Kken0tITh|w1pmLNKV=b(fZWftkPY&B14C&Wd~YXi%*Eq)Ebfykl3*U zR;@aEjj%AplTYdy&$|iC3J6I^PEH`ng$s|q#Z_O)*q7vtv1M}zGH>{L@+E87MT)9%Mf~~1hX+Kh`r4du7x@{4> z-q1!{Lyz%$m;@o#?mq@dyV3Xd?wZ`qkMxC4AqmO5W! Y0HLuN5+oF#_5c6?07*qoM6N<$g8LrE&;S4c literal 0 HcmV?d00001 diff --git a/src/image/images/login.png b/src/image/images/login.png new file mode 100644 index 0000000000000000000000000000000000000000..d1d3e217f71489ccc699f39c3a810b4f429ec00f GIT binary patch literal 644 zcmV-~0(u%tR1jR_6M>@4vP*^pp?QiO&IxtmQ{1(%wYFkbp_X}0{Umy zT3tSO#O+gBC?SyR02=`e4rnG|Sr)cZ>WY@px+i;r(SHDa?_w@lk(ZQx-ZqhPa7{~Z zs<}70eDS;D5)apVoMF-B5WqRs;~UG26*`}X0@+=F#7%E=!y`ecqegmjWizAoPWJ}B z?F3wyiJb%xD%sCY3C93@9q$TE0RRa{(u=asdx97`+emJ-zr7gvRIBTQ@8cr??sATy ziL=d9q;GaBCwbhmk=gn=+2d&}Pw1bH^J*Z@!N4&nm<%uqe@-UFNFW5g_IDrr1tG zXe`kNAY8I5#R33=mxN$=_KM#kr=KKzlGnLtN=mE6IILVYYUT5-xB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Geo|gv!-A#>x{N&+H|yVQ-v98; zOE>=@jF%UVb~g4Y;Y*UZO_p|hdwxozv_leiNTLp&-|GmoG$W295Sk!Ai0g%vD}5;C z(&=Vk>h!O75i-Ef4HM*tQMyRJIE*!dBo)j)y_^1jc#<}J<7UYx{xqZY^N@$1 zpK%%H{-|{B>A%x|$vMSf(bqY$uhL#;ROZKxI?o(k2NW|us|Bu zsVz+twRX{1S)^DV!B~ywm+}0NsN2Ey3v?sHkN@J@G`r@O&t3xGfI}aA_=O9wh8;eA zX#I!951;y}{!7js${)KGgag7sDGxs=Bb7^*8RDpekeaYKh{+O`7xs`QEu@U8RbQZ3 z?xWSHQz#9AkVKs(elA2HS-9pq2Ojy$YcKfiPPUV`h&;T72PAg*H^mIjHVE?Jh~`2nWgVg5f| z_ekxAJI>u6vHz{|cMWg(36a&xabfPnEti&m>x|GAOC(7`x7)>W1LF3}w3<~4#WEmh|L=#I z)vw+1@zblF@BE^Ddt1*5?(o^H$A&JgTy)mOeHWeWs<1$sCM--pNRaa(gXYyg+*AMC zd(Pb+@xrofbcfHl9v%F*l?y-gdzFhmTx=$Lh!^H*e*LZ=b?<%Vg6$FW?}T4( zJ9hY#@0}d{lLvqIwAp*Nj$XOL$9<=LdPlIs$KBz-(_S3LVI0O`9L8b%v%~)bsb}30 Ti8+4I00000NkvXXu0mjfE(J?O literal 0 HcmV?d00001 diff --git a/src/image/images/me.png b/src/image/images/me.png new file mode 100644 index 0000000000000000000000000000000000000000..a9888d56f23d340bdac5670ba3cb3fcd5fce4053 GIT binary patch literal 676 zcmV;V0$crwP)*?3>H;`mw=OyjhDCN@)lzhB@omR72`gj z8Ufac!>a+4gJwJ1JNnt&b&yKD4pn7t@go!826;7q4;wGx)q`;WHY?yAAtD)ogg437_TeCv7Qwhp}ac<^iA5=`L-f zCpNsB9%Fd&2`^{w(%vhC;0eKJN0v$O7^6f|;^@w^484BLgRyHY`WaNAt(>D&$r1Nh zdgI7~{^Tl}p0000< KMNUMnLSTZ8V>877 literal 0 HcmV?d00001 diff --git a/src/image/images/modify.png b/src/image/images/modify.png new file mode 100644 index 0000000000000000000000000000000000000000..e72e5e58824bb447277c4c72322fa2903caecf9d GIT binary patch literal 611 zcmV-p0-XJcP)K4MMzzEleYyGL{t=l5foho-3i?cp^LIF z7!gykNFp#+Rh@!C_MYn}lC*Aur$A|m^ZixdEeRG_7% zN-BwG`&)UUvlJ3Q4{T>hBBE!PF3=Z%R+>u$I8T~9+01#$Q903fknj*RJan1_BAOf= zqB#rZ%C^GOeR|&V^x$4OGXlvkK_LK&qz1XSPE5^*VdeyH`{+V@Q9Na>^Q003B$A3! zpFw#iC^DiY-<28)-&E7=QSj@#^38a1Uo~&G>5MAQ0WpvTlK^5~EutP7ST2jDAm{CP ziN^K)4QHG%Re7wB^~UNJKhpl?KX^fg3XO=!CpKt(9%=mB6kagas^&XJ4Zm?Y6J{i=Uh|mY6x6={*r@0XDqDRxKzdU#h(4ibxu^Q4K>dJwwln|IH3wDjii#8Vm z+|JclI++154eY1~XFLvtQi5wN?>q7;v1M~%h7IiXQviLve}Xb^`pA2(mh5e6M@hIg xvU@ER6#bErb~5?y?w(yt7C(b#o3OaufL~rX0N9^u$Rq#&002ovPDHLkV1i0_5*Yvh literal 0 HcmV?d00001 diff --git a/src/image/images/password.png b/src/image/images/password.png new file mode 100644 index 0000000000000000000000000000000000000000..7d0114675587d4a409c2a2f069d8af32aedbd5f6 GIT binary patch literal 481 zcmV<70UrK|P)e@@U;zCe2t`#Xr7ro$R6R-qy zAp`10P*A*f5)F_P@9Q%eeB(cYZuo2HO%|0z?JjN>sW0&kUa_% z6pCghWQ!1;^A|kNg0B-G)<`HE8c5v~GnG73dHB4o$-mE3nX&{-RS8Vkglhrk2Uk1e zNqy^C!Nj`mDmi7KaFO{*s0t$LIF{wj@4F|1Y7wUAa9+tRcMa#);#6H~D<#Gny8XB( z8$5QSC~5}EO76CATHW-;d<87$@(~`CzyRR>djmG&a)JxXM(Y0rOc;dYz!DPs)6`Sq zE1;!3D7By!>?8o&_m6J_(}bP71y?rugC6+`l)ckLNw?(eowJI74FWUSBMM}00000NkvXXu0mjf#-!Tf literal 0 HcmV?d00001 diff --git a/src/image/images/reset.png b/src/image/images/reset.png new file mode 100644 index 0000000000000000000000000000000000000000..f1239bb6e8722e09bf962ab4be1fea4b800ccd81 GIT binary patch literal 725 zcmV;`0xJE9P)%8t&bvUTKe9*@4h={&bY{nH6a5B=D_*=80MT~*yf!1`L8k> zcfvR~4X6gaL1h-dn3-OYhuU8N#fpjNm^KIVcmd;JP0Bme)YoCr`rnV zzQ36yW8)XIyfu@g8P++BF=!C577YPu8vL;S=IcXK^BbJqxcFjhLDFJonC1*zLf=^W z*73)epU@o+sa;Bw=J+%}eRBEl4>rBv*wV`0q$sc2q6KLRAy6-0Mpv#Ozx{|-J<3z> zkR3h-8qh&i`Fi-|rK3-;B>)4Hys6fqSY-JJWZ^7rqm-={WttLVpu4olYSyASco<_` zX{#x_1E5F&*k&nK6r$C`wwAa#D+jS8phP@14sbw zgjn<>f>oZ%3o@rHzwsV}@d@s|GDm;MF7Trcs`5Z0rN-jFPwWM~g$Oi4=lDFsrh)sb z;FbQwPVjLQ3SNm4=u5c$s0%(^q!IAK>d}+@x$k9mo&Ov{1kp#~6}*SWL(mJG2kF~e zS8(}$Tng6FTDm~fdq|j_2V)>chzh}juNOJ-%&S`jD+kc{6E-ce2^b5$0Y8MYy$-8@ zHXRHvGCSSbG)NrZbHiT$<#p=bU3|R`0;D-KLuhKKy4TFrUuT(}{%5;gDBA7zNN9yG7&)@qTxN4A2A~ z24g!hYG(vjfNm8qIXRh#NLKZ#@klHqF&h=uBd7wJ4H)2G8|6NuRJq%S00000NkvXX Hu0mjfC!Jp4 literal 0 HcmV?d00001 diff --git a/src/image/images/search.png b/src/image/images/search.png new file mode 100644 index 0000000000000000000000000000000000000000..0449b835fbc680e0afe485e43bf60fd58730306b GIT binary patch literal 628 zcmV-)0*n2LP)9U3`vzwpO^YXs$=lSxyycnF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9D=8E=E5=8D=9A?= <9252971+qq783615077@user.noreply.gitee.com> Date: Thu, 26 Aug 2021 08:08:05 +0000 Subject: [PATCH 10/24] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20model?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/book/model/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/book/model/.keep diff --git a/src/book/model/.keep b/src/book/model/.keep new file mode 100644 index 0000000..e69de29 -- Gitee From a1e2901be0c5a44adf22f684c57cfbb4c0260115 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <9252971+qq783615077@user.noreply.gitee.com> Date: Thu, 26 Aug 2021 11:21:13 +0000 Subject: [PATCH 11/24] model --- src/book/model/model/Book.java | 108 +++++++++++++++++++++++++++++ src/book/model/model/BookType.java | 65 +++++++++++++++++ src/book/model/model/User.java | 38 ++++++++++ 3 files changed, 211 insertions(+) create mode 100644 src/book/model/model/Book.java create mode 100644 src/book/model/model/BookType.java create mode 100644 src/book/model/model/User.java diff --git a/src/book/model/model/Book.java b/src/book/model/model/Book.java new file mode 100644 index 0000000..f2a7956 --- /dev/null +++ b/src/book/model/model/Book.java @@ -0,0 +1,108 @@ +package book.model; + +public class Book { + + private int id; // 编号 + private String bookName; // 图书名称 + private String author; // 作者 + private String sex; // 性别 + private Float price; // 图书价格 + private Integer bookTypeId; // 图书类别Id + private String bookTypeName; // 图书类名名称 + private String bookDesc; // 备注 + + + + public Book() { + super(); + // TODO Auto-generated constructor stub + } + + + + public Book(String bookName, String author, String sex, Float price, Integer bookTypeId, String bookDesc) { + super(); + this.bookName = bookName; + this.author = author; + this.sex = sex; + this.price = price; + this.bookTypeId = bookTypeId; + this.bookDesc = bookDesc; + } + + + + + public Book(int id, String bookName, String author, String sex, Float price, Integer bookTypeId, String bookDesc) { + super(); + this.id = id; + this.bookName = bookName; + this.author = author; + this.sex = sex; + this.price = price; + this.bookTypeId = bookTypeId; + this.bookDesc = bookDesc; + } + + + + public Book(String bookName, String author, Integer bookTypeId) { + super(); + this.bookName = bookName; + this.author = author; + this.bookTypeId = bookTypeId; + } + + + + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + public String getBookName() { + return bookName; + } + public void setBookName(String bookName) { + this.bookName = bookName; + } + public String getAuthor() { + return author; + } + public void setAuthor(String author) { + this.author = author; + } + public String getSex() { + return sex; + } + public void setSex(String sex) { + this.sex = sex; + } + public Float getPrice() { + return price; + } + public void setPrice(Float price) { + this.price = price; + } + public Integer getBookTypeId() { + return bookTypeId; + } + public void setBookTypeId(Integer bookTypeId) { + this.bookTypeId = bookTypeId; + } + public String getBookTypeName() { + return bookTypeName; + } + public void setBookTypeName(String bookTypeName) { + this.bookTypeName = bookTypeName; + } + public String getBookDesc() { + return bookDesc; + } + public void setBookDesc(String bookDesc) { + this.bookDesc = bookDesc; + } + + +} diff --git a/src/book/model/model/BookType.java b/src/book/model/model/BookType.java new file mode 100644 index 0000000..ac35315 --- /dev/null +++ b/src/book/model/model/BookType.java @@ -0,0 +1,65 @@ +package book.model; + +/** + * 图书类别实体 + * @author Administrator + * + */ +public class BookType { + + private int id; // 编号 + private String bookTypeName; // 图书类别名称 + private String bookTypeDesc; // 备注 + + + + public BookType() { + super(); + // TODO Auto-generated constructor stub + } + + + public BookType(String bookTypeName, String bookTypeDesc) { + super(); + this.bookTypeName = bookTypeName; + this.bookTypeDesc = bookTypeDesc; + } + + + + + public BookType(int id, String bookTypeName, String bookTypeDesc) { + super(); + this.id = id; + this.bookTypeName = bookTypeName; + this.bookTypeDesc = bookTypeDesc; + } + + + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + public String getBookTypeName() { + return bookTypeName; + } + public void setBookTypeName(String bookTypeName) { + this.bookTypeName = bookTypeName; + } + public String getBookTypeDesc() { + return bookTypeDesc; + } + public void setBookTypeDesc(String bookTypeDesc) { + this.bookTypeDesc = bookTypeDesc; + } + + + @Override + public String toString() { + return bookTypeName; + } + + +} diff --git a/src/book/model/model/User.java b/src/book/model/model/User.java new file mode 100644 index 0000000..2b63cb1 --- /dev/null +++ b/src/book/model/model/User.java @@ -0,0 +1,38 @@ +package book.model; + +public class User { + + private int id; + private String userName; + private String passWord; + + public User() { + super(); + } + + public User(String userName,String passWord) { + super(); + this.userName=userName; + this.passWord=passWord; + } + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + public String getUserName() { + return userName; + } + public void setUserName(String userName) { + this.userName = userName; + } + public String getPassWord() { + return passWord; + } + public void setPassWord(String passWord) { + this.passWord = passWord; + } + + + } \ No newline at end of file -- Gitee From 0f786b3f7fe699933e743ee1ca959e19450a853f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <9252971+qq783615077@user.noreply.gitee.com> Date: Thu, 26 Aug 2021 11:21:44 +0000 Subject: [PATCH 12/24] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20util?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/book/util/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/book/util/.keep diff --git a/src/book/util/.keep b/src/book/util/.keep new file mode 100644 index 0000000..e69de29 -- Gitee From fd02d2912538b66b4c682728a587c0569bb68460 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <9252971+qq783615077@user.noreply.gitee.com> Date: Thu, 26 Aug 2021 11:23:30 +0000 Subject: [PATCH 13/24] util --- src/book/util/util/BookUtil.java | 36 ++++++++++++++++++++++++++++++ src/book/util/util/StringUtil.java | 22 ++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 src/book/util/util/BookUtil.java create mode 100644 src/book/util/util/StringUtil.java diff --git a/src/book/util/util/BookUtil.java b/src/book/util/util/BookUtil.java new file mode 100644 index 0000000..5c494b7 --- /dev/null +++ b/src/book/util/util/BookUtil.java @@ -0,0 +1,36 @@ +package book.util; + + +import java.sql.Connection; +import java.sql.DriverManager; +public class BookUtil { + + private String JdbcName="com.microsoft.sqlserver.jdbc.SQLServerDriver"; + private String libUrl="jdbc:sqlserver://localhost:1433;DatabaseName=Book"; + private String UserName="sa"; + private String PassWord="123456"; + + public Connection getCon()throws Exception{ + Class.forName(JdbcName); + Connection con=DriverManager.getConnection(libUrl,UserName,PassWord); + return con; + } + public void closeCon(Connection con)throws Exception{ + if(con!=null) { + con.close(); + } + } + public static void main(String[] args) { + BookUtil bookUtil=new BookUtil(); + try { + bookUtil.getCon(); + System.out.println("数据库连接成功"); + + }catch(Exception e) { + e.printStackTrace(); + System.out.println("数据库连接失败"); + } + + } + +} \ No newline at end of file diff --git a/src/book/util/util/StringUtil.java b/src/book/util/util/StringUtil.java new file mode 100644 index 0000000..c7f4c8e --- /dev/null +++ b/src/book/util/util/StringUtil.java @@ -0,0 +1,22 @@ +package book.util; + +public class StringUtil { + + public static boolean isEmpty(String str) { + if(str==null||"".equals(str.trim())) { + return true; + } + else { + return false; + } + } + + public static boolean isNotEmpty(String str) { + if(str!=null&&!"".equals(str.trim())) { + return true; + } + else { + return false; + } + } + } \ No newline at end of file -- Gitee From 02c06d6e51f91fda13afd3dbd94da93570e17653 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <9252971+qq783615077@user.noreply.gitee.com> Date: Thu, 26 Aug 2021 11:24:48 +0000 Subject: [PATCH 14/24] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20sr?= =?UTF-8?q?c/book/util/.keep?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/book/util/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/book/util/.keep diff --git a/src/book/util/.keep b/src/book/util/.keep deleted file mode 100644 index e69de29..0000000 -- Gitee From 865f9f48c92a76fc2a2bb94d42152746a452415e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <9252971+qq783615077@user.noreply.gitee.com> Date: Thu, 26 Aug 2021 11:25:08 +0000 Subject: [PATCH 15/24] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20view?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/book/view/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/book/view/.keep diff --git a/src/book/view/.keep b/src/book/view/.keep new file mode 100644 index 0000000..e69de29 -- Gitee From 7d7788d288258580df31788a9c2e75a52c27191c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <9252971+qq783615077@user.noreply.gitee.com> Date: Thu, 26 Aug 2021 11:25:40 +0000 Subject: [PATCH 16/24] view --- src/book/view/view/BookAddInterFrame.java | 210 +++++++++++ src/book/view/view/BookManageInterFrame.java | 0 src/book/view/view/BookTypeAddInterFrame.java | 168 +++++++++ .../view/view/BookTypeManageInterFrame.java | 352 ++++++++++++++++++ src/book/view/view/Gy0409InterFrame.java | 63 ++++ src/book/view/view/LogFrame.java | 160 ++++++++ src/book/view/view/MainFrame.java | 145 ++++++++ 7 files changed, 1098 insertions(+) create mode 100644 src/book/view/view/BookAddInterFrame.java create mode 100644 src/book/view/view/BookManageInterFrame.java create mode 100644 src/book/view/view/BookTypeAddInterFrame.java create mode 100644 src/book/view/view/BookTypeManageInterFrame.java create mode 100644 src/book/view/view/Gy0409InterFrame.java create mode 100644 src/book/view/view/LogFrame.java create mode 100644 src/book/view/view/MainFrame.java diff --git a/src/book/view/view/BookAddInterFrame.java b/src/book/view/view/BookAddInterFrame.java new file mode 100644 index 0000000..d8a29cf --- /dev/null +++ b/src/book/view/view/BookAddInterFrame.java @@ -0,0 +1,210 @@ +package book.view; + +import java.awt.EventQueue; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.sql.Connection; +import java.sql.ResultSet; + +import javax.swing.ButtonGroup; +import javax.swing.GroupLayout; +import javax.swing.GroupLayout.Alignment; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JInternalFrame; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JRadioButton; +import javax.swing.JTextArea; +import javax.swing.JTextField; +import javax.swing.LayoutStyle.ComponentPlacement; +import javax.swing.border.LineBorder; + +import book.dao.BookDao; +import book.dao.BookTypeDao; +import book.model.Book; +import book.model.BookType; +import book.util.BookUtil; +import book.util.StringUtil; + +public class BookAddInterFrame extends JInternalFrame { + private JTextField bookNameTxt; + private JTextField authorTxt; + private final ButtonGroup buttonGroup = new ButtonGroup(); + private JTextField priceTxt; + private JComboBox bookTypeJcb; + private JTextArea bookDescTxt; + private JRadioButton manJrb; + private JRadioButton femaleJrb; + + private BookUtil bookUtil=new BookUtil(); + private BookTypeDao bookTypeDao=new BookTypeDao(); + private BookDao bookDao=new BookDao(); + + /** + * Launch the application. + */ + public static void main(String[] args) { + EventQueue.invokeLater(new Runnable() { + public void run() { + try { + BookAddInterFrame frame = new BookAddInterFrame(); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + } + + /** + * Create the frame. + */ + public BookAddInterFrame() { + setClosable(true); + setIconifiable(true); + setTitle("\u56FE\u4E66\u6DFB\u52A0"); + setBounds(100, 100, 445, 467); + + JLabel label = new JLabel("\u56FE\u4E66\u540D\u79F0\uFF1A"); + + bookNameTxt = new JTextField(); + bookNameTxt.setColumns(10); + + JLabel label_1 = new JLabel("\u56FE\u4E66\u4F5C\u8005\uFF1A"); + + authorTxt = new JTextField(); + authorTxt.setColumns(10); + + JLabel label_2 = new JLabel("\u4F5C\u8005\u6027\u522B\uFF1A"); + + manJrb = new JRadioButton("\u7537"); + buttonGroup.add(manJrb); + manJrb.setSelected(true); + + femaleJrb = new JRadioButton("\u5973"); + buttonGroup.add(femaleJrb); + + JLabel label_3 = new JLabel("\u56FE\u4E66\u4EF7\u683C\uFF1A"); + + priceTxt = new JTextField(); + priceTxt.setColumns(10); + + JLabel label_4 = new JLabel("\u56FE\u4E66\u63CF\u8FF0\uFF1A"); + + bookDescTxt = new JTextArea(); + + JLabel label_5 = new JLabel("\u56FE\u4E66\u7C7B\u522B\uFF1A"); + + bookTypeJcb = new JComboBox(); + + JButton button = new JButton("\u6DFB\u52A0"); + + button.setIcon(new ImageIcon(BookAddInterFrame.class.getResource("/images/add.png"))); + + JButton button_1 = new JButton("\u91CD\u7F6E"); + + button_1.setIcon(new ImageIcon(BookAddInterFrame.class.getResource("/images/reset.png"))); + GroupLayout groupLayout = new GroupLayout(getContentPane()); + groupLayout.setHorizontalGroup( + groupLayout.createParallelGroup(Alignment.LEADING) + .addGroup(groupLayout.createSequentialGroup() + .addGap(33) + .addGroup(groupLayout.createParallelGroup(Alignment.LEADING) + .addComponent(label) + .addComponent(label_2) + .addComponent(label_5) + .addComponent(label_4)) + .addPreferredGap(ComponentPlacement.RELATED) + .addGroup(groupLayout.createParallelGroup(Alignment.LEADING) + .addGroup(groupLayout.createSequentialGroup() + .addGroup(groupLayout.createParallelGroup(Alignment.LEADING) + .addComponent(manJrb) + .addComponent(bookNameTxt, GroupLayout.DEFAULT_SIZE, 77, Short.MAX_VALUE) + .addComponent(button, Alignment.TRAILING)) + .addPreferredGap(ComponentPlacement.RELATED) + .addGroup(groupLayout.createParallelGroup(Alignment.LEADING) + .addGroup(groupLayout.createSequentialGroup() + .addComponent(femaleJrb) + .addGap(27) + .addGroup(groupLayout.createParallelGroup(Alignment.LEADING) + .addGroup(groupLayout.createSequentialGroup() + .addComponent(label_1) + .addGap(18) + .addComponent(authorTxt, GroupLayout.DEFAULT_SIZE, 66, Short.MAX_VALUE)) + .addGroup(groupLayout.createSequentialGroup() + .addPreferredGap(ComponentPlacement.RELATED) + .addComponent(label_3) + .addGap(18) + .addComponent(priceTxt))) + .addGap(49)) + .addGroup(Alignment.TRAILING, groupLayout.createSequentialGroup() + .addComponent(button_1) + .addGap(56)))) + .addGroup(groupLayout.createSequentialGroup() + .addComponent(bookDescTxt, GroupLayout.PREFERRED_SIZE, 294, GroupLayout.PREFERRED_SIZE) + .addContainerGap()) + .addGroup(groupLayout.createSequentialGroup() + .addComponent(bookTypeJcb, GroupLayout.PREFERRED_SIZE, 173, GroupLayout.PREFERRED_SIZE) + .addContainerGap()))) + ); + groupLayout.setVerticalGroup( + groupLayout.createParallelGroup(Alignment.LEADING) + .addGroup(groupLayout.createSequentialGroup() + .addGap(42) + .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE) + .addComponent(authorTxt, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) + .addComponent(label_1) + .addComponent(label) + .addComponent(bookNameTxt, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) + .addGap(29) + .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE) + .addComponent(priceTxt, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) + .addComponent(label_3) + .addComponent(label_2) + .addComponent(manJrb) + .addComponent(femaleJrb)) + .addGap(33) + .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE) + .addComponent(label_5) + .addComponent(bookTypeJcb, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) + .addGap(30) + .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE) + .addComponent(label_4) + .addComponent(bookDescTxt, GroupLayout.PREFERRED_SIZE, 137, GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(ComponentPlacement.RELATED, 33, Short.MAX_VALUE) + .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE) + .addComponent(button_1) + .addComponent(button)) + .addGap(42)) + ); + getContentPane().setLayout(groupLayout); + + // 设置文本域边框 + bookDescTxt.setBorder(new LineBorder(new java.awt.Color(127,157,185), 1, false)); + + + + } + + + + + + /** + * 重置表单 + */ + private void resetValue(){ + this.bookNameTxt.setText(""); + this.authorTxt.setText(""); + this.priceTxt.setText(""); + this.manJrb.setSelected(true); + this.bookDescTxt.setText(""); + if(this.bookTypeJcb.getItemCount()>0){ + this.bookTypeJcb.setSelectedIndex(0); + } + } + + +} diff --git a/src/book/view/view/BookManageInterFrame.java b/src/book/view/view/BookManageInterFrame.java new file mode 100644 index 0000000..e69de29 diff --git a/src/book/view/view/BookTypeAddInterFrame.java b/src/book/view/view/BookTypeAddInterFrame.java new file mode 100644 index 0000000..1d0f936 --- /dev/null +++ b/src/book/view/view/BookTypeAddInterFrame.java @@ -0,0 +1,168 @@ +package book.view; + +import java.awt.EventQueue; +import java.awt.Font; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.sql.Connection; + +import javax.swing.GroupLayout; +import javax.swing.GroupLayout.Alignment; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JInternalFrame; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JTextArea; +import javax.swing.JTextField; +import javax.swing.LayoutStyle.ComponentPlacement; +import javax.swing.border.LineBorder; +import book.dao.BookTypeDao; +import book.model.BookType; +import book.util.StringUtil; +import book.util.BookUtil; + +public class BookTypeAddInterFrame extends JInternalFrame { + private JTextField bookTypeNameTxt; + private JTextArea bookTypeDescTxt; + + private BookUtil bookUtil=new BookUtil(); + private BookTypeDao bookTypeDao=new BookTypeDao(); + /** + * Launch the application. + */ + public static void main(String[] args) { + EventQueue.invokeLater(new Runnable() { + public void run() { + try { + BookTypeAddInterFrame frame = new BookTypeAddInterFrame(); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + } + + /** + * Create the frame. + */ + public BookTypeAddInterFrame() { + setClosable(true); + setIconifiable(true); + setTitle("\u56FE\u4E66\u7C7B\u522B\u6DFB\u52A0"); + setBounds(100, 100, 450, 300); + + JLabel lblNewLabel = new JLabel("\u56FE\u4E66\u7C7B\u522B\u540D\u79F0\uFF1A"); + lblNewLabel.setFont(new Font("宋体", Font.PLAIN, 15)); + + JLabel lblNewLabel_1 = new JLabel("\u56FE\u4E66\u7C7B\u522B\u63CF\u8FF0\uFF1A"); + lblNewLabel_1.setFont(new Font("宋体", Font.PLAIN, 15)); + + bookTypeNameTxt = new JTextField(); + bookTypeNameTxt.setColumns(10); + + bookTypeDescTxt = new JTextArea(); + + JButton btnNewButton = new JButton("\u6DFB\u52A0"); + btnNewButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + bookTypeAddActionPerformed(e); + } + }); + btnNewButton.setFont(new Font("宋体", Font.BOLD, 15)); + btnNewButton.setIcon(new ImageIcon(BookTypeAddInterFrame.class.getResource("/images/add.png"))); + + JButton btnNewButton_1 = new JButton("\u91CD\u7F6E"); + btnNewButton_1.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + resetValueActionPerformed(e); + } + }); + btnNewButton_1.setFont(new Font("宋体", Font.BOLD, 15)); + btnNewButton_1.setIcon(new ImageIcon(BookTypeAddInterFrame.class.getResource("/images/reset.png"))); + GroupLayout groupLayout = new GroupLayout(getContentPane()); + groupLayout.setHorizontalGroup( + groupLayout.createParallelGroup(Alignment.LEADING) + .addGroup(groupLayout.createSequentialGroup() + .addGap(38) + .addGroup(groupLayout.createParallelGroup(Alignment.LEADING) + .addComponent(btnNewButton) + .addGroup(groupLayout.createParallelGroup(Alignment.TRAILING) + .addComponent(lblNewLabel_1) + .addComponent(lblNewLabel))) + .addGroup(groupLayout.createParallelGroup(Alignment.LEADING) + .addGroup(groupLayout.createSequentialGroup() + .addPreferredGap(ComponentPlacement.UNRELATED) + .addGroup(groupLayout.createParallelGroup(Alignment.LEADING) + .addComponent(bookTypeDescTxt, GroupLayout.DEFAULT_SIZE, 222, Short.MAX_VALUE) + .addComponent(bookTypeNameTxt, GroupLayout.PREFERRED_SIZE, 222, GroupLayout.PREFERRED_SIZE)) + .addContainerGap(56, Short.MAX_VALUE)) + .addGroup(groupLayout.createSequentialGroup() + .addGap(25) + .addComponent(btnNewButton_1) + .addContainerGap()))) + ); + groupLayout.setVerticalGroup( + groupLayout.createParallelGroup(Alignment.LEADING) + .addGroup(groupLayout.createSequentialGroup() + .addGap(37) + .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE) + .addComponent(bookTypeNameTxt, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) + .addComponent(lblNewLabel, GroupLayout.PREFERRED_SIZE, 24, GroupLayout.PREFERRED_SIZE)) + .addGap(18) + .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE) + .addComponent(lblNewLabel_1) + .addComponent(bookTypeDescTxt, GroupLayout.PREFERRED_SIZE, 75, GroupLayout.PREFERRED_SIZE)) + .addGap(31) + .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE) + .addComponent(btnNewButton, GroupLayout.PREFERRED_SIZE, 32, GroupLayout.PREFERRED_SIZE) + .addComponent(btnNewButton_1, GroupLayout.PREFERRED_SIZE, 32, GroupLayout.PREFERRED_SIZE)) + .addContainerGap()) + ); + getContentPane().setLayout(groupLayout); + bookTypeDescTxt.setBorder(new LineBorder(new java.awt.Color(127,157,185),1,false)); + } + private void bookTypeAddActionPerformed(ActionEvent evt) { + String bookTypeName=this.bookTypeNameTxt.getText(); + String bookTypeDesc=this.bookTypeDescTxt.getText(); + if(StringUtil.isEmpty(bookTypeName)) { + JOptionPane.showMessageDialog(null, "图书类别名称不能为空!"); + return; + } + BookType bookType=new BookType(bookTypeName,bookTypeDesc); + Connection con=null; + try { + con=bookUtil.getCon(); + int n=bookTypeDao.add(con, bookType); + if(n==1){ + JOptionPane.showMessageDialog(null, "图书类别添加成功!"); + resetValue(); + }else{ + JOptionPane.showMessageDialog(null, "图书类别添加失败!"); + } + }catch(Exception e){ + e.printStackTrace(); + JOptionPane.showMessageDialog(null, "图书类别添加失败!"); + }finally + {try { + bookUtil.closeCon(con); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + } + + private void resetValueActionPerformed(ActionEvent evt) { + this.resetValue(); + + } + + private void resetValue() { + this.bookTypeNameTxt.setText(""); + this.bookTypeDescTxt.setText(""); + } + +} diff --git a/src/book/view/view/BookTypeManageInterFrame.java b/src/book/view/view/BookTypeManageInterFrame.java new file mode 100644 index 0000000..3131a13 --- /dev/null +++ b/src/book/view/view/BookTypeManageInterFrame.java @@ -0,0 +1,352 @@ +package book.view; + +import java.awt.EventQueue; +import java.sql.Connection; +import java.sql.ResultSet; +import java.util.Vector; + +import javax.swing.GroupLayout; +import javax.swing.GroupLayout.Alignment; +import javax.swing.JInternalFrame; +import javax.swing.JScrollPane; +import javax.swing.JTable; +import javax.swing.table.DefaultTableModel; + +import book.dao.BookTypeDao; +import book.model.BookType; +import book.util.BookUtil; +import book.util.StringUtil; + +import javax.swing.JLabel; +import javax.swing.JOptionPane; + +import java.awt.Font; +import javax.swing.JTextField; +import javax.swing.LayoutStyle.ComponentPlacement; +import javax.swing.JButton; +import javax.swing.ImageIcon; +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; +import javax.swing.JPanel; +import javax.swing.border.LineBorder; +import javax.swing.border.TitledBorder; +import javax.swing.JTextArea; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +public class BookTypeManageInterFrame extends JInternalFrame { + private JTable bookTypeTable; + private BookUtil bookUtil=new BookUtil(); + private BookTypeDao bookTypeDao=new BookTypeDao(); + private JTextField s_bookTypeNameTxt; + private JTextField idTxt; + private JTextField bookTypeNameTxt; + private JTextArea bookTypeDescTxt; + + /** + * Launch the application. + */ + public static void main(String[] args) { + EventQueue.invokeLater(new Runnable() { + public void run() { + try { + BookTypeManageInterFrame frame = new BookTypeManageInterFrame(); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + } + + /** + * Create the frame. + */ + public BookTypeManageInterFrame() { + setIconifiable(true); + setClosable(true); + setTitle("\u56FE\u4E66\u7C7B\u522B\u7BA1\u7406 "); + setBounds(100, 100, 525, 570); + + JScrollPane scrollPane = new JScrollPane(); + + JLabel lblNewLabel = new JLabel("\u56FE\u4E66\u7C7B\u522B\u540D\u79F0\uFF1A"); + lblNewLabel.setFont(new Font("宋体", Font.PLAIN, 14)); + + s_bookTypeNameTxt = new JTextField(); + s_bookTypeNameTxt.setColumns(10); + + JButton btnNewButton = new JButton("\u67E5\u8BE2"); + btnNewButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + bookTypeSearchActionPerformed(e); + } + }); + btnNewButton.setIcon(new ImageIcon(BookTypeManageInterFrame.class.getResource("/images/search.png"))); + btnNewButton.setFont(new Font("宋体", Font.PLAIN, 14)); + + JPanel panel = new JPanel(); + panel.setBorder(new TitledBorder(null, "\u8868\u5355\u64CD\u4F5C", TitledBorder.LEADING, TitledBorder.TOP, null, null)); + GroupLayout groupLayout = new GroupLayout(getContentPane()); + groupLayout.setHorizontalGroup( + groupLayout.createParallelGroup(Alignment.TRAILING) + .addGroup(groupLayout.createSequentialGroup() + .addGap(52) + .addGroup(groupLayout.createParallelGroup(Alignment.LEADING) + .addGroup(groupLayout.createSequentialGroup() + .addComponent(lblNewLabel) + .addPreferredGap(ComponentPlacement.UNRELATED) + .addComponent(s_bookTypeNameTxt, GroupLayout.PREFERRED_SIZE, 184, GroupLayout.PREFERRED_SIZE) + .addPreferredGap(ComponentPlacement.RELATED, 13, Short.MAX_VALUE) + .addComponent(btnNewButton, GroupLayout.PREFERRED_SIZE, 85, GroupLayout.PREFERRED_SIZE)) + .addComponent(scrollPane, GroupLayout.DEFAULT_SIZE, 393, Short.MAX_VALUE) + .addComponent(panel, GroupLayout.PREFERRED_SIZE, 427, GroupLayout.PREFERRED_SIZE)) + .addGap(34)) + ); + groupLayout.setVerticalGroup( + groupLayout.createParallelGroup(Alignment.LEADING) + .addGroup(groupLayout.createSequentialGroup() + .addGap(34) + .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE) + .addComponent(lblNewLabel) + .addComponent(s_bookTypeNameTxt, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) + .addComponent(btnNewButton)) + .addGap(46) + .addComponent(scrollPane, GroupLayout.PREFERRED_SIZE, 150, GroupLayout.PREFERRED_SIZE) + .addGap(38) + .addComponent(panel, GroupLayout.PREFERRED_SIZE, 209, GroupLayout.PREFERRED_SIZE) + .addContainerGap(36, Short.MAX_VALUE)) + ); + + JLabel lblNewLabel_1 = new JLabel("\u7F16\u53F7\uFF1A"); + lblNewLabel_1.setFont(new Font("宋体", Font.PLAIN, 14)); + + idTxt = new JTextField(); + idTxt.setColumns(10); + + JLabel lblNewLabel_2 = new JLabel("\u56FE\u4E66\u7C7B\u522B\u540D\u79F0\uFF1A"); + lblNewLabel_2.setFont(new Font("宋体", Font.PLAIN, 14)); + + bookTypeNameTxt = new JTextField(); + bookTypeNameTxt.setColumns(10); + + JLabel lblNewLabel_3 = new JLabel("\u63CF\u8FF0\uFF1A"); + lblNewLabel_3.setFont(new Font("宋体", Font.PLAIN, 14)); + + JButton btnNewButton_1 = new JButton("\u4FEE\u6539"); + btnNewButton_1.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + bookTypeUpdateActionEvent(e); + } + }); + btnNewButton_1.setIcon(new ImageIcon(BookTypeManageInterFrame.class.getResource("/images/modify.png"))); + btnNewButton_1.setFont(new Font("宋体", Font.BOLD, 15)); + + JButton btnNewButton_2 = new JButton("\u5220\u9664"); + btnNewButton_2.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + bookTypeDeleteActionEvent(e); + } + }); + btnNewButton_2.setIcon(new ImageIcon(BookTypeManageInterFrame.class.getResource("/images/delete.png"))); + btnNewButton_2.setFont(new Font("宋体", Font.BOLD, 15)); + + bookTypeDescTxt = new JTextArea(); + + GroupLayout gl_panel = new GroupLayout(panel); + gl_panel.setHorizontalGroup( + gl_panel.createParallelGroup(Alignment.LEADING) + .addGroup(gl_panel.createSequentialGroup() + .addGroup(gl_panel.createParallelGroup(Alignment.LEADING) + .addGroup(gl_panel.createSequentialGroup() + .addGap(16) + .addGroup(gl_panel.createParallelGroup(Alignment.LEADING, false) + .addComponent(lblNewLabel_1, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(lblNewLabel_3, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addPreferredGap(ComponentPlacement.RELATED) + .addGroup(gl_panel.createParallelGroup(Alignment.TRAILING) + .addGroup(gl_panel.createSequentialGroup() + .addComponent(idTxt, GroupLayout.PREFERRED_SIZE, 83, GroupLayout.PREFERRED_SIZE) + .addGap(13) + .addComponent(lblNewLabel_2, GroupLayout.PREFERRED_SIZE, 101, GroupLayout.PREFERRED_SIZE) + .addPreferredGap(ComponentPlacement.RELATED) + .addComponent(bookTypeNameTxt, 100, 100, 100)) + .addComponent(bookTypeDescTxt, GroupLayout.DEFAULT_SIZE, 301, Short.MAX_VALUE))) + .addGroup(gl_panel.createSequentialGroup() + .addGap(72) + .addComponent(btnNewButton_1, GroupLayout.PREFERRED_SIZE, 96, GroupLayout.PREFERRED_SIZE) + .addGap(90) + .addComponent(btnNewButton_2, GroupLayout.PREFERRED_SIZE, 97, GroupLayout.PREFERRED_SIZE))) + .addGap(51)) + ); + gl_panel.setVerticalGroup( + gl_panel.createParallelGroup(Alignment.LEADING) + .addGroup(gl_panel.createSequentialGroup() + .addContainerGap() + .addGroup(gl_panel.createParallelGroup(Alignment.BASELINE) + .addComponent(lblNewLabel_1) + .addComponent(bookTypeNameTxt, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) + .addComponent(idTxt, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) + .addComponent(lblNewLabel_2, GroupLayout.PREFERRED_SIZE, 18, GroupLayout.PREFERRED_SIZE)) + .addGroup(gl_panel.createParallelGroup(Alignment.LEADING) + .addGroup(gl_panel.createSequentialGroup() + .addGap(18) + .addComponent(lblNewLabel_3)) + .addGroup(gl_panel.createSequentialGroup() + .addGap(22) + .addComponent(bookTypeDescTxt, GroupLayout.PREFERRED_SIZE, 83, GroupLayout.PREFERRED_SIZE))) + .addPreferredGap(ComponentPlacement.UNRELATED) + .addGroup(gl_panel.createParallelGroup(Alignment.BASELINE) + .addComponent(btnNewButton_2, GroupLayout.PREFERRED_SIZE, 27, GroupLayout.PREFERRED_SIZE) + .addComponent(btnNewButton_1, GroupLayout.PREFERRED_SIZE, 27, GroupLayout.PREFERRED_SIZE)) + .addContainerGap()) + ); + panel.setLayout(gl_panel); + + bookTypeTable = new JTable(); + bookTypeTable.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent e) { + bookTypeTableMousePressed(e); + } + + }); + bookTypeTable.setModel(new DefaultTableModel( + new Object[][] { + }, + new String[] { + "\u7F16\u53F7", "\u56FE\u4E66\u7C7B\u522B\u540D\u79F0", "\u56FE\u4E66\u7C7B\u522B\u63CF\u8FF0" + } + ) { + boolean[] columnEditables = new boolean[] { + false, false, false + }; + public boolean isCellEditable(int row, int column) { + return columnEditables[column]; + } + }); + bookTypeTable.getColumnModel().getColumn(1).setPreferredWidth(84); + bookTypeTable.getColumnModel().getColumn(2).setPreferredWidth(86); + scrollPane.setViewportView(bookTypeTable); + getContentPane().setLayout(groupLayout); + this.fillTable(new BookType()); + bookTypeDescTxt.setBorder(new LineBorder(new java.awt.Color(127,157,185), 1, false)); + + } + private void bookTypeDeleteActionEvent(ActionEvent evt) { + String id=idTxt.getText(); + if(StringUtil.isEmpty(id)){ + JOptionPane.showMessageDialog(null, "请选择要删除的记录"); + return; + } + int n=JOptionPane.showConfirmDialog(null, "确定要删除该记录吗?"); + if(n==0){ + Connection con=null; + try{ + con=bookUtil.getCon(); + int deleteNum=bookTypeDao.delete(con, id); + if(deleteNum==1){ + JOptionPane.showMessageDialog(null, "删除成功"); + this.resetValue(); + this.fillTable(new BookType()); + }else{ + JOptionPane.showMessageDialog(null, "删除失败"); + } + }catch(Exception e){ + e.printStackTrace(); + JOptionPane.showMessageDialog(null, "删除失败"); + }finally{ + try { + bookUtil.closeCon(con); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + } + + private void bookTypeUpdateActionEvent(ActionEvent evt) { + String id=idTxt.getText(); + String bookTypeName=bookTypeNameTxt.getText(); + String bookTypeDesc=bookTypeDescTxt.getText(); + if(StringUtil.isEmpty(id)){ + JOptionPane.showMessageDialog(null, "请选择要修改的记录"); + return; + } + if(StringUtil.isEmpty(bookTypeName)){ + JOptionPane.showMessageDialog(null, "图书类别名称不能为空"); + return; + } + BookType bookType=new BookType(Integer.parseInt(id),bookTypeName,bookTypeDesc); + Connection con=null; + try{ + con=bookUtil.getCon(); + int modifyNum=bookTypeDao.update(con, bookType); + if(modifyNum==1){ + JOptionPane.showMessageDialog(null, "修改成功"); + this.resetValue(); + this.fillTable(new BookType()); + }else{ + JOptionPane.showMessageDialog(null, "修改失败"); + } + }catch(Exception e){ + e.printStackTrace(); + JOptionPane.showMessageDialog(null, "修改失败"); + }finally{ + try { + bookUtil.closeCon(con); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + + + private void bookTypeTableMousePressed(MouseEvent evt) { + int row=bookTypeTable.getSelectedRow(); + idTxt.setText((String)bookTypeTable.getValueAt(row, 0)); + bookTypeNameTxt.setText((String)bookTypeTable.getValueAt(row, 1)); + bookTypeDescTxt.setText((String)bookTypeTable.getValueAt(row, 2)); + } + + + private void bookTypeSearchActionPerformed(ActionEvent evt) { + String s_bookTypeName=this.s_bookTypeNameTxt.getText(); + BookType bookType=new BookType(); + bookType.setBookTypeName(s_bookTypeName); + this.fillTable(bookType); + } + + private void fillTable(BookType bookType){ + DefaultTableModel dtm=(DefaultTableModel) bookTypeTable.getModel(); + dtm.setRowCount(0); // 设置成0行 + Connection con=null; + try{ + con=bookUtil.getCon(); + ResultSet rs=bookTypeDao.list(con, bookType); + while(rs.next()){ + Vector v=new Vector(); + v.add(rs.getString("id")); + v.add(rs.getString("bookTypeName")); + v.add(rs.getString("bookTypeDesc")); + dtm.addRow(v); + } + }catch(Exception e){ + e.printStackTrace(); + }finally{ + try { + bookUtil.closeCon(con); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + private void resetValue(){ + this.idTxt.setText(""); + this.bookTypeNameTxt.setText(""); + this.bookTypeDescTxt.setText(""); + } +} diff --git a/src/book/view/view/Gy0409InterFrame.java b/src/book/view/view/Gy0409InterFrame.java new file mode 100644 index 0000000..45f69b2 --- /dev/null +++ b/src/book/view/view/Gy0409InterFrame.java @@ -0,0 +1,63 @@ +package book.view; + +import java.awt.EventQueue; + +import javax.swing.JInternalFrame; +import javax.swing.GroupLayout; +import javax.swing.GroupLayout.Alignment; +import java.awt.Color; +import javax.swing.JLabel; +import javax.swing.ImageIcon; +import java.awt.Font; +import javax.swing.SwingConstants; + +public class Gy0409InterFrame extends JInternalFrame { + + /** + * Launch the application. + */ + public static void main(String[] args) { + EventQueue.invokeLater(new Runnable() { + public void run() { + try { + Gy0409InterFrame frame = new Gy0409InterFrame(); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + } + + /** + * Create the frame. + */ + public Gy0409InterFrame() { + getContentPane().setBackground(new Color(175, 238, 238)); + setIconifiable(true); + setClosable(true); + setTitle("\u5173\u4E8E0409"); + setBounds(100, 100, 450, 300); + + JLabel lblNewLabel = new JLabel("Hello"); + lblNewLabel.setFont(new Font("新蒂下午茶体", Font.BOLD, 45)); + lblNewLabel.setIcon(null); + GroupLayout groupLayout = new GroupLayout(getContentPane()); + groupLayout.setHorizontalGroup( + groupLayout.createParallelGroup(Alignment.TRAILING) + .addGroup(Alignment.LEADING, groupLayout.createSequentialGroup() + .addGap(167) + .addComponent(lblNewLabel) + .addContainerGap(179, Short.MAX_VALUE)) + ); + groupLayout.setVerticalGroup( + groupLayout.createParallelGroup(Alignment.LEADING) + .addGroup(groupLayout.createSequentialGroup() + .addGap(90) + .addComponent(lblNewLabel, GroupLayout.PREFERRED_SIZE, 88, GroupLayout.PREFERRED_SIZE) + .addContainerGap(93, Short.MAX_VALUE)) + ); + getContentPane().setLayout(groupLayout); + + } +} diff --git a/src/book/view/view/LogFrame.java b/src/book/view/view/LogFrame.java new file mode 100644 index 0000000..6a9ddb0 --- /dev/null +++ b/src/book/view/view/LogFrame.java @@ -0,0 +1,160 @@ +package book.view; + +import java.awt.EventQueue; +import java.awt.Font; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.sql.Connection; + +import javax.swing.GroupLayout; +import javax.swing.GroupLayout.Alignment; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JPasswordField; +import javax.swing.JTextField; +import javax.swing.LayoutStyle.ComponentPlacement; +import javax.swing.border.EmptyBorder; + +import book.dao.Userdao; +import book.model.User; +import book.util.BookUtil; +import book.util.StringUtil; + +public class LogFrame extends JFrame { + + private JPanel contentPane; + private JTextField userNameTxt; + private JPasswordField passWordTxt; + private BookUtil libraryUtil=new BookUtil(); + private Userdao userdao=new Userdao(); + + /** + * Launch the application. + */ + public static void main(String[] args) { + EventQueue.invokeLater(new Runnable() { + public void run() { + try { + LogFrame frame = new LogFrame(); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + } + + /** + * Create the frame. + */ + public LogFrame() { + + + setResizable(false); + setFont(new Font("Dialog", Font.BOLD, 10)); + setTitle("\u767B\u5F55"); + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + setBounds(100, 100, 527, 343); + contentPane = new JPanel(); + contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); + setContentPane(contentPane); + + JLabel lblNewLabel = new JLabel("\u56FE\u4E66\u7BA1\u7406\u7CFB\u7EDF\u754C\u9762"); + lblNewLabel.setBounds(154, 20, 196, 59); + lblNewLabel.setIcon(null); + lblNewLabel.setFont(new Font("宋体", Font.BOLD, 23)); + + JLabel lblNewLabel_1 = new JLabel("\u7528\u6237\u540D\uFF1A"); + lblNewLabel_1.setFont(new Font("宋体", Font.PLAIN, 16)); + lblNewLabel_1.setBounds(57, 93, 87, 29); + lblNewLabel_1.setIcon(new ImageIcon(LogFrame.class.getResource("/images/userName.png"))); + + JLabel lblNewLabel_2 = new JLabel("\u5BC6\u7801\uFF1A"); + lblNewLabel_2.setFont(new Font("宋体", Font.PLAIN, 16)); + lblNewLabel_2.setBounds(57, 160, 87, 25); + lblNewLabel_2.setIcon(new ImageIcon(LogFrame.class.getResource("/images/password.png"))); + + userNameTxt = new JTextField(); + userNameTxt.setBounds(154, 90, 310, 32); + userNameTxt.setColumns(10); + + JButton btnNewButton = new JButton("\u767B\u5F55"); + btnNewButton.setBounds(57, 233, 97, 33); + btnNewButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + loginActionPerformed(e); + } + }); + btnNewButton.setFont(new Font("宋体", Font.BOLD, 20)); + btnNewButton.setIcon(new ImageIcon(LogFrame.class.getResource("/images/login.png"))); + + JButton btnNewButton_1 = new JButton("\u91CD\u7F6E"); + btnNewButton_1.setBounds(217, 233, 103, 33); + btnNewButton_1.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + resetValueActionPerformed(e); + } + + + }); + btnNewButton_1.setFont(new Font("宋体", Font.BOLD, 20)); + btnNewButton_1.setIcon(new ImageIcon(LogFrame.class.getResource("/images/reset.png"))); + + passWordTxt = new JPasswordField(); + passWordTxt.setBounds(154, 153, 310, 32); + + JButton btnNewButton_2 = new JButton("\u6CE8\u518C"); + btnNewButton_2.setBounds(384, 233, 97, 33); + btnNewButton_2.setIcon(new ImageIcon(LogFrame.class.getResource("/images/edit.png"))); + btnNewButton_2.setFont(new Font("宋体", Font.BOLD, 20)); + contentPane.setLayout(null); + contentPane.add(btnNewButton); + contentPane.add(lblNewLabel_1); + contentPane.add(lblNewLabel_2); + contentPane.add(btnNewButton_1); + contentPane.add(btnNewButton_2); + contentPane.add(passWordTxt); + contentPane.add(userNameTxt); + contentPane.add(lblNewLabel); + this.setLocationRelativeTo(null); + } + + + private void resetValueActionPerformed(ActionEvent evt) { + this.userNameTxt.setText(""); + this.passWordTxt.setText(""); + } + + private void loginActionPerformed(ActionEvent evt) { + String userName=this.userNameTxt.getText(); + String passWord=new String(this.passWordTxt.getPassword()); + if(StringUtil.isEmpty(userName)) { + JOptionPane.showMessageDialog(null,"用户名不能为空!"); + return; + } + if(StringUtil.isEmpty(passWord)) { + JOptionPane.showMessageDialog(null,"密码不能为空!"); + return; + } + User user=new User(userName,passWord); + Connection con=null; + try { + con=libraryUtil.getCon(); + User currentUser=userdao.login(con,user); + if(currentUser!=null) { + dispose(); + new MainFrame().setVisible(true); + } + else { + JOptionPane.showMessageDialog(null,"用户名或密码错误!"); + } + } catch (Exception e) { + // TODO 自动生成的 catch 块 + e.printStackTrace(); + } + } +} \ No newline at end of file diff --git a/src/book/view/view/MainFrame.java b/src/book/view/view/MainFrame.java new file mode 100644 index 0000000..f93d6a0 --- /dev/null +++ b/src/book/view/view/MainFrame.java @@ -0,0 +1,145 @@ +package book.view; + +import java.awt.BorderLayout; +import java.awt.EventQueue; + +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.border.EmptyBorder; +import javax.swing.JMenuBar; +import javax.swing.JMenu; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import javax.swing.ImageIcon; +import javax.swing.GroupLayout; +import javax.swing.GroupLayout.Alignment; +import javax.swing.JDesktopPane; +import java.awt.Color; +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; + +public class MainFrame extends JFrame { + + private JPanel contentPane; + private JDesktopPane table=null; + /** + * Launch the application. + */ + public static void main(String[] args) { + EventQueue.invokeLater(new Runnable() { + public void run() { + try { + MainFrame frame = new MainFrame(); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + } + + /** + * Create the frame. + */ + public MainFrame() { + setTitle("\u56FE\u4E66\u7BA1\u7406\u7CFB\u7EDF\u4E3B\u754C\u9762"); + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + setBounds(100, 100, 450, 300); + + JMenuBar menuBar = new JMenuBar(); + setJMenuBar(menuBar); + + JMenu mnNewMenu = new JMenu("\u57FA\u672C\u6570\u636E\u7EF4\u62A4"); + mnNewMenu.setIcon(new ImageIcon(MainFrame.class.getResource("/images/base.png"))); + menuBar.add(mnNewMenu); + + JMenu mnNewMenu_2 = new JMenu("\u56FE\u4E66\u7C7B\u522B\u7BA1\u7406"); + mnNewMenu_2.setIcon(new ImageIcon(MainFrame.class.getResource("/images/bookTypeManager.png"))); + mnNewMenu.add(mnNewMenu_2); + + JMenuItem mntmNewMenuItem_1 = new JMenuItem("\u56FE\u4E66\u7C7B\u522B\u6DFB\u52A0"); + mntmNewMenuItem_1.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + BookTypeAddInterFrame bookTypeAddInterFrame=new BookTypeAddInterFrame(); + bookTypeAddInterFrame.setVisible(true); + table.add(bookTypeAddInterFrame); + } + }); + mntmNewMenuItem_1.setIcon(new ImageIcon(MainFrame.class.getResource("/images/add.png"))); + mnNewMenu_2.add(mntmNewMenuItem_1); + + JMenuItem mntmNewMenuItem_2 = new JMenuItem("\u56FE\u4E66\u7C7B\u522B\u7EF4\u62A4"); + mntmNewMenuItem_2.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + BookTypeManageInterFrame bookTypeManageInterFrame=new BookTypeManageInterFrame(); + bookTypeManageInterFrame.setVisible(true); + table.add(bookTypeManageInterFrame); + } + }); + mntmNewMenuItem_2.setIcon(new ImageIcon(MainFrame.class.getResource("/images/edit.png"))); + mnNewMenu_2.add(mntmNewMenuItem_2); + + JMenu mnNewMenu_3 = new JMenu("\u56FE\u4E66\u7BA1\u7406"); + mnNewMenu_3.setIcon(new ImageIcon(MainFrame.class.getResource("/images/bookManager.png"))); + mnNewMenu.add(mnNewMenu_3); + + JMenuItem mntmNewMenuItem_3 = new JMenuItem("\u56FE\u4E66\u6DFB\u52A0"); + mntmNewMenuItem_3.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + BookAddInterFrame bookAddInterFrame=new BookAddInterFrame(); + bookAddInterFrame.setVisible(true); + table.add(bookAddInterFrame); + } + }); + mntmNewMenuItem_3.setIcon(new ImageIcon(MainFrame.class.getResource("/images/add.png"))); + mnNewMenu_3.add(mntmNewMenuItem_3); + + JMenuItem mntmNewMenuItem_4 = new JMenuItem("\u56FE\u4E66\u7EF4\u62A4"); + mntmNewMenuItem_4.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + BookManageInterFrame bookManageInterFrame=new BookManageInterFrame(); + bookManageInterFrame.setVisible(true); + table.add(bookManageInterFrame); + } + }); + mntmNewMenuItem_4.setIcon(new ImageIcon(MainFrame.class.getResource("/images/edit.png"))); + mnNewMenu_3.add(mntmNewMenuItem_4); + + JMenuItem mntmNewMenuItem_5 = new JMenuItem("\u5B89\u5168\u9000\u51FA"); + mntmNewMenuItem_5.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + int result=JOptionPane.showConfirmDialog(null, "是否退出系统"); + if(result==0) { + dispose(); + } + } + }); + mntmNewMenuItem_5.setIcon(new ImageIcon(MainFrame.class.getResource("/images/exit.png"))); + mnNewMenu.add(mntmNewMenuItem_5); + + JMenu mnNewMenu_1 = new JMenu("\u5173\u4E8E\u6211\u4EEC"); + mnNewMenu_1.setIcon(new ImageIcon(MainFrame.class.getResource("/images/about.png"))); + menuBar.add(mnNewMenu_1); + + JMenuItem mntmNewMenuItem = new JMenuItem("\u5173\u4E8E0409"); + mntmNewMenuItem.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + Gy0409InterFrame gy0409InterFrame=new Gy0409InterFrame(); + gy0409InterFrame.setVisible(true); + table.add(gy0409InterFrame); + } + }); + mntmNewMenuItem.setIcon(new ImageIcon(MainFrame.class.getResource("/images/about.png"))); + mnNewMenu_1.add(mntmNewMenuItem); + contentPane = new JPanel(); + contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); + setContentPane(contentPane); + contentPane.setLayout(new BorderLayout(0, 0)); + + table = new JDesktopPane(); + table.setBackground(Color.LIGHT_GRAY); + contentPane.add(table, BorderLayout.CENTER); + + this.setExtendedState(JFrame.MAXIMIZED_BOTH); + } +} -- Gitee From 97de1390cf4b0c2e94a692f106418b3a3b716a3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <9252971+qq783615077@user.noreply.gitee.com> Date: Sat, 4 Sep 2021 03:33:48 +0000 Subject: [PATCH 17/24] update src/book/dao/dao/BookDao.java. --- src/book/dao/dao/BookDao.java | 79 +++++++++++++++++++++++++++++++++-- 1 file changed, 76 insertions(+), 3 deletions(-) diff --git a/src/book/dao/dao/BookDao.java b/src/book/dao/dao/BookDao.java index 5903a88..dc36812 100644 --- a/src/book/dao/dao/BookDao.java +++ b/src/book/dao/dao/BookDao.java @@ -8,15 +8,55 @@ import book.model.Book; import book.util.StringUtil; /** - * 图书Dao类 + * 鍥句功Dao绫 * @author Administrator * */ public class BookDao { - + /** + * 鍥句功娣诲姞 + * @param con + * @param book + * @return + * @throws Exception + */ + public int add(Connection con,Book book)throws Exception{ + String sql="insert into dbo.t_book values(null,?,?,?,?,?,?)"; + PreparedStatement pstmt=con.prepareStatement(sql); + pstmt.setString(1, book.getBookName()); + pstmt.setString(2, book.getAuthor()); + pstmt.setString(3, book.getSex()); + pstmt.setFloat(4, book.getPrice()); + pstmt.setInt(5, book.getBookTypeId()); + pstmt.setString(6, book.getBookDesc()); + return pstmt.executeUpdate(); + } + + /** + * 鍥句功淇℃伅鏌ヨ + * @param con + * @param book + * @return + * @throws Exception + */ + public ResultSet list(Connection con,Book book)throws Exception{ + StringBuffer sb=new StringBuffer("select * from dbo.t_book b,dbo.booktype bt where b.bookTypeId=bt.id"); + if(StringUtil.isNotEmpty(book.getBookName())){ + sb.append(" and b.bookName like '%"+book.getBookName()+"%'"); + } + if(StringUtil.isNotEmpty(book.getAuthor())){ + sb.append(" and b.author like '%"+book.getAuthor()+"%'"); + } + if(book.getBookTypeId()!=null && book.getBookTypeId()!=-1){ + sb.append(" and b.bookTypeId="+book.getBookTypeId()); + } + PreparedStatement pstmt=con.prepareStatement(sb.toString()); + return pstmt.executeQuery(); + } + /** - * 图书信息删除 + * 鍥句功淇℃伅鍒犻櫎 * @param con * @param id * @return @@ -28,7 +68,40 @@ public class BookDao { pstmt.setString(1, id); return pstmt.executeUpdate(); } + /** + * 鍥句功淇℃伅淇敼 + * @param con + * @param book + * @return + * @throws Exception + */ + public int update(Connection con,Book book)throws Exception{ + String sql="update t_book set bookName=?,author=?,sex=?,price=?,bookDesc=?,bookTypeId=? where id=?"; + PreparedStatement pstmt=con.prepareStatement(sql); + pstmt.setString(1, book.getBookName()); + pstmt.setString(2, book.getAuthor()); + pstmt.setString(3, book.getSex()); + pstmt.setFloat(4, book.getPrice()); + pstmt.setString(5, book.getBookDesc()); + pstmt.setInt(6, book.getBookTypeId()); + pstmt.setInt(7, book.getId()); + return pstmt.executeUpdate(); + } + /** + * 鎸囧畾鍥句功绫诲埆涓嬫槸鍚﹀瓨鍦ㄥ浘涔 + * @param con + * @param bookTypeId + * @return + * @throws Exception + */ + public boolean existBookByBookTypeId(Connection con,String bookTypeId)throws Exception{ + String sql="select * from dbo.t_book where bookTypeId=?"; + PreparedStatement pstmt=con.prepareStatement(sql); + pstmt.setString(1, bookTypeId); + ResultSet rs=pstmt.executeQuery(); + return rs.next(); + } } -- Gitee From 5317c701f4f6546f4e2b5aff5731689919de9ef8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <9252971+qq783615077@user.noreply.gitee.com> Date: Sat, 4 Sep 2021 03:34:32 +0000 Subject: [PATCH 18/24] update src/book/view/view/BookManageInterFrame.java. --- src/book/view/view/BookManageInterFrame.java | 581 +++++++++++++++++++ 1 file changed, 581 insertions(+) diff --git a/src/book/view/view/BookManageInterFrame.java b/src/book/view/view/BookManageInterFrame.java index e69de29..916f5b9 100644 --- a/src/book/view/view/BookManageInterFrame.java +++ b/src/book/view/view/BookManageInterFrame.java @@ -0,0 +1,581 @@ +package book.view; + +import java.awt.EventQueue; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.sql.Connection; +import java.sql.ResultSet; +import java.util.Vector; + +import javax.swing.ButtonGroup; +import javax.swing.GroupLayout; +import javax.swing.GroupLayout.Alignment; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JInternalFrame; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JRadioButton; +import javax.swing.JScrollPane; +import javax.swing.JTable; +import javax.swing.JTextArea; +import javax.swing.JTextField; +import javax.swing.LayoutStyle.ComponentPlacement; +import javax.swing.border.LineBorder; +import javax.swing.border.TitledBorder; +import javax.swing.table.DefaultTableModel; + +import book.dao.BookDao; +import book.dao.BookTypeDao; +import book.model.Book; +import book.model.BookType; +import book.util.BookUtil; +import book.util.StringUtil; + +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; +import net.miginfocom.swing.MigLayout; +import javax.swing.JRadioButton; +import javax.swing.ButtonGroup; + +public class BookManageInterFrame extends JInternalFrame { + private JTable bookTable; + private JTextField s_bookNameTxt; + private JTextField s_authorTxt; + private JComboBox s_bookTypeJcb; + private JRadioButton manJrb ; + private JRadioButton femaleJrb ; + private JTextArea bookDescTxt; + private JComboBox bookTypeJcb ; + + private BookUtil bookUtil=new BookUtil(); + private BookTypeDao bookTypeDao=new BookTypeDao(); + private BookDao bookDao=new BookDao(); + private JTextField idTxt; + private JTextField bookNameTxt; + private final ButtonGroup buttonGroup = new ButtonGroup(); + private JTextField priceTxt; + private JTextField authorTxt; + + /** + * Launch the application. + */ + public static void main(String[] args) { + EventQueue.invokeLater(new Runnable() { + public void run() { + try { + BookManageInterFrame frame = new BookManageInterFrame(); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + } + + /** + * Create the frame. + */ + public BookManageInterFrame() { + setClosable(true); + setIconifiable(true); + setTitle("\u56FE\u4E66\u7BA1\u7406"); + setBounds(100, 100, 646, 517); + + JScrollPane scrollPane = new JScrollPane(); + + JPanel panel = new JPanel(); + panel.setBorder(new TitledBorder(null, "\u641C\u7D22\u6761\u4EF6", TitledBorder.LEADING, TitledBorder.TOP, null, null)); + + JPanel panel_1 = new JPanel(); + panel_1.setBorder(new TitledBorder(null, "\u8868\u5355\u64CD\u4F5C", TitledBorder.LEADING, TitledBorder.TOP, null, null)); + GroupLayout groupLayout = new GroupLayout(getContentPane()); + groupLayout.setHorizontalGroup( + groupLayout.createParallelGroup(Alignment.LEADING) + .addGroup(groupLayout.createSequentialGroup() + .addContainerGap() + .addGroup(groupLayout.createParallelGroup(Alignment.TRAILING) + .addComponent(panel_1, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(Alignment.LEADING, groupLayout.createParallelGroup(Alignment.LEADING, false) + .addComponent(panel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(scrollPane))) + .addContainerGap(66, Short.MAX_VALUE)) + ); + groupLayout.setVerticalGroup( + groupLayout.createParallelGroup(Alignment.LEADING) + .addGroup(groupLayout.createSequentialGroup() + .addGap(28) + .addComponent(panel, GroupLayout.PREFERRED_SIZE, 65, GroupLayout.PREFERRED_SIZE) + .addGap(18) + .addComponent(scrollPane, GroupLayout.PREFERRED_SIZE, 116, GroupLayout.PREFERRED_SIZE) + .addGap(18) + .addComponent(panel_1, GroupLayout.DEFAULT_SIZE, 203, Short.MAX_VALUE) + .addContainerGap()) + ); + + JLabel lblNewLabel = new JLabel("\u7F16\u53F7\uFF1A"); + + idTxt = new JTextField(); + idTxt.setEditable(false); + idTxt.setColumns(10); + + JLabel lblNewLabel_1 = new JLabel("\u56FE\u4E66\u540D\u79F0\uFF1A"); + + bookNameTxt = new JTextField(); + bookNameTxt.setColumns(10); + + JLabel label_3 = new JLabel("\u4F5C\u8005\u6027\u522B\uFF1A"); + + manJrb = new JRadioButton("\u7537"); + buttonGroup.add(manJrb); + manJrb.setSelected(true); + + femaleJrb = new JRadioButton("\u5973"); + buttonGroup.add(femaleJrb); + + JLabel label_4 = new JLabel("\u4EF7\u683C\uFF1A"); + + priceTxt = new JTextField(); + priceTxt.setColumns(10); + + JLabel lblNewLabel_2 = new JLabel("\u56FE\u4E66\u4F5C\u8005\uFF1A"); + + authorTxt = new JTextField(); + authorTxt.setColumns(10); + + JLabel label_5 = new JLabel("\u56FE\u4E66\u7C7B\u522B\uFF1A"); + + bookTypeJcb = new JComboBox(); + + JLabel label_6 = new JLabel("\u56FE\u4E66\u63CF\u8FF0\uFF1A"); + + bookDescTxt = new JTextArea(); + + JButton button_1 = new JButton("\u4FEE\u6539"); + button_1.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent evt) { + bookUpdateActionPerformed(evt); + } + }); + ; + button_1.setIcon(new ImageIcon(BookManageInterFrame.class.getResource("/images/modify.png"))); + + JButton button_2 = new JButton("\u5220\u9664"); + button_2.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent evt) { + bookDeleteActionPerformed(evt); + } + }); + ; + button_2.setIcon(new ImageIcon(BookManageInterFrame.class.getResource("/images/delete.png"))); + GroupLayout gl_panel_1 = new GroupLayout(panel_1); + gl_panel_1.setHorizontalGroup( + gl_panel_1.createParallelGroup(Alignment.LEADING) + .addGroup(gl_panel_1.createSequentialGroup() + .addGap(19) + .addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING) + .addGroup(gl_panel_1.createSequentialGroup() + .addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING, false) + .addGroup(gl_panel_1.createSequentialGroup() + .addComponent(label_4) + .addPreferredGap(ComponentPlacement.RELATED) + .addComponent(priceTxt)) + .addGroup(gl_panel_1.createSequentialGroup() + .addComponent(lblNewLabel) + .addPreferredGap(ComponentPlacement.RELATED) + .addComponent(idTxt, GroupLayout.PREFERRED_SIZE, 87, GroupLayout.PREFERRED_SIZE))) + .addGap(26) + .addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING, false) + .addGroup(gl_panel_1.createSequentialGroup() + .addComponent(lblNewLabel_1) + .addPreferredGap(ComponentPlacement.RELATED) + .addComponent(bookNameTxt, GroupLayout.PREFERRED_SIZE, 85, GroupLayout.PREFERRED_SIZE)) + .addGroup(gl_panel_1.createSequentialGroup() + .addComponent(lblNewLabel_2) + .addPreferredGap(ComponentPlacement.RELATED) + .addComponent(authorTxt))) + .addGap(26) + .addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING, false) + .addGroup(gl_panel_1.createSequentialGroup() + .addComponent(label_3) + .addPreferredGap(ComponentPlacement.UNRELATED) + .addComponent(manJrb) + .addPreferredGap(ComponentPlacement.RELATED) + .addComponent(femaleJrb)) + .addGroup(gl_panel_1.createSequentialGroup() + .addComponent(label_5) + .addPreferredGap(ComponentPlacement.UNRELATED) + .addComponent(bookTypeJcb, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) + .addGroup(gl_panel_1.createParallelGroup(Alignment.TRAILING) + .addGroup(Alignment.LEADING, gl_panel_1.createSequentialGroup() + .addGap(25) + .addComponent(button_1) + .addPreferredGap(ComponentPlacement.RELATED, 289, Short.MAX_VALUE) + .addComponent(button_2)) + .addGroup(Alignment.LEADING, gl_panel_1.createSequentialGroup() + .addComponent(label_6) + .addPreferredGap(ComponentPlacement.UNRELATED) + .addComponent(bookDescTxt, GroupLayout.DEFAULT_SIZE, 398, Short.MAX_VALUE)))) + .addGap(88)) + ); + gl_panel_1.setVerticalGroup( + gl_panel_1.createParallelGroup(Alignment.LEADING) + .addGroup(gl_panel_1.createSequentialGroup() + .addGap(21) + .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE) + .addComponent(lblNewLabel) + .addComponent(idTxt, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) + .addComponent(lblNewLabel_1) + .addComponent(bookNameTxt, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) + .addComponent(label_3) + .addComponent(manJrb) + .addComponent(femaleJrb)) + .addGap(18) + .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE) + .addComponent(label_4) + .addComponent(priceTxt, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) + .addComponent(lblNewLabel_2) + .addComponent(authorTxt, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) + .addComponent(label_5) + .addComponent(bookTypeJcb, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) + .addGap(18) + .addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING) + .addComponent(label_6) + .addComponent(bookDescTxt, GroupLayout.DEFAULT_SIZE, 54, Short.MAX_VALUE)) + .addGap(18) + .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE) + .addComponent(button_1) + .addComponent(button_2)) + .addContainerGap()) + ); + panel_1.setLayout(gl_panel_1); + + JLabel label = new JLabel("\u56FE\u4E66\u540D\u79F0\uFF1A"); + + s_bookNameTxt = new JTextField(); + s_bookNameTxt.setColumns(10); + + JLabel label_1 = new JLabel("\u56FE\u4E66\u4F5C\u8005\uFF1A"); + + s_authorTxt = new JTextField(); + s_authorTxt.setColumns(10); + + JLabel label_2 = new JLabel("\u56FE\u4E66\u7C7B\u522B\uFF1A"); + + s_bookTypeJcb = new JComboBox(); + + JButton button = new JButton("\u67E5\u8BE2"); + button.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + bookSearchActionPerformed(e); + } + }); + ; + button.setIcon(new ImageIcon(BookManageInterFrame.class.getResource("/images/search.png"))); + GroupLayout gl_panel = new GroupLayout(panel); + gl_panel.setHorizontalGroup( + gl_panel.createParallelGroup(Alignment.LEADING) + .addGroup(gl_panel.createSequentialGroup() + .addGap(19) + .addComponent(label) + .addPreferredGap(ComponentPlacement.RELATED) + .addComponent(s_bookNameTxt, GroupLayout.PREFERRED_SIZE, 77, GroupLayout.PREFERRED_SIZE) + .addGap(18) + .addComponent(label_1) + .addPreferredGap(ComponentPlacement.RELATED) + .addComponent(s_authorTxt, GroupLayout.PREFERRED_SIZE, 74, GroupLayout.PREFERRED_SIZE) + .addPreferredGap(ComponentPlacement.UNRELATED) + .addComponent(label_2) + .addPreferredGap(ComponentPlacement.RELATED) + .addComponent(s_bookTypeJcb, GroupLayout.PREFERRED_SIZE, 78, GroupLayout.PREFERRED_SIZE) + .addGap(18) + .addComponent(button) + .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + gl_panel.setVerticalGroup( + gl_panel.createParallelGroup(Alignment.TRAILING) + .addGroup(gl_panel.createSequentialGroup() + .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(gl_panel.createParallelGroup(Alignment.BASELINE) + .addComponent(label) + .addComponent(s_bookNameTxt, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) + .addComponent(label_1) + .addComponent(s_authorTxt, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) + .addComponent(label_2) + .addComponent(s_bookTypeJcb, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) + .addComponent(button)) + .addGap(16)) + ); + panel.setLayout(gl_panel); + + bookTable = new JTable(); + bookTable.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent met) { + bookTableMousePressed(met); + } + }); + ; + scrollPane.setViewportView(bookTable); + bookTable.setModel(new DefaultTableModel( + new Object[][] { + }, + new String[] { + "\u7F16\u53F7", "\u56FE\u4E66\u540D\u79F0", "\u56FE\u4E66\u4F5C\u8005", "\u4F5C\u8005\u6027\u522B", "\u56FE\u4E66\u4EF7\u683C", "\u56FE\u4E66\u63CF\u8FF0", "\u56FE\u4E66\u7C7B\u522B" + } + ) { + boolean[] columnEditables = new boolean[] { + false, false, false, false, false, false, false + }; + public boolean isCellEditable(int row, int column) { + return columnEditables[column]; + } + }); + bookTable.getColumnModel().getColumn(5).setPreferredWidth(119); + getContentPane().setLayout(groupLayout); + + // 璁剧疆鏂囨湰鍩熻竟妗 + bookDescTxt.setBorder(new LineBorder(new java.awt.Color(127,157,185), 1, false)); + + + this.fillBookType("search"); + this.fillBookType("modify"); + this.fillTable(new Book()); + } + /** + * 鍥句功鍒犻櫎浜嬩欢澶勭悊 + * @param evt + */ + private void bookDeleteActionPerformed(ActionEvent evt) { + String id=idTxt.getText(); + if(StringUtil.isEmpty(id)){ + JOptionPane.showMessageDialog(null, "璇烽夋嫨瑕佸垹闄ょ殑璁板綍"); + return; + } + int n=JOptionPane.showConfirmDialog(null, "纭畾瑕佸垹闄よ璁板綍鍚楋紵"); + if(n==0){ + Connection con=null; + try{ + con=bookUtil.getCon(); + int deleteNum=bookDao.delete(con, id); + if(deleteNum==1){ + JOptionPane.showMessageDialog(null, "鍒犻櫎鎴愬姛"); + this.resetValue(); + this.fillTable(new Book()); + }else{ + JOptionPane.showMessageDialog(null, "鍒犻櫎澶辫触"); + } + }catch(Exception e){ + e.printStackTrace(); + JOptionPane.showMessageDialog(null, "鍒犻櫎澶辫触"); + }finally{ + try { + bookUtil.closeCon(con); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + } + /** + * 鍥句功淇敼浜嬩欢澶勭悊 + * @param evt + */ + private void bookUpdateActionPerformed(ActionEvent evt) { + String id=this.idTxt.getText(); + if(StringUtil.isEmpty(id)){ + JOptionPane.showMessageDialog(null, "璇烽夋嫨瑕佷慨鏀圭殑璁板綍"); + return; + } + + String bookName=this.bookNameTxt.getText(); + String author=this.authorTxt.getText(); + String price=this.priceTxt.getText(); + String bookDesc=this.bookDescTxt.getText(); + + if(StringUtil.isEmpty(bookName)){ + JOptionPane.showMessageDialog(null, "鍥句功鍚嶇О涓嶈兘涓虹┖锛"); + return; + } + + if(StringUtil.isEmpty(author)){ + JOptionPane.showMessageDialog(null, "鍥句功浣滆呬笉鑳戒负绌猴紒"); + return; + } + + if(StringUtil.isEmpty(price)){ + JOptionPane.showMessageDialog(null, "鍥句功浠锋牸涓嶈兘涓虹┖锛"); + return; + } + + String sex=""; + if(manJrb.isSelected()){ + sex="鐢"; + }else if(femaleJrb.isSelected()){ + sex="濂"; + } + + BookType bookType=(BookType) bookTypeJcb.getSelectedItem(); + int bookTypeId=bookType.getId(); + + Book book=new Book(Integer.parseInt(id), bookName, author, sex, Float.parseFloat(price), bookTypeId, bookDesc); + + Connection con=null; + try{ + con=bookUtil.getCon(); + int addNum=bookDao.update(con, book); + if(addNum==1){ + JOptionPane.showMessageDialog(null, "鍥句功淇敼鎴愬姛锛"); + resetValue(); + this.fillTable(new Book()); + }else{ + JOptionPane.showMessageDialog(null, "鍥句功淇敼澶辫触锛"); + } + }catch(Exception e){ + e.printStackTrace(); + JOptionPane.showMessageDialog(null, "鍥句功淇敼澶辫触锛"); + }finally{ + try { + bookUtil.closeCon(con); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + + /** + * 閲嶇疆琛ㄥ崟 + */ + private void resetValue(){ + this.idTxt.setText(""); + this.bookNameTxt.setText(""); + this.authorTxt.setText(""); + this.priceTxt.setText(""); + this.manJrb.setSelected(true); + this.bookDescTxt.setText(""); + if(this.bookTypeJcb.getItemCount()>0){ + this.bookTypeJcb.setSelectedIndex(0); + } + } + + /** + * 琛ㄦ牸琛岀偣鍑讳簨浠跺鐞 + * @param met + */ + private void bookTableMousePressed(MouseEvent met) { + int row=this.bookTable.getSelectedRow(); + this.idTxt.setText((String)bookTable.getValueAt(row, 0)); + this.bookNameTxt.setText((String)bookTable.getValueAt(row, 1)); + this.authorTxt.setText((String)bookTable.getValueAt(row, 2)); + String sex=(String)bookTable.getValueAt(row, 3); + if("鐢".equals(sex)){ + this.manJrb.setSelected(true); + }else if("濂".equals(sex)){ + this.femaleJrb.setSelected(true); + } + this.priceTxt.setText((Float)bookTable.getValueAt(row, 4)+""); + this.bookDescTxt.setText((String)bookTable.getValueAt(row, 5)); + String bookTypeName=(String)this.bookTable.getValueAt(row, 6); + int n=this.bookTypeJcb.getItemCount(); + for(int i=0;i Date: Sat, 4 Sep 2021 03:35:03 +0000 Subject: [PATCH 19/24] update src/book/view/view/BookAddInterFrame.java. --- src/book/view/view/BookAddInterFrame.java | 110 +++++++++++++++++++++- 1 file changed, 105 insertions(+), 5 deletions(-) diff --git a/src/book/view/view/BookAddInterFrame.java b/src/book/view/view/BookAddInterFrame.java index d8a29cf..f640d4a 100644 --- a/src/book/view/view/BookAddInterFrame.java +++ b/src/book/view/view/BookAddInterFrame.java @@ -100,10 +100,20 @@ public class BookAddInterFrame extends JInternalFrame { bookTypeJcb = new JComboBox(); JButton button = new JButton("\u6DFB\u52A0"); + button.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + bookAddActionPerformed(e); + } + }); button.setIcon(new ImageIcon(BookAddInterFrame.class.getResource("/images/add.png"))); JButton button_1 = new JButton("\u91CD\u7F6E"); + button_1.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + resetValueActionPerformed(e); + } + }); button_1.setIcon(new ImageIcon(BookAddInterFrame.class.getResource("/images/reset.png"))); GroupLayout groupLayout = new GroupLayout(getContentPane()); @@ -180,10 +190,10 @@ public class BookAddInterFrame extends JInternalFrame { .addGap(42)) ); getContentPane().setLayout(groupLayout); - - // 设置文本域边框 + fillBookType(); + // 璁剧疆鏂囨湰鍩熻竟妗 bookDescTxt.setBorder(new LineBorder(new java.awt.Color(127,157,185), 1, false)); - + } @@ -193,7 +203,77 @@ public class BookAddInterFrame extends JInternalFrame { /** - * 重置表单 + * 閲嶇疆浜嬩欢澶勭悊 + * @param e + */ + private void resetValueActionPerformed(ActionEvent e) { + this.resetValue(); + } + + + /** + * 鍥句功娣诲姞浜嬩欢澶勭悊 + * @param e + */ + private void bookAddActionPerformed(ActionEvent evt) { + String bookName=this.bookNameTxt.getText(); + String author=this.authorTxt.getText(); + String price=this.priceTxt.getText(); + String bookDesc=this.bookDescTxt.getText(); + + if(StringUtil.isEmpty(bookName)){ + JOptionPane.showMessageDialog(null, "鍥句功鍚嶇О涓嶈兘涓虹┖锛"); + return; + } + + if(StringUtil.isEmpty(author)){ + JOptionPane.showMessageDialog(null, "鍥句功浣滆呬笉鑳戒负绌猴紒"); + return; + } + + if(StringUtil.isEmpty(price)){ + JOptionPane.showMessageDialog(null, "鍥句功浠锋牸涓嶈兘涓虹┖锛"); + return; + } + + String sex=""; + if(manJrb.isSelected()){ + sex="鐢"; + }else if(femaleJrb.isSelected()){ + sex="濂"; + } + + BookType bookType=(BookType) bookTypeJcb.getSelectedItem(); + int bookTypeId=bookType.getId(); + + Book book=new Book(bookName,author, sex, Float.parseFloat(price) , bookTypeId, bookDesc); + + Connection con=null; + try{ + con=bookUtil.getCon(); + int addNum=bookDao.add(con, book); + if(addNum==1){ + JOptionPane.showMessageDialog(null, "鍥句功娣诲姞鎴愬姛锛"); + resetValue(); + }else{ + JOptionPane.showMessageDialog(null, "鍥句功娣诲姞澶辫触锛"); + } + }catch(Exception e){ + e.printStackTrace(); + JOptionPane.showMessageDialog(null, "鍥句功娣诲姞澶辫触锛"); + }finally{ + try { + bookUtil.closeCon(con); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + + + /** + * 閲嶇疆琛ㄥ崟 */ private void resetValue(){ this.bookNameTxt.setText(""); @@ -205,6 +285,26 @@ public class BookAddInterFrame extends JInternalFrame { this.bookTypeJcb.setSelectedIndex(0); } } - + /** + * 鍒濆鍖栧浘涔︾被鍒笅鎷夋 + */ + private void fillBookType(){ + Connection con=null; + BookType bookType=null; + try{ + con=bookUtil.getCon(); + ResultSet rs=bookTypeDao.list(con, new BookType()); + while(rs.next()){ + bookType=new BookType(); + bookType.setId(rs.getInt("id")); + bookType.setBookTypeName(rs.getString("bookTypeName")); + this.bookTypeJcb.addItem(bookType); + } + }catch(Exception e){ + e.printStackTrace(); + }finally{ + + } + } } -- Gitee From e1c8473f36665e8be2b7b9d9cf89916a65dd22fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <9252971+qq783615077@user.noreply.gitee.com> Date: Sat, 4 Sep 2021 03:36:00 +0000 Subject: [PATCH 20/24] update src/book/view/view/MainFrame.java. --- src/book/view/view/MainFrame.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/book/view/view/MainFrame.java b/src/book/view/view/MainFrame.java index f93d6a0..208450b 100644 --- a/src/book/view/view/MainFrame.java +++ b/src/book/view/view/MainFrame.java @@ -108,7 +108,7 @@ public class MainFrame extends JFrame { JMenuItem mntmNewMenuItem_5 = new JMenuItem("\u5B89\u5168\u9000\u51FA"); mntmNewMenuItem_5.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - int result=JOptionPane.showConfirmDialog(null, "是否退出系统"); + int result=JOptionPane.showConfirmDialog(null, "鏄惁閫鍑虹郴缁"); if(result==0) { dispose(); } -- Gitee From 35326986439d970fc62184c6e7016af7b01321a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <9252971+qq783615077@user.noreply.gitee.com> Date: Wed, 13 Oct 2021 11:40:11 +0000 Subject: [PATCH 21/24] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20sr?= =?UTF-8?q?c/image?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/image/.keep | 0 src/image/images/about.png | Bin 664 -> 0 bytes src/image/images/add.png | Bin 805 -> 0 bytes src/image/images/base.png | Bin 852 -> 0 bytes src/image/images/bookManager.png | Bin 646 -> 0 bytes src/image/images/bookTypeManager.png | Bin 618 -> 0 bytes src/image/images/delete.png | Bin 666 -> 0 bytes src/image/images/edit.png | Bin 516 -> 0 bytes src/image/images/exit.png | Bin 755 -> 0 bytes src/image/images/java1234.png | Bin 12026 -> 0 bytes src/image/images/login.png | Bin 644 -> 0 bytes src/image/images/logo.png | Bin 5261 -> 0 bytes src/image/images/me.png | Bin 676 -> 0 bytes src/image/images/modify.png | Bin 611 -> 0 bytes src/image/images/password.png | Bin 481 -> 0 bytes src/image/images/reset.png | Bin 725 -> 0 bytes src/image/images/search.png | Bin 628 -> 0 bytes src/image/images/userName.png | Bin 575 -> 0 bytes 18 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/image/.keep delete mode 100644 src/image/images/about.png delete mode 100644 src/image/images/add.png delete mode 100644 src/image/images/base.png delete mode 100644 src/image/images/bookManager.png delete mode 100644 src/image/images/bookTypeManager.png delete mode 100644 src/image/images/delete.png delete mode 100644 src/image/images/edit.png delete mode 100644 src/image/images/exit.png delete mode 100644 src/image/images/java1234.png delete mode 100644 src/image/images/login.png delete mode 100644 src/image/images/logo.png delete mode 100644 src/image/images/me.png delete mode 100644 src/image/images/modify.png delete mode 100644 src/image/images/password.png delete mode 100644 src/image/images/reset.png delete mode 100644 src/image/images/search.png delete mode 100644 src/image/images/userName.png diff --git a/src/image/.keep b/src/image/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/src/image/images/about.png b/src/image/images/about.png deleted file mode 100644 index 11b183c6682cf5bf514a4692a7ad87cc8ba2bad0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal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;_ zB{l`NjXX-JP-URHVR^aZ>+d7?mS$&$<9~jI^Okaf;(|j}@zxK--OReIn~=K<5#d7fB<12NDuo(rY8wIg>&owh z5SVRElXg3(f}w-6KEyW7Pp6#(L=h3*Z0rRQ#)o#Y@9qNt>~HKPwF{^!8hU3gc0u4jvzN`1w{)q42`)fEoYrLPvD(@cK0ncLlXr#k}> zUByfv@y(56;p4QG1@$_nK`R=R-~!G%vbLRDnD4ymtbbzifNlP-8?VMak4vn|W?*<} jbXG);e)mxbE3y9o#xa2up*(jW00000NkvXXu0mjf{V0uG diff --git a/src/image/images/base.png b/src/image/images/base.png deleted file mode 100644 index 7965c690df19d50013f0dffd5f5d549ddd0691fd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 852 zcmV-a1FQUrP)}gTiV)gx3~BDz7_necH@AoJy z3^ji8bSWHOqDm>b{L8P0Iy<&^FGLi#g0~O9*K+2ov%ekv=;QAIJ#d$)rqUTypASXB zc;n4O>yCdJzuxoVCx_<`PylxC*&A(bZ5>@)Q==J%K{}J6y1JUl$v>&7xf>w_K2^o_ zJWSJ1fB*S+cXf5_2T%cYy=wE)a9I26?`b^G10a{nqbLfNmA#zbt{f4>5_^7Zbw zTGnr9-6W-GSlQ4}TPl@U5?ajI_*gQ2B7SOeaw55U^{NLd6&DYX0%2J5~Gf3`qkL-7^Pwn6ou)3rg?4K*7etu$s~}FKygRcu1Irp^E=BT5ySI9 zQ51v_ghC+^Fax-*i;xl_1XYHCwn%p`UA*u);Hm)mTyEXU`udRPfvzt?swz&|p;Ebd zr%&^tC<GstkYqiux6e0|NuuW5+%{eNS!es&F`rrfKx{ z_Ff(w9K0I4Hx?Tj8p@uG$G1+5j|~HN90r7+*!c8;hg&v01%$sie!}}>B;h5-#=Vzb zX+Hu)pJ{vk{l>-zTjsXk`GtAV02k2Oo_pa4ilUdxHg3iJ=G(JhpP8#WbDRYS%!e^A ew&xoEhyMTo8#0lR7YM}w0000&_CFolS7TN>^u@D6xLGcOHCL&r{*jNP8 zXf9$jA(QLOm`NscJ!fX`wfDA4V2HuO1q*&y{2%MWg8vNfu)n5!~`wOqD3kw^_9eKYsH3Wu~u>?MemT^WFj< zy8x==h+CF8G<3wUmCo|{>Uq9~ZK9U4Uw7geaAv+?(O-T9sSt zc}9zQesvmrH-a@5XAM?le+T}a5bdZGhoF3d%E}O`ZV1bDk`0AxIJWKM@Y5Z>$DAf?r_)ZYfn7{2H2t88i#C}TE(3~p~ z=Ub?FKdS5D-NXp68KH gr*X~^$ML@B4<95|3@6yi!~g&Q07*qoM6N<$f?_-=DgXcg diff --git a/src/image/images/bookTypeManager.png b/src/image/images/bookTypeManager.png deleted file mode 100644 index 270b451172f50ceb62d749e6fa48d10794447220..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 618 zcmV-w0+s!VP)0w85Qd*~6KWEzy$Kg@Q9+c@CT$T~&_(RtkBzHJz^%Iq{sw=9#f2bo73fM(+`5u} zplA)YXhECS(CE!qlP0YpHGl;mrXFvOjZu9% zJ9RM!AcXkq;KmpLJkR6BPGo-V{^UYb_htU(?dhB`FdDNMjYrt+=|exzZa-u+X0h83 zIeFIRO04y04Hm3mug9lKkLB_{-)cVVKl(iX+@{%)y!+l`I5afclI8L~!=Zt`Vx_!K zz1{;L8Z^38Ykhj!uwx86K)o5TRg2Q?NM3!BaFE;dqI~@6Q|~Am1Ay+zV&(Ol>$B78 zT-eeGA(#+?tu+`L?86u)fUh46!^Yq?8mz9Hd4Nd!ZJ~DW*5&cLH)gJ#kGDA!sd4qv zDN?4&q$_ZvbtYUvZaj&tD$HDnbM8co=4#1{hdICUMmh~P84*}I`bp?0;B#r?H0S^d{Dm<2c0RVAEr4cgZiU0rr07*qoM6N<$ Eg0uw`wg3PC diff --git a/src/image/images/delete.png b/src/image/images/delete.png deleted file mode 100644 index 0407734df7e58216eaa9371492c262857ccec0f8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 666 zcmV;L0%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#aSltTIBTUT3e zyrG~!)^6!A!ziFz4zqyhFS)N+nGpAcJ)p&deU z;){?{TBHJHW$G;t6DLAinpyz&;DheF?3{fz;?qy{oqQsELbQe+=`jN`^br07BpiLY zz-ON!=gp%_Kken0tITh|w1pmLNKV=b(fZWftkPY&B14C&Wd~YXi%*Eq)Ebfykl3*U zR;@aEjj%AplTYdy&$|iC3J6I^PEH`ng$s|q#Z_O)*q7vtv1M}zGH>{L@+E87MT)9%Mf~~1hX+Kh`r4du7x@{4> z-q1!{Lyz%$m;@o#?mq@dyV3Xd?wZ`qkMxC4AqmO5W! Y0HLuN5+oF#_5c6?07*qoM6N<$g8LrE&;S4c diff --git a/src/image/images/login.png b/src/image/images/login.png deleted file mode 100644 index d1d3e217f71489ccc699f39c3a810b4f429ec00f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 644 zcmV-~0(u%tR1jR_6M>@4vP*^pp?QiO&IxtmQ{1(%wYFkbp_X}0{Umy zT3tSO#O+gBC?SyR02=`e4rnG|Sr)cZ>WY@px+i;r(SHDa?_w@lk(ZQx-ZqhPa7{~Z zs<}70eDS;D5)apVoMF-B5WqRs;~UG26*`}X0@+=F#7%E=!y`ecqegmjWizAoPWJ}B z?F3wyiJb%xD%sCY3C93@9q$TE0RRa{(u=asdx97`+emJ-zr7gvRIBTQ@8cr??sATy ziL=d9q;GaBCwbhmk=gn=+2d&}Pw1bH^J*Z@!N4&nm<%uqe@-UFNFW5g_IDrr1tG zXe`kNAY8I5#R33=mxN$=_KM#kr=KKzlGnLtN=mE6IILVYYUT5-xB14@h3`8aV%ZgkIBqO+w~sI1v8aUi?Bs;6_^^EaAScfb9O z?ifwB+T8ZhI>pfgo1KDE3e&PsG%Tj(Czxj3S-9nomcuK)Yk!z*1JD7W2|yIU!iU@b eAGI30C;bNWJm^D4J2Ef;0000kWnGza$-AnBtGL#o z*I~wW*`r;aaa^9%4iD8WyH9`ct^fabOn|>BgCjU!NxtkVHoFeE4rmRo3)<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+twRX{1S)^DV!B~ywm+}0NsN2Ey3v?sHkN@J@G`r@O&t3xGfI}aA_=O9wh8;eA zX#I!951;y}{!7js${)KGgag7sDGxs=Bb7^*8RDpekeaYKh{+O`7xs`QEu@U8RbQZ3 z?xWSHQz#9AkVKs(elA2HS-9pq2Ojy$YcKfiPPUV`h&;T72PAg*H^mIjHVE?Jh~`2nWgVg5f| z_ekxAJI>u6vHz{|cMWg(36a&xabfPnEti&m>x|GAOC(7`x7)>W1LF3}w3<~4#WEmh|L=#I z)vw+1@zblF@BE^Ddt1*5?(o^H$A&JgTy)mOeHWeWs<1$sCM--pNRaa(gXYyg+*AMC zd(Pb+@xrofbcfHl9v%F*l?y-gdzFhmTx=$Lh!^H*e*LZ=b?<%Vg6$FW?}T4( zJ9hY#@0}d{lLvqIwAp*Nj$XOL$9<=LdPlIs$KBz-(_S3LVI0O`9L8b%v%~)bsb}30 Ti8+4I00000NkvXXu0mjfE(J?O diff --git a/src/image/images/me.png b/src/image/images/me.png deleted file mode 100644 index a9888d56f23d340bdac5670ba3cb3fcd5fce4053..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 676 zcmV;V0$crwP)*?3>H;`mw=OyjhDCN@)lzhB@omR72`gj z8Ufac!>a+4gJwJ1JNnt&b&yKD4pn7t@go!826;7q4;wGx)q`;WHY?yAAtD)ogg437_TeCv7Qwhp}ac<^iA5=`L-f zCpNsB9%Fd&2`^{w(%vhC;0eKJN0v$O7^6f|;^@w^484BLgRyHY`WaNAt(>D&$r1Nh zdgI7~{^Tl}p0000< KMNUMnLSTZ8V>877 diff --git a/src/image/images/modify.png b/src/image/images/modify.png deleted file mode 100644 index e72e5e58824bb447277c4c72322fa2903caecf9d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 611 zcmV-p0-XJcP)K4MMzzEleYyGL{t=l5foho-3i?cp^LIF z7!gykNFp#+Rh@!C_MYn}lC*Aur$A|m^ZixdEeRG_7% zN-BwG`&)UUvlJ3Q4{T>hBBE!PF3=Z%R+>u$I8T~9+01#$Q903fknj*RJan1_BAOf= zqB#rZ%C^GOeR|&V^x$4OGXlvkK_LK&qz1XSPE5^*VdeyH`{+V@Q9Na>^Q003B$A3! zpFw#iC^DiY-<28)-&E7=QSj@#^38a1Uo~&G>5MAQ0WpvTlK^5~EutP7ST2jDAm{CP ziN^K)4QHG%Re7wB^~UNJKhpl?KX^fg3XO=!CpKt(9%=mB6kagas^&XJ4Zm?Y6J{i=Uh|mY6x6={*r@0XDqDRxKzdU#h(4ibxu^Q4K>dJwwln|IH3wDjii#8Vm z+|JclI++154eY1~XFLvtQi5wN?>q7;v1M~%h7IiXQviLve}Xb^`pA2(mh5e6M@hIg xvU@ER6#bErb~5?y?w(yt7C(b#o3OaufL~rX0N9^u$Rq#&002ovPDHLkV1i0_5*Yvh diff --git a/src/image/images/password.png b/src/image/images/password.png deleted file mode 100644 index 7d0114675587d4a409c2a2f069d8af32aedbd5f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 481 zcmV<70UrK|P)e@@U;zCe2t`#Xr7ro$R6R-qy zAp`10P*A*f5)F_P@9Q%eeB(cYZuo2HO%|0z?JjN>sW0&kUa_% z6pCghWQ!1;^A|kNg0B-G)<`HE8c5v~GnG73dHB4o$-mE3nX&{-RS8Vkglhrk2Uk1e zNqy^C!Nj`mDmi7KaFO{*s0t$LIF{wj@4F|1Y7wUAa9+tRcMa#);#6H~D<#Gny8XB( z8$5QSC~5}EO76CATHW-;d<87$@(~`CzyRR>djmG&a)JxXM(Y0rOc;dYz!DPs)6`Sq zE1;!3D7By!>?8o&_m6J_(}bP71y?rugC6+`l)ckLNw?(eowJI74FWUSBMM}00000NkvXXu0mjf#-!Tf diff --git a/src/image/images/reset.png b/src/image/images/reset.png deleted file mode 100644 index f1239bb6e8722e09bf962ab4be1fea4b800ccd81..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 725 zcmV;`0xJE9P)%8t&bvUTKe9*@4h={&bY{nH6a5B=D_*=80MT~*yf!1`L8k> zcfvR~4X6gaL1h-dn3-OYhuU8N#fpjNm^KIVcmd;JP0Bme)YoCr`rnV zzQ36yW8)XIyfu@g8P++BF=!C577YPu8vL;S=IcXK^BbJqxcFjhLDFJonC1*zLf=^W z*73)epU@o+sa;Bw=J+%}eRBEl4>rBv*wV`0q$sc2q6KLRAy6-0Mpv#Ozx{|-J<3z> zkR3h-8qh&i`Fi-|rK3-;B>)4Hys6fqSY-JJWZ^7rqm-={WttLVpu4olYSyASco<_` zX{#x_1E5F&*k&nK6r$C`wwAa#D+jS8phP@14sbw zgjn<>f>oZ%3o@rHzwsV}@d@s|GDm;MF7Trcs`5Z0rN-jFPwWM~g$Oi4=lDFsrh)sb z;FbQwPVjLQ3SNm4=u5c$s0%(^q!IAK>d}+@x$k9mo&Ov{1kp#~6}*SWL(mJG2kF~e zS8(}$Tng6FTDm~fdq|j_2V)>chzh}juNOJ-%&S`jD+kc{6E-ce2^b5$0Y8MYy$-8@ zHXRHvGCSSbG)NrZbHiT$<#p=bU3|R`0;D-KLuhKKy4TFrUuT(}{%5;gDBA7zNN9yG7&)@qTxN4A2A~ z24g!hYG(vjfNm8qIXRh#NLKZ#@klHqF&h=uBd7wJ4H)2G8|6NuRJq%S00000NkvXX Hu0mjfC!Jp4 diff --git a/src/image/images/search.png b/src/image/images/search.png deleted file mode 100644 index 0449b835fbc680e0afe485e43bf60fd58730306b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 628 zcmV-)0*n2LP)9U3`vzwpO^YXs$=lSxyycnFK(P)sGra2Kp6iw5= zyk770^qEz#)kUdPx}&P&4 zuIrx=Li3G{jmy<)b%$kH9sqXFOpwdvD1^`lhr{t!Rn-GkRp$Tz9LLcN!#JDGX3Ao* z>?D)PABG7AgTbZ6V$sQDGA~JzgyC?A5JKSd`6!dgR7)fh4!_?Y0{~-zEX%arZl~h$ zIF(AJuC&{2#qD-)mdj<)<#KIGk_56WQ)kYg)9JJrh6$w8>FeQe_;xfJ1q{QeP$+aX z8jU8!V)33J2q_~04giqNW=Db`WF<*@qU$=xvg|d6VXoS2wp)s#+^$JW*xk|Yzoe*Yf{ao)ux%3v@vQPeBWY`(#= z>?6C~z7R$6Bf!ZJ{{smC?9anPyk4(An9XMI2!fDTH`ftR06=P*Mvo_xX9%IAljdk0 z!4v?dfj|J~dH#Z?Y2PQu$2|Z*>n4D0j|Z$)E3WH$Z!{jGdad^NXZ``<824d|ONzY! O0000J%=P)e3E&$Y2!}TEq|qopcf$+(Zz} zATAEpF_8ubgJ^A9O~t$Pdfp}X-o3o%P%SjM!Od@be}4S8*-$RnZ`3lS0!-bhW z_Myv!5ZZKWkJ{l%`Nk z!DAmh_Cd%7tW0h?i5=MB;=>{IWU3JI5P<%Z3iKq)CkX~Ncsv!s@w&B03Ix1^fOil{ z0mtjs|49G<)sM~DrIrgGOYm4?d2JoFM)PhGn@S2BZ{p9!fxw_JkN$AGWTDb`&KhAa00sIlz6*}Y?jFFC=|!m?Ane)F`fCkjfHT~|*Y zJb%YD6lBlDw{{Bvu-ndoQXf00joR0@->YBVO_tAz0O)IBC}myHx{VIs{4YC4Hgh3Y z0RRzvSeeoBAS5RMR0afG(EP6`fZnPv`D$;2O#FRq35vxc<>Ga=D9YQi6R0d%$t z^7*{9p#Ep&VsQ0?z;dzX3QZ<~KMF%nJYj N002ovPDHLkV1j)f2>Ad2 -- Gitee From 68de2b6ca95bae5552193bdf3ed0d7fee00a2edb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <9252971+qq783615077@user.noreply.gitee.com> Date: Wed, 13 Oct 2021 11:40:39 +0000 Subject: [PATCH 22/24] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20sr?= =?UTF-8?q?c/book?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/book/dao/dao/BookDao.java | 107 ---- src/book/dao/dao/BookTypeDao.java | 41 -- src/book/dao/dao/Userdao.java | 26 - src/book/model/.keep | 0 src/book/model/model/Book.java | 108 ---- src/book/model/model/BookType.java | 65 -- src/book/model/model/User.java | 38 -- src/book/util/util/BookUtil.java | 36 -- src/book/util/util/StringUtil.java | 22 - src/book/view/.keep | 0 src/book/view/view/BookAddInterFrame.java | 310 ---------- src/book/view/view/BookManageInterFrame.java | 581 ------------------ src/book/view/view/BookTypeAddInterFrame.java | 168 ----- .../view/view/BookTypeManageInterFrame.java | 352 ----------- src/book/view/view/Gy0409InterFrame.java | 63 -- src/book/view/view/LogFrame.java | 160 ----- src/book/view/view/MainFrame.java | 145 ----- 17 files changed, 2222 deletions(-) delete mode 100644 src/book/dao/dao/BookDao.java delete mode 100644 src/book/dao/dao/BookTypeDao.java delete mode 100644 src/book/dao/dao/Userdao.java delete mode 100644 src/book/model/.keep delete mode 100644 src/book/model/model/Book.java delete mode 100644 src/book/model/model/BookType.java delete mode 100644 src/book/model/model/User.java delete mode 100644 src/book/util/util/BookUtil.java delete mode 100644 src/book/util/util/StringUtil.java delete mode 100644 src/book/view/.keep delete mode 100644 src/book/view/view/BookAddInterFrame.java delete mode 100644 src/book/view/view/BookManageInterFrame.java delete mode 100644 src/book/view/view/BookTypeAddInterFrame.java delete mode 100644 src/book/view/view/BookTypeManageInterFrame.java delete mode 100644 src/book/view/view/Gy0409InterFrame.java delete mode 100644 src/book/view/view/LogFrame.java delete mode 100644 src/book/view/view/MainFrame.java diff --git a/src/book/dao/dao/BookDao.java b/src/book/dao/dao/BookDao.java deleted file mode 100644 index dc36812..0000000 --- a/src/book/dao/dao/BookDao.java +++ /dev/null @@ -1,107 +0,0 @@ -package book.dao; - -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; - -import book.model.Book; -import book.util.StringUtil; - -/** - * 鍥句功Dao绫 - * @author Administrator - * - */ -public class BookDao { - /** - * 鍥句功娣诲姞 - * @param con - * @param book - * @return - * @throws Exception - */ - public int add(Connection con,Book book)throws Exception{ - String sql="insert into dbo.t_book values(null,?,?,?,?,?,?)"; - PreparedStatement pstmt=con.prepareStatement(sql); - pstmt.setString(1, book.getBookName()); - pstmt.setString(2, book.getAuthor()); - pstmt.setString(3, book.getSex()); - pstmt.setFloat(4, book.getPrice()); - pstmt.setInt(5, book.getBookTypeId()); - pstmt.setString(6, book.getBookDesc()); - return pstmt.executeUpdate(); - } - - /** - * 鍥句功淇℃伅鏌ヨ - * @param con - * @param book - * @return - * @throws Exception - */ - public ResultSet list(Connection con,Book book)throws Exception{ - StringBuffer sb=new StringBuffer("select * from dbo.t_book b,dbo.booktype bt where b.bookTypeId=bt.id"); - if(StringUtil.isNotEmpty(book.getBookName())){ - sb.append(" and b.bookName like '%"+book.getBookName()+"%'"); - } - if(StringUtil.isNotEmpty(book.getAuthor())){ - sb.append(" and b.author like '%"+book.getAuthor()+"%'"); - } - if(book.getBookTypeId()!=null && book.getBookTypeId()!=-1){ - sb.append(" and b.bookTypeId="+book.getBookTypeId()); - } - PreparedStatement pstmt=con.prepareStatement(sb.toString()); - return pstmt.executeQuery(); - } - - - /** - * 鍥句功淇℃伅鍒犻櫎 - * @param con - * @param id - * @return - * @throws Exception - */ - public int delete(Connection con,String id)throws Exception{ - String sql="delete from dbo.t_book where id=?"; - PreparedStatement pstmt=con.prepareStatement(sql); - pstmt.setString(1, id); - return pstmt.executeUpdate(); - } - /** - * 鍥句功淇℃伅淇敼 - * @param con - * @param book - * @return - * @throws Exception - */ - public int update(Connection con,Book book)throws Exception{ - String sql="update t_book set bookName=?,author=?,sex=?,price=?,bookDesc=?,bookTypeId=? where id=?"; - PreparedStatement pstmt=con.prepareStatement(sql); - pstmt.setString(1, book.getBookName()); - pstmt.setString(2, book.getAuthor()); - pstmt.setString(3, book.getSex()); - pstmt.setFloat(4, book.getPrice()); - pstmt.setString(5, book.getBookDesc()); - pstmt.setInt(6, book.getBookTypeId()); - pstmt.setInt(7, book.getId()); - return pstmt.executeUpdate(); - } - - /** - * 鎸囧畾鍥句功绫诲埆涓嬫槸鍚﹀瓨鍦ㄥ浘涔 - * @param con - * @param bookTypeId - * @return - * @throws Exception - */ - public boolean existBookByBookTypeId(Connection con,String bookTypeId)throws Exception{ - String sql="select * from dbo.t_book where bookTypeId=?"; - PreparedStatement pstmt=con.prepareStatement(sql); - pstmt.setString(1, bookTypeId); - ResultSet rs=pstmt.executeQuery(); - return rs.next(); - } - - -} diff --git a/src/book/dao/dao/BookTypeDao.java b/src/book/dao/dao/BookTypeDao.java deleted file mode 100644 index b63bb0b..0000000 --- a/src/book/dao/dao/BookTypeDao.java +++ /dev/null @@ -1,41 +0,0 @@ -package book.dao; - -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; - -import book.model.BookType; -import book.util.StringUtil; - -public class BookTypeDao { - - public int add(Connection con,BookType bookType)throws Exception{ - String sql="insert into dbo.booktype values(null,?,?)"; - PreparedStatement pstmt=con.prepareStatement(sql); - pstmt.setString(1, bookType.getBookTypeName()); - pstmt.setString(2, bookType.getBookTypeDesc()); - return pstmt.executeUpdate(); - } - public ResultSet list(Connection con,BookType bookType)throws Exception{ - StringBuffer sb=new StringBuffer("select * from dbo.booktype"); - if(StringUtil.isNotEmpty(bookType.getBookTypeName())){ - sb.append(" and bookTypeName like '%"+bookType.getBookTypeName()+"%'"); - } - PreparedStatement pstmt=con.prepareStatement(sb.toString().replaceFirst("and", "where")); - return pstmt.executeQuery(); - } - public int delete(Connection con,String id)throws Exception{ - String sql="delete from dbo.booktype where id=?"; - PreparedStatement pstmt=con.prepareStatement(sql); - pstmt.setString(1, id); - return pstmt.executeUpdate(); - } - public int update(Connection con,BookType bookType)throws Exception{ - String sql="update dbo.booktype set bookTypeName=?,bookTypeDesc=? where id=?"; - PreparedStatement pstmt=con.prepareStatement(sql); - pstmt.setString(1, bookType.getBookTypeName()); - pstmt.setString(2, bookType.getBookTypeDesc()); - pstmt.setInt(3, bookType.getId()); - return pstmt.executeUpdate(); - } -} diff --git a/src/book/dao/dao/Userdao.java b/src/book/dao/dao/Userdao.java deleted file mode 100644 index a1374f5..0000000 --- a/src/book/dao/dao/Userdao.java +++ /dev/null @@ -1,26 +0,0 @@ -package book.dao; - -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; - -import book.model.User; -public class Userdao { - - public User login(Connection con,User user)throws Exception{ - User resultUser=null; - String sql="select * from dbo.book where userName=? and passWord=?"; - PreparedStatement pstmt=con.prepareStatement(sql); - pstmt.setString(1, user.getUserName()); - pstmt.setString(2, user.getPassWord()); - ResultSet rs=pstmt.executeQuery(); - if(rs.next()) { - resultUser=new User(); - resultUser.setId(rs.getInt("id")); - resultUser.setUserName(rs.getString("userName")); - resultUser.setPassWord(rs.getString("PassWord")); - } - return resultUser; - - } - } diff --git a/src/book/model/.keep b/src/book/model/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/src/book/model/model/Book.java b/src/book/model/model/Book.java deleted file mode 100644 index f2a7956..0000000 --- a/src/book/model/model/Book.java +++ /dev/null @@ -1,108 +0,0 @@ -package book.model; - -public class Book { - - private int id; // 编号 - private String bookName; // 图书名称 - private String author; // 作者 - private String sex; // 性别 - private Float price; // 图书价格 - private Integer bookTypeId; // 图书类别Id - private String bookTypeName; // 图书类名名称 - private String bookDesc; // 备注 - - - - public Book() { - super(); - // TODO Auto-generated constructor stub - } - - - - public Book(String bookName, String author, String sex, Float price, Integer bookTypeId, String bookDesc) { - super(); - this.bookName = bookName; - this.author = author; - this.sex = sex; - this.price = price; - this.bookTypeId = bookTypeId; - this.bookDesc = bookDesc; - } - - - - - public Book(int id, String bookName, String author, String sex, Float price, Integer bookTypeId, String bookDesc) { - super(); - this.id = id; - this.bookName = bookName; - this.author = author; - this.sex = sex; - this.price = price; - this.bookTypeId = bookTypeId; - this.bookDesc = bookDesc; - } - - - - public Book(String bookName, String author, Integer bookTypeId) { - super(); - this.bookName = bookName; - this.author = author; - this.bookTypeId = bookTypeId; - } - - - - public int getId() { - return id; - } - public void setId(int id) { - this.id = id; - } - public String getBookName() { - return bookName; - } - public void setBookName(String bookName) { - this.bookName = bookName; - } - public String getAuthor() { - return author; - } - public void setAuthor(String author) { - this.author = author; - } - public String getSex() { - return sex; - } - public void setSex(String sex) { - this.sex = sex; - } - public Float getPrice() { - return price; - } - public void setPrice(Float price) { - this.price = price; - } - public Integer getBookTypeId() { - return bookTypeId; - } - public void setBookTypeId(Integer bookTypeId) { - this.bookTypeId = bookTypeId; - } - public String getBookTypeName() { - return bookTypeName; - } - public void setBookTypeName(String bookTypeName) { - this.bookTypeName = bookTypeName; - } - public String getBookDesc() { - return bookDesc; - } - public void setBookDesc(String bookDesc) { - this.bookDesc = bookDesc; - } - - -} diff --git a/src/book/model/model/BookType.java b/src/book/model/model/BookType.java deleted file mode 100644 index ac35315..0000000 --- a/src/book/model/model/BookType.java +++ /dev/null @@ -1,65 +0,0 @@ -package book.model; - -/** - * 图书类别实体 - * @author Administrator - * - */ -public class BookType { - - private int id; // 编号 - private String bookTypeName; // 图书类别名称 - private String bookTypeDesc; // 备注 - - - - public BookType() { - super(); - // TODO Auto-generated constructor stub - } - - - public BookType(String bookTypeName, String bookTypeDesc) { - super(); - this.bookTypeName = bookTypeName; - this.bookTypeDesc = bookTypeDesc; - } - - - - - public BookType(int id, String bookTypeName, String bookTypeDesc) { - super(); - this.id = id; - this.bookTypeName = bookTypeName; - this.bookTypeDesc = bookTypeDesc; - } - - - public int getId() { - return id; - } - public void setId(int id) { - this.id = id; - } - public String getBookTypeName() { - return bookTypeName; - } - public void setBookTypeName(String bookTypeName) { - this.bookTypeName = bookTypeName; - } - public String getBookTypeDesc() { - return bookTypeDesc; - } - public void setBookTypeDesc(String bookTypeDesc) { - this.bookTypeDesc = bookTypeDesc; - } - - - @Override - public String toString() { - return bookTypeName; - } - - -} diff --git a/src/book/model/model/User.java b/src/book/model/model/User.java deleted file mode 100644 index 2b63cb1..0000000 --- a/src/book/model/model/User.java +++ /dev/null @@ -1,38 +0,0 @@ -package book.model; - -public class User { - - private int id; - private String userName; - private String passWord; - - public User() { - super(); - } - - public User(String userName,String passWord) { - super(); - this.userName=userName; - this.passWord=passWord; - } - public int getId() { - return id; - } - public void setId(int id) { - this.id = id; - } - public String getUserName() { - return userName; - } - public void setUserName(String userName) { - this.userName = userName; - } - public String getPassWord() { - return passWord; - } - public void setPassWord(String passWord) { - this.passWord = passWord; - } - - - } \ No newline at end of file diff --git a/src/book/util/util/BookUtil.java b/src/book/util/util/BookUtil.java deleted file mode 100644 index 5c494b7..0000000 --- a/src/book/util/util/BookUtil.java +++ /dev/null @@ -1,36 +0,0 @@ -package book.util; - - -import java.sql.Connection; -import java.sql.DriverManager; -public class BookUtil { - - private String JdbcName="com.microsoft.sqlserver.jdbc.SQLServerDriver"; - private String libUrl="jdbc:sqlserver://localhost:1433;DatabaseName=Book"; - private String UserName="sa"; - private String PassWord="123456"; - - public Connection getCon()throws Exception{ - Class.forName(JdbcName); - Connection con=DriverManager.getConnection(libUrl,UserName,PassWord); - return con; - } - public void closeCon(Connection con)throws Exception{ - if(con!=null) { - con.close(); - } - } - public static void main(String[] args) { - BookUtil bookUtil=new BookUtil(); - try { - bookUtil.getCon(); - System.out.println("数据库连接成功"); - - }catch(Exception e) { - e.printStackTrace(); - System.out.println("数据库连接失败"); - } - - } - -} \ No newline at end of file diff --git a/src/book/util/util/StringUtil.java b/src/book/util/util/StringUtil.java deleted file mode 100644 index c7f4c8e..0000000 --- a/src/book/util/util/StringUtil.java +++ /dev/null @@ -1,22 +0,0 @@ -package book.util; - -public class StringUtil { - - public static boolean isEmpty(String str) { - if(str==null||"".equals(str.trim())) { - return true; - } - else { - return false; - } - } - - public static boolean isNotEmpty(String str) { - if(str!=null&&!"".equals(str.trim())) { - return true; - } - else { - return false; - } - } - } \ No newline at end of file diff --git a/src/book/view/.keep b/src/book/view/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/src/book/view/view/BookAddInterFrame.java b/src/book/view/view/BookAddInterFrame.java deleted file mode 100644 index f640d4a..0000000 --- a/src/book/view/view/BookAddInterFrame.java +++ /dev/null @@ -1,310 +0,0 @@ -package book.view; - -import java.awt.EventQueue; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.sql.Connection; -import java.sql.ResultSet; - -import javax.swing.ButtonGroup; -import javax.swing.GroupLayout; -import javax.swing.GroupLayout.Alignment; -import javax.swing.ImageIcon; -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JInternalFrame; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JRadioButton; -import javax.swing.JTextArea; -import javax.swing.JTextField; -import javax.swing.LayoutStyle.ComponentPlacement; -import javax.swing.border.LineBorder; - -import book.dao.BookDao; -import book.dao.BookTypeDao; -import book.model.Book; -import book.model.BookType; -import book.util.BookUtil; -import book.util.StringUtil; - -public class BookAddInterFrame extends JInternalFrame { - private JTextField bookNameTxt; - private JTextField authorTxt; - private final ButtonGroup buttonGroup = new ButtonGroup(); - private JTextField priceTxt; - private JComboBox bookTypeJcb; - private JTextArea bookDescTxt; - private JRadioButton manJrb; - private JRadioButton femaleJrb; - - private BookUtil bookUtil=new BookUtil(); - private BookTypeDao bookTypeDao=new BookTypeDao(); - private BookDao bookDao=new BookDao(); - - /** - * Launch the application. - */ - public static void main(String[] args) { - EventQueue.invokeLater(new Runnable() { - public void run() { - try { - BookAddInterFrame frame = new BookAddInterFrame(); - frame.setVisible(true); - } catch (Exception e) { - e.printStackTrace(); - } - } - }); - } - - /** - * Create the frame. - */ - public BookAddInterFrame() { - setClosable(true); - setIconifiable(true); - setTitle("\u56FE\u4E66\u6DFB\u52A0"); - setBounds(100, 100, 445, 467); - - JLabel label = new JLabel("\u56FE\u4E66\u540D\u79F0\uFF1A"); - - bookNameTxt = new JTextField(); - bookNameTxt.setColumns(10); - - JLabel label_1 = new JLabel("\u56FE\u4E66\u4F5C\u8005\uFF1A"); - - authorTxt = new JTextField(); - authorTxt.setColumns(10); - - JLabel label_2 = new JLabel("\u4F5C\u8005\u6027\u522B\uFF1A"); - - manJrb = new JRadioButton("\u7537"); - buttonGroup.add(manJrb); - manJrb.setSelected(true); - - femaleJrb = new JRadioButton("\u5973"); - buttonGroup.add(femaleJrb); - - JLabel label_3 = new JLabel("\u56FE\u4E66\u4EF7\u683C\uFF1A"); - - priceTxt = new JTextField(); - priceTxt.setColumns(10); - - JLabel label_4 = new JLabel("\u56FE\u4E66\u63CF\u8FF0\uFF1A"); - - bookDescTxt = new JTextArea(); - - JLabel label_5 = new JLabel("\u56FE\u4E66\u7C7B\u522B\uFF1A"); - - bookTypeJcb = new JComboBox(); - - JButton button = new JButton("\u6DFB\u52A0"); - button.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - bookAddActionPerformed(e); - } - }); - - button.setIcon(new ImageIcon(BookAddInterFrame.class.getResource("/images/add.png"))); - - JButton button_1 = new JButton("\u91CD\u7F6E"); - button_1.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - resetValueActionPerformed(e); - } - }); - - button_1.setIcon(new ImageIcon(BookAddInterFrame.class.getResource("/images/reset.png"))); - GroupLayout groupLayout = new GroupLayout(getContentPane()); - groupLayout.setHorizontalGroup( - groupLayout.createParallelGroup(Alignment.LEADING) - .addGroup(groupLayout.createSequentialGroup() - .addGap(33) - .addGroup(groupLayout.createParallelGroup(Alignment.LEADING) - .addComponent(label) - .addComponent(label_2) - .addComponent(label_5) - .addComponent(label_4)) - .addPreferredGap(ComponentPlacement.RELATED) - .addGroup(groupLayout.createParallelGroup(Alignment.LEADING) - .addGroup(groupLayout.createSequentialGroup() - .addGroup(groupLayout.createParallelGroup(Alignment.LEADING) - .addComponent(manJrb) - .addComponent(bookNameTxt, GroupLayout.DEFAULT_SIZE, 77, Short.MAX_VALUE) - .addComponent(button, Alignment.TRAILING)) - .addPreferredGap(ComponentPlacement.RELATED) - .addGroup(groupLayout.createParallelGroup(Alignment.LEADING) - .addGroup(groupLayout.createSequentialGroup() - .addComponent(femaleJrb) - .addGap(27) - .addGroup(groupLayout.createParallelGroup(Alignment.LEADING) - .addGroup(groupLayout.createSequentialGroup() - .addComponent(label_1) - .addGap(18) - .addComponent(authorTxt, GroupLayout.DEFAULT_SIZE, 66, Short.MAX_VALUE)) - .addGroup(groupLayout.createSequentialGroup() - .addPreferredGap(ComponentPlacement.RELATED) - .addComponent(label_3) - .addGap(18) - .addComponent(priceTxt))) - .addGap(49)) - .addGroup(Alignment.TRAILING, groupLayout.createSequentialGroup() - .addComponent(button_1) - .addGap(56)))) - .addGroup(groupLayout.createSequentialGroup() - .addComponent(bookDescTxt, GroupLayout.PREFERRED_SIZE, 294, GroupLayout.PREFERRED_SIZE) - .addContainerGap()) - .addGroup(groupLayout.createSequentialGroup() - .addComponent(bookTypeJcb, GroupLayout.PREFERRED_SIZE, 173, GroupLayout.PREFERRED_SIZE) - .addContainerGap()))) - ); - groupLayout.setVerticalGroup( - groupLayout.createParallelGroup(Alignment.LEADING) - .addGroup(groupLayout.createSequentialGroup() - .addGap(42) - .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE) - .addComponent(authorTxt, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) - .addComponent(label_1) - .addComponent(label) - .addComponent(bookNameTxt, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) - .addGap(29) - .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE) - .addComponent(priceTxt, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) - .addComponent(label_3) - .addComponent(label_2) - .addComponent(manJrb) - .addComponent(femaleJrb)) - .addGap(33) - .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE) - .addComponent(label_5) - .addComponent(bookTypeJcb, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) - .addGap(30) - .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE) - .addComponent(label_4) - .addComponent(bookDescTxt, GroupLayout.PREFERRED_SIZE, 137, GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(ComponentPlacement.RELATED, 33, Short.MAX_VALUE) - .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE) - .addComponent(button_1) - .addComponent(button)) - .addGap(42)) - ); - getContentPane().setLayout(groupLayout); - fillBookType(); - // 璁剧疆鏂囨湰鍩熻竟妗 - bookDescTxt.setBorder(new LineBorder(new java.awt.Color(127,157,185), 1, false)); - - - - } - - - - - - /** - * 閲嶇疆浜嬩欢澶勭悊 - * @param e - */ - private void resetValueActionPerformed(ActionEvent e) { - this.resetValue(); - } - - - /** - * 鍥句功娣诲姞浜嬩欢澶勭悊 - * @param e - */ - private void bookAddActionPerformed(ActionEvent evt) { - String bookName=this.bookNameTxt.getText(); - String author=this.authorTxt.getText(); - String price=this.priceTxt.getText(); - String bookDesc=this.bookDescTxt.getText(); - - if(StringUtil.isEmpty(bookName)){ - JOptionPane.showMessageDialog(null, "鍥句功鍚嶇О涓嶈兘涓虹┖锛"); - return; - } - - if(StringUtil.isEmpty(author)){ - JOptionPane.showMessageDialog(null, "鍥句功浣滆呬笉鑳戒负绌猴紒"); - return; - } - - if(StringUtil.isEmpty(price)){ - JOptionPane.showMessageDialog(null, "鍥句功浠锋牸涓嶈兘涓虹┖锛"); - return; - } - - String sex=""; - if(manJrb.isSelected()){ - sex="鐢"; - }else if(femaleJrb.isSelected()){ - sex="濂"; - } - - BookType bookType=(BookType) bookTypeJcb.getSelectedItem(); - int bookTypeId=bookType.getId(); - - Book book=new Book(bookName,author, sex, Float.parseFloat(price) , bookTypeId, bookDesc); - - Connection con=null; - try{ - con=bookUtil.getCon(); - int addNum=bookDao.add(con, book); - if(addNum==1){ - JOptionPane.showMessageDialog(null, "鍥句功娣诲姞鎴愬姛锛"); - resetValue(); - }else{ - JOptionPane.showMessageDialog(null, "鍥句功娣诲姞澶辫触锛"); - } - }catch(Exception e){ - e.printStackTrace(); - JOptionPane.showMessageDialog(null, "鍥句功娣诲姞澶辫触锛"); - }finally{ - try { - bookUtil.closeCon(con); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - } - - - /** - * 閲嶇疆琛ㄥ崟 - */ - private void resetValue(){ - this.bookNameTxt.setText(""); - this.authorTxt.setText(""); - this.priceTxt.setText(""); - this.manJrb.setSelected(true); - this.bookDescTxt.setText(""); - if(this.bookTypeJcb.getItemCount()>0){ - this.bookTypeJcb.setSelectedIndex(0); - } - } - /** - * 鍒濆鍖栧浘涔︾被鍒笅鎷夋 - */ - private void fillBookType(){ - Connection con=null; - BookType bookType=null; - try{ - con=bookUtil.getCon(); - ResultSet rs=bookTypeDao.list(con, new BookType()); - while(rs.next()){ - bookType=new BookType(); - bookType.setId(rs.getInt("id")); - bookType.setBookTypeName(rs.getString("bookTypeName")); - this.bookTypeJcb.addItem(bookType); - } - }catch(Exception e){ - e.printStackTrace(); - }finally{ - - } - } - -} diff --git a/src/book/view/view/BookManageInterFrame.java b/src/book/view/view/BookManageInterFrame.java deleted file mode 100644 index 916f5b9..0000000 --- a/src/book/view/view/BookManageInterFrame.java +++ /dev/null @@ -1,581 +0,0 @@ -package book.view; - -import java.awt.EventQueue; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.sql.Connection; -import java.sql.ResultSet; -import java.util.Vector; - -import javax.swing.ButtonGroup; -import javax.swing.GroupLayout; -import javax.swing.GroupLayout.Alignment; -import javax.swing.ImageIcon; -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JInternalFrame; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JRadioButton; -import javax.swing.JScrollPane; -import javax.swing.JTable; -import javax.swing.JTextArea; -import javax.swing.JTextField; -import javax.swing.LayoutStyle.ComponentPlacement; -import javax.swing.border.LineBorder; -import javax.swing.border.TitledBorder; -import javax.swing.table.DefaultTableModel; - -import book.dao.BookDao; -import book.dao.BookTypeDao; -import book.model.Book; -import book.model.BookType; -import book.util.BookUtil; -import book.util.StringUtil; - -import java.awt.event.ActionListener; -import java.awt.event.ActionEvent; -import net.miginfocom.swing.MigLayout; -import javax.swing.JRadioButton; -import javax.swing.ButtonGroup; - -public class BookManageInterFrame extends JInternalFrame { - private JTable bookTable; - private JTextField s_bookNameTxt; - private JTextField s_authorTxt; - private JComboBox s_bookTypeJcb; - private JRadioButton manJrb ; - private JRadioButton femaleJrb ; - private JTextArea bookDescTxt; - private JComboBox bookTypeJcb ; - - private BookUtil bookUtil=new BookUtil(); - private BookTypeDao bookTypeDao=new BookTypeDao(); - private BookDao bookDao=new BookDao(); - private JTextField idTxt; - private JTextField bookNameTxt; - private final ButtonGroup buttonGroup = new ButtonGroup(); - private JTextField priceTxt; - private JTextField authorTxt; - - /** - * Launch the application. - */ - public static void main(String[] args) { - EventQueue.invokeLater(new Runnable() { - public void run() { - try { - BookManageInterFrame frame = new BookManageInterFrame(); - frame.setVisible(true); - } catch (Exception e) { - e.printStackTrace(); - } - } - }); - } - - /** - * Create the frame. - */ - public BookManageInterFrame() { - setClosable(true); - setIconifiable(true); - setTitle("\u56FE\u4E66\u7BA1\u7406"); - setBounds(100, 100, 646, 517); - - JScrollPane scrollPane = new JScrollPane(); - - JPanel panel = new JPanel(); - panel.setBorder(new TitledBorder(null, "\u641C\u7D22\u6761\u4EF6", TitledBorder.LEADING, TitledBorder.TOP, null, null)); - - JPanel panel_1 = new JPanel(); - panel_1.setBorder(new TitledBorder(null, "\u8868\u5355\u64CD\u4F5C", TitledBorder.LEADING, TitledBorder.TOP, null, null)); - GroupLayout groupLayout = new GroupLayout(getContentPane()); - groupLayout.setHorizontalGroup( - groupLayout.createParallelGroup(Alignment.LEADING) - .addGroup(groupLayout.createSequentialGroup() - .addContainerGap() - .addGroup(groupLayout.createParallelGroup(Alignment.TRAILING) - .addComponent(panel_1, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGroup(Alignment.LEADING, groupLayout.createParallelGroup(Alignment.LEADING, false) - .addComponent(panel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(scrollPane))) - .addContainerGap(66, Short.MAX_VALUE)) - ); - groupLayout.setVerticalGroup( - groupLayout.createParallelGroup(Alignment.LEADING) - .addGroup(groupLayout.createSequentialGroup() - .addGap(28) - .addComponent(panel, GroupLayout.PREFERRED_SIZE, 65, GroupLayout.PREFERRED_SIZE) - .addGap(18) - .addComponent(scrollPane, GroupLayout.PREFERRED_SIZE, 116, GroupLayout.PREFERRED_SIZE) - .addGap(18) - .addComponent(panel_1, GroupLayout.DEFAULT_SIZE, 203, Short.MAX_VALUE) - .addContainerGap()) - ); - - JLabel lblNewLabel = new JLabel("\u7F16\u53F7\uFF1A"); - - idTxt = new JTextField(); - idTxt.setEditable(false); - idTxt.setColumns(10); - - JLabel lblNewLabel_1 = new JLabel("\u56FE\u4E66\u540D\u79F0\uFF1A"); - - bookNameTxt = new JTextField(); - bookNameTxt.setColumns(10); - - JLabel label_3 = new JLabel("\u4F5C\u8005\u6027\u522B\uFF1A"); - - manJrb = new JRadioButton("\u7537"); - buttonGroup.add(manJrb); - manJrb.setSelected(true); - - femaleJrb = new JRadioButton("\u5973"); - buttonGroup.add(femaleJrb); - - JLabel label_4 = new JLabel("\u4EF7\u683C\uFF1A"); - - priceTxt = new JTextField(); - priceTxt.setColumns(10); - - JLabel lblNewLabel_2 = new JLabel("\u56FE\u4E66\u4F5C\u8005\uFF1A"); - - authorTxt = new JTextField(); - authorTxt.setColumns(10); - - JLabel label_5 = new JLabel("\u56FE\u4E66\u7C7B\u522B\uFF1A"); - - bookTypeJcb = new JComboBox(); - - JLabel label_6 = new JLabel("\u56FE\u4E66\u63CF\u8FF0\uFF1A"); - - bookDescTxt = new JTextArea(); - - JButton button_1 = new JButton("\u4FEE\u6539"); - button_1.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent evt) { - bookUpdateActionPerformed(evt); - } - }); - ; - button_1.setIcon(new ImageIcon(BookManageInterFrame.class.getResource("/images/modify.png"))); - - JButton button_2 = new JButton("\u5220\u9664"); - button_2.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent evt) { - bookDeleteActionPerformed(evt); - } - }); - ; - button_2.setIcon(new ImageIcon(BookManageInterFrame.class.getResource("/images/delete.png"))); - GroupLayout gl_panel_1 = new GroupLayout(panel_1); - gl_panel_1.setHorizontalGroup( - gl_panel_1.createParallelGroup(Alignment.LEADING) - .addGroup(gl_panel_1.createSequentialGroup() - .addGap(19) - .addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING) - .addGroup(gl_panel_1.createSequentialGroup() - .addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING, false) - .addGroup(gl_panel_1.createSequentialGroup() - .addComponent(label_4) - .addPreferredGap(ComponentPlacement.RELATED) - .addComponent(priceTxt)) - .addGroup(gl_panel_1.createSequentialGroup() - .addComponent(lblNewLabel) - .addPreferredGap(ComponentPlacement.RELATED) - .addComponent(idTxt, GroupLayout.PREFERRED_SIZE, 87, GroupLayout.PREFERRED_SIZE))) - .addGap(26) - .addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING, false) - .addGroup(gl_panel_1.createSequentialGroup() - .addComponent(lblNewLabel_1) - .addPreferredGap(ComponentPlacement.RELATED) - .addComponent(bookNameTxt, GroupLayout.PREFERRED_SIZE, 85, GroupLayout.PREFERRED_SIZE)) - .addGroup(gl_panel_1.createSequentialGroup() - .addComponent(lblNewLabel_2) - .addPreferredGap(ComponentPlacement.RELATED) - .addComponent(authorTxt))) - .addGap(26) - .addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING, false) - .addGroup(gl_panel_1.createSequentialGroup() - .addComponent(label_3) - .addPreferredGap(ComponentPlacement.UNRELATED) - .addComponent(manJrb) - .addPreferredGap(ComponentPlacement.RELATED) - .addComponent(femaleJrb)) - .addGroup(gl_panel_1.createSequentialGroup() - .addComponent(label_5) - .addPreferredGap(ComponentPlacement.UNRELATED) - .addComponent(bookTypeJcb, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) - .addGroup(gl_panel_1.createParallelGroup(Alignment.TRAILING) - .addGroup(Alignment.LEADING, gl_panel_1.createSequentialGroup() - .addGap(25) - .addComponent(button_1) - .addPreferredGap(ComponentPlacement.RELATED, 289, Short.MAX_VALUE) - .addComponent(button_2)) - .addGroup(Alignment.LEADING, gl_panel_1.createSequentialGroup() - .addComponent(label_6) - .addPreferredGap(ComponentPlacement.UNRELATED) - .addComponent(bookDescTxt, GroupLayout.DEFAULT_SIZE, 398, Short.MAX_VALUE)))) - .addGap(88)) - ); - gl_panel_1.setVerticalGroup( - gl_panel_1.createParallelGroup(Alignment.LEADING) - .addGroup(gl_panel_1.createSequentialGroup() - .addGap(21) - .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE) - .addComponent(lblNewLabel) - .addComponent(idTxt, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) - .addComponent(lblNewLabel_1) - .addComponent(bookNameTxt, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) - .addComponent(label_3) - .addComponent(manJrb) - .addComponent(femaleJrb)) - .addGap(18) - .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE) - .addComponent(label_4) - .addComponent(priceTxt, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) - .addComponent(lblNewLabel_2) - .addComponent(authorTxt, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) - .addComponent(label_5) - .addComponent(bookTypeJcb, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) - .addGap(18) - .addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING) - .addComponent(label_6) - .addComponent(bookDescTxt, GroupLayout.DEFAULT_SIZE, 54, Short.MAX_VALUE)) - .addGap(18) - .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE) - .addComponent(button_1) - .addComponent(button_2)) - .addContainerGap()) - ); - panel_1.setLayout(gl_panel_1); - - JLabel label = new JLabel("\u56FE\u4E66\u540D\u79F0\uFF1A"); - - s_bookNameTxt = new JTextField(); - s_bookNameTxt.setColumns(10); - - JLabel label_1 = new JLabel("\u56FE\u4E66\u4F5C\u8005\uFF1A"); - - s_authorTxt = new JTextField(); - s_authorTxt.setColumns(10); - - JLabel label_2 = new JLabel("\u56FE\u4E66\u7C7B\u522B\uFF1A"); - - s_bookTypeJcb = new JComboBox(); - - JButton button = new JButton("\u67E5\u8BE2"); - button.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - bookSearchActionPerformed(e); - } - }); - ; - button.setIcon(new ImageIcon(BookManageInterFrame.class.getResource("/images/search.png"))); - GroupLayout gl_panel = new GroupLayout(panel); - gl_panel.setHorizontalGroup( - gl_panel.createParallelGroup(Alignment.LEADING) - .addGroup(gl_panel.createSequentialGroup() - .addGap(19) - .addComponent(label) - .addPreferredGap(ComponentPlacement.RELATED) - .addComponent(s_bookNameTxt, GroupLayout.PREFERRED_SIZE, 77, GroupLayout.PREFERRED_SIZE) - .addGap(18) - .addComponent(label_1) - .addPreferredGap(ComponentPlacement.RELATED) - .addComponent(s_authorTxt, GroupLayout.PREFERRED_SIZE, 74, GroupLayout.PREFERRED_SIZE) - .addPreferredGap(ComponentPlacement.UNRELATED) - .addComponent(label_2) - .addPreferredGap(ComponentPlacement.RELATED) - .addComponent(s_bookTypeJcb, GroupLayout.PREFERRED_SIZE, 78, GroupLayout.PREFERRED_SIZE) - .addGap(18) - .addComponent(button) - .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - ); - gl_panel.setVerticalGroup( - gl_panel.createParallelGroup(Alignment.TRAILING) - .addGroup(gl_panel.createSequentialGroup() - .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGroup(gl_panel.createParallelGroup(Alignment.BASELINE) - .addComponent(label) - .addComponent(s_bookNameTxt, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) - .addComponent(label_1) - .addComponent(s_authorTxt, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) - .addComponent(label_2) - .addComponent(s_bookTypeJcb, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) - .addComponent(button)) - .addGap(16)) - ); - panel.setLayout(gl_panel); - - bookTable = new JTable(); - bookTable.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent met) { - bookTableMousePressed(met); - } - }); - ; - scrollPane.setViewportView(bookTable); - bookTable.setModel(new DefaultTableModel( - new Object[][] { - }, - new String[] { - "\u7F16\u53F7", "\u56FE\u4E66\u540D\u79F0", "\u56FE\u4E66\u4F5C\u8005", "\u4F5C\u8005\u6027\u522B", "\u56FE\u4E66\u4EF7\u683C", "\u56FE\u4E66\u63CF\u8FF0", "\u56FE\u4E66\u7C7B\u522B" - } - ) { - boolean[] columnEditables = new boolean[] { - false, false, false, false, false, false, false - }; - public boolean isCellEditable(int row, int column) { - return columnEditables[column]; - } - }); - bookTable.getColumnModel().getColumn(5).setPreferredWidth(119); - getContentPane().setLayout(groupLayout); - - // 璁剧疆鏂囨湰鍩熻竟妗 - bookDescTxt.setBorder(new LineBorder(new java.awt.Color(127,157,185), 1, false)); - - - this.fillBookType("search"); - this.fillBookType("modify"); - this.fillTable(new Book()); - } - /** - * 鍥句功鍒犻櫎浜嬩欢澶勭悊 - * @param evt - */ - private void bookDeleteActionPerformed(ActionEvent evt) { - String id=idTxt.getText(); - if(StringUtil.isEmpty(id)){ - JOptionPane.showMessageDialog(null, "璇烽夋嫨瑕佸垹闄ょ殑璁板綍"); - return; - } - int n=JOptionPane.showConfirmDialog(null, "纭畾瑕佸垹闄よ璁板綍鍚楋紵"); - if(n==0){ - Connection con=null; - try{ - con=bookUtil.getCon(); - int deleteNum=bookDao.delete(con, id); - if(deleteNum==1){ - JOptionPane.showMessageDialog(null, "鍒犻櫎鎴愬姛"); - this.resetValue(); - this.fillTable(new Book()); - }else{ - JOptionPane.showMessageDialog(null, "鍒犻櫎澶辫触"); - } - }catch(Exception e){ - e.printStackTrace(); - JOptionPane.showMessageDialog(null, "鍒犻櫎澶辫触"); - }finally{ - try { - bookUtil.closeCon(con); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - } - } - /** - * 鍥句功淇敼浜嬩欢澶勭悊 - * @param evt - */ - private void bookUpdateActionPerformed(ActionEvent evt) { - String id=this.idTxt.getText(); - if(StringUtil.isEmpty(id)){ - JOptionPane.showMessageDialog(null, "璇烽夋嫨瑕佷慨鏀圭殑璁板綍"); - return; - } - - String bookName=this.bookNameTxt.getText(); - String author=this.authorTxt.getText(); - String price=this.priceTxt.getText(); - String bookDesc=this.bookDescTxt.getText(); - - if(StringUtil.isEmpty(bookName)){ - JOptionPane.showMessageDialog(null, "鍥句功鍚嶇О涓嶈兘涓虹┖锛"); - return; - } - - if(StringUtil.isEmpty(author)){ - JOptionPane.showMessageDialog(null, "鍥句功浣滆呬笉鑳戒负绌猴紒"); - return; - } - - if(StringUtil.isEmpty(price)){ - JOptionPane.showMessageDialog(null, "鍥句功浠锋牸涓嶈兘涓虹┖锛"); - return; - } - - String sex=""; - if(manJrb.isSelected()){ - sex="鐢"; - }else if(femaleJrb.isSelected()){ - sex="濂"; - } - - BookType bookType=(BookType) bookTypeJcb.getSelectedItem(); - int bookTypeId=bookType.getId(); - - Book book=new Book(Integer.parseInt(id), bookName, author, sex, Float.parseFloat(price), bookTypeId, bookDesc); - - Connection con=null; - try{ - con=bookUtil.getCon(); - int addNum=bookDao.update(con, book); - if(addNum==1){ - JOptionPane.showMessageDialog(null, "鍥句功淇敼鎴愬姛锛"); - resetValue(); - this.fillTable(new Book()); - }else{ - JOptionPane.showMessageDialog(null, "鍥句功淇敼澶辫触锛"); - } - }catch(Exception e){ - e.printStackTrace(); - JOptionPane.showMessageDialog(null, "鍥句功淇敼澶辫触锛"); - }finally{ - try { - bookUtil.closeCon(con); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - } - - /** - * 閲嶇疆琛ㄥ崟 - */ - private void resetValue(){ - this.idTxt.setText(""); - this.bookNameTxt.setText(""); - this.authorTxt.setText(""); - this.priceTxt.setText(""); - this.manJrb.setSelected(true); - this.bookDescTxt.setText(""); - if(this.bookTypeJcb.getItemCount()>0){ - this.bookTypeJcb.setSelectedIndex(0); - } - } - - /** - * 琛ㄦ牸琛岀偣鍑讳簨浠跺鐞 - * @param met - */ - private void bookTableMousePressed(MouseEvent met) { - int row=this.bookTable.getSelectedRow(); - this.idTxt.setText((String)bookTable.getValueAt(row, 0)); - this.bookNameTxt.setText((String)bookTable.getValueAt(row, 1)); - this.authorTxt.setText((String)bookTable.getValueAt(row, 2)); - String sex=(String)bookTable.getValueAt(row, 3); - if("鐢".equals(sex)){ - this.manJrb.setSelected(true); - }else if("濂".equals(sex)){ - this.femaleJrb.setSelected(true); - } - this.priceTxt.setText((Float)bookTable.getValueAt(row, 4)+""); - this.bookDescTxt.setText((String)bookTable.getValueAt(row, 5)); - String bookTypeName=(String)this.bookTable.getValueAt(row, 6); - int n=this.bookTypeJcb.getItemCount(); - for(int i=0;i Date: Wed, 13 Oct 2021 11:42:06 +0000 Subject: [PATCH 23/24] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20Dormitory?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Dormitory/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/Dormitory/.keep diff --git a/src/Dormitory/.keep b/src/Dormitory/.keep new file mode 100644 index 0000000..e69de29 -- Gitee From d86b736a7d05bae374e1922c049feb95f566e1d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <9252971+qq783615077@user.noreply.gitee.com> Date: Wed, 13 Oct 2021 12:04:12 +0000 Subject: [PATCH 24/24] Dormitory --- src/Calculator.java | 118 +++++++++++++++ src/Enterdormitoryinformation.java | 177 ++++++++++++++++++++++ src/Inputsg.java | 150 ++++++++++++++++++ src/Interface.java | 147 ++++++++++++++++++ src/Menu.java | 174 +++++++++++++++++++++ src/Modifylfz.java | 207 +++++++++++++++++++++++++ src/Modifysg.java | 225 +++++++++++++++++++++++++++ src/Modifystudent.java | 236 +++++++++++++++++++++++++++++ src/Other.java | 47 ++++++ src/Querydormitoryinformation.java | 197 ++++++++++++++++++++++++ src/Querylfz.java | 137 +++++++++++++++++ src/Querysg.java | 169 +++++++++++++++++++++ src/Querystudent.java | 176 +++++++++++++++++++++ src/Quitsg.java | 165 ++++++++++++++++++++ src/Studentcheckin.java | 199 ++++++++++++++++++++++++ src/Studentmoveout.java | 205 +++++++++++++++++++++++++ 16 files changed, 2729 insertions(+) create mode 100644 src/Calculator.java create mode 100644 src/Enterdormitoryinformation.java create mode 100644 src/Inputsg.java create mode 100644 src/Interface.java create mode 100644 src/Menu.java create mode 100644 src/Modifylfz.java create mode 100644 src/Modifysg.java create mode 100644 src/Modifystudent.java create mode 100644 src/Other.java create mode 100644 src/Querydormitoryinformation.java create mode 100644 src/Querylfz.java create mode 100644 src/Querysg.java create mode 100644 src/Querystudent.java create mode 100644 src/Quitsg.java create mode 100644 src/Studentcheckin.java create mode 100644 src/Studentmoveout.java diff --git a/src/Calculator.java b/src/Calculator.java new file mode 100644 index 0000000..72f6c5b --- /dev/null +++ b/src/Calculator.java @@ -0,0 +1,118 @@ +package Dormitory; +import java.awt.*; +import java.awt.event.*; +import javax.swing.*; + + + +public class Calculator extends JFrame implements ActionListener { + + + + private class WindowCloser extends WindowAdapter { + public void windowClosing(WindowEvent we) { + System.exit(0); + } + } + + int i; + + private final String[] str = { "7", "8", "9", "/", "4", "5", "6", "*", "1", + "2", "3", "-", ".", "0", "=", "+" }; + + JButton[] buttons = new JButton[str.length]; + + JButton reset = new JButton("CE"); + + JTextField display = new JTextField("0"); + + + public Calculator() { + super("计算器"); + setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + + JPanel panel1 = new JPanel(new GridLayout(4, 4)); + + for (i = 0; i < str.length; i++) { + buttons[i] = new JButton(str[i]); + panel1.add(buttons[i]); + } + JPanel panel2 = new JPanel(new BorderLayout()); + + panel2.add("Center", display); + panel2.add("East", reset); + + getContentPane().setLayout(new BorderLayout()); + getContentPane().add("North", panel2); + getContentPane().add("Center", panel1); + + for (i = 0; i < str.length; i++) + buttons[i].addActionListener(this); + + reset.addActionListener(this); + + display.addActionListener(this); + + addWindowListener(new WindowCloser()); + + setSize(900, 800); + + setVisible(true); + + pack(); + } + + public void actionPerformed(ActionEvent e) { + Object target = e.getSource(); + String label = e.getActionCommand(); + if (target == reset) + handleReset(); + else if ("0123456789.".indexOf(label) > 0) + handleNumber(label); + else + handleOperator(label); + } + + boolean isFirstDigit = true; + + public void handleNumber(String key) { + if (isFirstDigit) + display.setText(key); + else if ((key.equals(".")) && (display.getText().indexOf(".") < 0)) + display.setText(display.getText() + "."); + else if (!key.equals(".")) + display.setText(display.getText() + key); + isFirstDigit = false; + } + + + public void handleReset() { + display.setText("0"); + isFirstDigit = true; + operator = "="; + } + + double number = 0.0; + String operator = "="; + + + public void handleOperator(String key) { + if (operator.equals("+")) + number += Double.valueOf(display.getText()); + else if (operator.equals("-")) + number -= Double.valueOf(display.getText()); + else if (operator.equals("*")) + number *= Double.valueOf(display.getText()); + else if (operator.equals("/")) + number /= Double.valueOf(display.getText()); + else if (operator.equals("=")) + number = Double.valueOf(display.getText()); + display.setText(String.valueOf(number)); + operator = key; + isFirstDigit = true; + } + + public static void main(String[] args) { + new Calculator(); + } +} \ No newline at end of file diff --git a/src/Enterdormitoryinformation.java b/src/Enterdormitoryinformation.java new file mode 100644 index 0000000..957dcfe --- /dev/null +++ b/src/Enterdormitoryinformation.java @@ -0,0 +1,177 @@ +package Dormitory; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseWheelListener; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.Date; +import java.util.Locale; + +import javax.swing.ButtonGroup; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JTextField; + + + +public class Enterdormitoryinformation extends JFrame implements ActionListener{ + private JComboBox jbox = new JComboBox(); + private JComboBox jbox1 = new JComboBox(); + final JButton b1 = new JButton(); + final JButton b2 = new JButton(); + final JTextField sd = new JTextField(); + final JTextField sd1 = new JTextField(); + final JTextField sd2 = new JTextField(); + final JTextField sd3 = new JTextField(); + final JTextField gy1 = new JTextField(); + final JTextField lk = new JTextField(); + Statement stmt = null; + Statement st = null; + ResultSet rs = null; + String p1=""; + String p2=""; + @SuppressWarnings("unused") + private Date date=new Date(); + /** + * Launch the application + * @param args + */ + public static void main(String args[]) { + try { + Enterdormitoryinformation frame = new Enterdormitoryinformation(); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * Create the frame + */ + public Enterdormitoryinformation() { + super("寝室信息录入"); + getContentPane().setLayout(null); + setBounds(100, 100, 284, 450); + + + final JLabel label = new JLabel(); + label.setText("\u5BBF\u820D"); + label.setBounds(22, 20, 29, 22); + getContentPane().add(label); + jbox.setBounds(55, 20,80, 25); + getContentPane().add(jbox);//公寓 + jbox.addItem("泰山9栋"); + jbox.addItem("泰山10栋"); + jbox.addItem("泰山11栋"); + jbox.addItem("泰山12栋"); + jbox.addItem("泰山13栋"); + jbox.addItem("泰山14栋"); + + final JLabel qs = new JLabel(); + qs.setText("\u623F\u53F7"); + qs.setBounds(145,20, 29, 18); + getContentPane().add(qs); + + lk.setBounds(175, 20, 50, 25);//寝室 + getContentPane().add(lk); + + + final JLabel label_2 = new JLabel(); + label_2.setText("人数"); + label_2.setBounds(22, 75, 29, 18); + getContentPane().add(label_2); + + + sd.setBounds(70, 75, 140, 25); //人数 + getContentPane().add(sd); + + final JLabel label_3 = new JLabel(); + label_3.setText("用电量"); + label_3.setBounds(22, 130,50, 18); + getContentPane().add(label_3); + + + sd1.setBounds(70, 130, 140, 25); + getContentPane().add(sd1);//用电量 + + final JLabel label_4 = new JLabel(); + label_4.setText("用水量"); + label_4.setBounds(22, 185,50, 18); + getContentPane().add(label_4); + + sd2.setBounds(70, 185, 140, 25); + getContentPane().add(sd2);//用水量 + + final JLabel label_5 = new JLabel(); + label_5.setText("水电费"); + label_5.setBounds(22, 240,50, 18); + getContentPane().add(label_5); + + sd3.setBounds(70, 240, 140, 25); + getContentPane().add(sd3);//水电费 + + final JLabel label_7 = new JLabel(); + label_7.setText("是否缴费"); + label_7.setBounds(22,295 , 70, 22); + getContentPane().add(label_7); + jbox1.setBounds(80, 295,50, 25); + getContentPane().add(jbox1);//交费 + jbox1.addItem("是"); + jbox1.addItem("否"); + + b1.setText("确定"); + b1.setBounds(30, 350,60, 23); + b1.addActionListener(this); + getContentPane().add(b1); + + + b2.setText("取消"); + b2.setBounds(150, 350, 60, 23); + b2.addActionListener(this); + getContentPane().add(b2); + + + + + + // + } + + public void actionPerformed(ActionEvent e) { + if(e.getSource()==b1){ + + try { + + String url = "jdbc:sqlserver://localhost:1433; DatabaseName=TT"; // 指定连接数据库的URL + String user = "sa"; // 指定连接数据库的用户名 + String passWord = "123456"; // 指定连接数据库的密码 + Connection conn=DriverManager.getConnection(url, user, passWord); + java.sql.Statement stmt=conn.createStatement(); + p1=jbox.getSelectedItem().toString(); + p2=jbox1.getSelectedItem().toString(); + + + String sql="insert into Sushe values('"+p1+"','"+lk.getText()+"','"+sd.getText()+"'," + + "'"+sd1.getText()+"','"+sd2.getText()+"','"+sd3.getText()+"','"+p2+"')"; + stmt.executeUpdate(sql); + JOptionPane.showMessageDialog(null,"成功录入寝室信息",null,JOptionPane.WARNING_MESSAGE); + } catch (SQLException e1) { + // TODO 自动生成 catch 块 + e1.printStackTrace(); + } + } + // TODO 自动生成方法存根 + if(e.getSource()==b2){setVisible(false);} + + } + +} diff --git a/src/Inputsg.java b/src/Inputsg.java new file mode 100644 index 0000000..780eef0 --- /dev/null +++ b/src/Inputsg.java @@ -0,0 +1,150 @@ +package Dormitory; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseWheelListener; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.Date; +import java.util.Locale; + +import javax.swing.ButtonGroup; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JTextField; + + + +public class Inputsg extends JFrame implements ActionListener{ + + final JButton b1 = new JButton(); + final JButton b2 = new JButton(); + final JTextField sd = new JTextField(); + final JTextField sd1 = new JTextField(); + final JTextField sd2 = new JTextField(); + final JTextField gy1 = new JTextField(); + final JTextField lk = new JTextField(); + Statement stmt = null; + Statement st = null; + ResultSet rs = null; + + @SuppressWarnings("unused") + private Date date=new Date(); + /** + * Launch the application + * @param args + */ + public static void main(String args[]) { + try { + Inputsg frame = new Inputsg(); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * Create the frame + */ + public Inputsg() { + super("录入宿管信息"); + getContentPane().setLayout(null); + setBounds(100, 100, 409, 329); + + + final JLabel label = new JLabel(); + label.setText("编号"); + label.setBounds(22, 53, 29, 22); + getContentPane().add(label); + + final JLabel qs = new JLabel(); + qs.setText("姓名"); + qs.setBounds(22, 99, 29, 18); + getContentPane().add(qs); + + lk.setBounds(80, 99, 120, 25);//姓名 + getContentPane().add(lk); + + + + + final JLabel label_2 = new JLabel(); + label_2.setText("联系方式"); + label_2.setBounds(22, 150, 56, 17); + getContentPane().add(label_2); + + + sd.setBounds(80, 150, 120, 25); //联系方式 + getContentPane().add(sd); + + final JLabel label_3 = new JLabel(); + label_3.setText("性别"); + label_3.setBounds(230, 53,29, 17); + getContentPane().add(label_3); + + + sd1.setBounds(270, 53, 80, 25); + getContentPane().add(sd1); + + final JLabel label_4 = new JLabel(); + label_4.setText("公寓"); + label_4.setBounds(230, 99,29, 17); + getContentPane().add(label_4); + + + sd2.setBounds(270, 99, 80, 25); + getContentPane().add(sd2); + + b1.setText("确定"); + b1.setBounds(97, 240, 99, 23); + b1.addActionListener(this); + getContentPane().add(b1); + + + b2.setText("取消"); + b2.setBounds(200, 240, 99, 23); + b2.addActionListener(this); + getContentPane().add(b2); + + gy1.setBounds(80, 53,120, 25); + getContentPane().add(gy1);//编号 + + // + } + + public void actionPerformed(ActionEvent e) { + if(e.getSource()==b1){ + + try { + + String url = "jdbc:sqlserver://localhost:1433; DatabaseName=TT"; // 指定连接数据库的URL + String user = "sa"; // 指定连接数据库的用户名 + String passWord = "123456"; // 指定连接数据库的密码 + Connection conn=DriverManager.getConnection(url, user, passWord); + java.sql.Statement stmt=conn.createStatement(); + + + + String sql="insert into Manager values('"+gy1.getText()+"','"+lk.getText()+"','"+sd.getText()+"'," + + "'"+sd1.getText()+"','"+sd2.getText()+"')"; + stmt.executeUpdate(sql); + JOptionPane.showMessageDialog(null,"成功添加宿管信息",null,JOptionPane.WARNING_MESSAGE); + } catch (SQLException e1) { + // TODO 自动生成 catch 块 + e1.printStackTrace(); + } + } + // TODO 自动生成方法存根 + if(e.getSource()==b2){setVisible(false);} + + } + +} diff --git a/src/Interface.java b/src/Interface.java new file mode 100644 index 0000000..323772d --- /dev/null +++ b/src/Interface.java @@ -0,0 +1,147 @@ +package Dormitory; +import java.awt.Color; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; + +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JPasswordField; +import javax.swing.JTextField; +import java.awt.Font; + +@SuppressWarnings("serial") +public class Interface extends JFrame { + JPanel plog; + JLabel p; + JLabel username,password; + JButton denglu,tuichu,zhuce; + JPasswordField wpassword;//一个只能输入数字的文本框 + JTextField wusername; + public Interface(){ + super("宿舍管理系统"); + plog=new JPanel(); + this.getContentPane().add(plog); + plog.setLayout(null); + username=new JLabel("\u7528\u6237\u540D\uFF1A"); + username.setFont(new Font("宋体", Font.PLAIN, 14)); + password=new JLabel("\u5BC6\u7801\uFF1A"); + password.setFont(new Font("宋体", Font.PLAIN, 14)); + wusername=new JTextField(20); + wpassword=new JPasswordField(20); + denglu=new JButton("\u767B\u5F55"); + denglu.setFont(new Font("宋体", Font.PLAIN, 15)); + tuichu=new JButton("\u9000\u51FA"); + tuichu.setFont(new Font("宋体", Font.PLAIN, 15)); + zhuce=new JButton("\u6CE8\u518C"); + zhuce.setFont(new Font("宋体", Font.PLAIN, 15)); + p=new JLabel(); + this.setBounds(600,270,315,120); + plog.add(p); + username.setBounds(36,50,74,25); + wusername.setBounds(100,50,174,25); + password.setBounds(36,90,74,25); + wpassword.setBounds(100,90,174,25); + denglu.setBounds(26,151,80,25); + tuichu.setBounds(207,151,80,25); + zhuce.setBounds(120,151,80,25); + username.setForeground(Color.BLACK); + username.setBackground(Color.WHITE); + password.setForeground(Color.BLACK); + password.setBackground(Color.WHITE); + plog.add(username); + plog.add(wusername); + plog.add(password); + plog.add(wpassword); + plog.add(denglu); + plog.add(tuichu); + plog.add(zhuce); + setResizable(false);//用户不可随意更改窗体大小 + setSize(328,252); + setVisible(true); + denglu.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + String id = wusername.getText(); + char[] s=wpassword.getPassword(); + System.out.println(id); + String dbpassword=new String(s); + System.out.println(dbpassword); + if(wusername.getText().equals("")||dbpassword.equals("")){ + JOptionPane.showMessageDialog(null,"请输入用户名或密码","错误",JOptionPane.ERROR_MESSAGE); + } + else + { + try{ + Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); + } + catch(Exception e) + { + System.out.println("无法加载驱动程序"); + } + try{ + String url = "jdbc:sqlserver://localhost:1433; DatabaseName=TT"; // 指定连接数据库的URL + + String user = "sa"; // 指定连接数据库的用户名 + String passWord = "123456"; // 指定连接数据库的密码 + Connection conn=DriverManager.getConnection(url, user, passWord); + + Statement stmt=conn.createStatement(); + System.out.print( id); + String _sql = "select * from userlist where id="+"'"+id+"'"; + ResultSet rs=stmt.executeQuery(_sql); + + + if(rs.next()) + { + if(rs.getString("m").equals(dbpassword)) + { + Menu aaa=new Menu(); + } + else + { + JOptionPane.showMessageDialog( null,"登录失败,密码错误,请重新输入"); + } + } + else{ + JOptionPane.showMessageDialog(null,"登录失败,用户名不存在,请重新输入"); + } + rs.close(); + stmt.close(); + } + catch(SQLException e) + { + System.out.println("SOL异常"); + } + } + } + }); + tuichu.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + System.exit(0); + } + }); + zhuce.addActionListener(new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + // TODO 自动生成的方法存根 + // new RegistcontentPane(); + } + + + }); + } + + public static void main(String args[]) + { + new Interface(); + } +} \ No newline at end of file diff --git a/src/Menu.java b/src/Menu.java new file mode 100644 index 0000000..6938398 --- /dev/null +++ b/src/Menu.java @@ -0,0 +1,174 @@ +package Dormitory; +import java.awt.BorderLayout; +import java.awt.Font; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JToolBar; + + +public class Menu extends JFrame implements ActionListener{ + + static JFrame f = null; + private JMenuItem ssrl = new JMenuItem(); + private JMenuItem sscx = new JMenuItem(); + private JMenuItem tjsd1 = new JMenuItem(); + private JMenuItem tjsd2 = new JMenuItem(); + private JMenuItem jsq = new JMenuItem(); + private JMenuItem tjlf = new JMenuItem(); + private JMenuItem tjsd = new JMenuItem(); + private JMenuItem xslz = new JMenuItem(); + private JMenuItem xsbl = new JMenuItem(); + private JMenuItem xsxx = new JMenuItem(); + private JMenuItem b11 = new JMenuItem(); + private JMenuItem b22 = new JMenuItem(); + private JMenuItem cxwg = new JMenuItem(); + public static void main(String args[]) { + try { + Menu frame = new Menu(); + + } catch (Exception e) { + e.printStackTrace(); } + } + + + + public Menu() { + super("宿舍管理系统"); + + setBounds(100, 100, 550,460); + getContentPane().setLayout(new BorderLayout()); + + JLabel bg=new JLabel(new ImageIcon("4.jpg")); + getContentPane().add(bg,BorderLayout.CENTER); + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + final JMenuBar menuBar = new JMenuBar(); + setJMenuBar(menuBar); + + final JMenu menu = new JMenu(); + menu.setText("学生住宿"); + menuBar.add(menu); + + + + final JMenu menu3 = new JMenu(); + menu3.setText("寝室信息管理"); + menuBar.add(menu3); + + final JMenu tj = new JMenu(); + tj.setText("来访者管理"); + menuBar.add(tj); + + final JMenu cx = new JMenu(); + cx.setText("宿管信息"); + menuBar.add(cx); + + final JMenu menu2 = new JMenu(); + menu2.setText("辅助工具"); + menuBar.add(menu2); + + jsq.setText("计算器"); + menu2.add(jsq); + jsq.addActionListener(this); + + tjlf.setText("记录来访者"); + tj.add(tjlf); + tjlf.addActionListener(this); + + cxwg.setText("查询来访者"); + tj.add(cxwg); + cxwg.addActionListener(this); + + + + xslz.setText("学生入住"); + menu.add(xslz); + xslz.addActionListener(this); + + xsbl.setText("学生搬离"); + menu.add(xsbl); + xsbl.addActionListener(this); + + + xsxx.setText("查询学生信息"); + menu.add(xsxx); + xsxx.addActionListener(this); + + + b11.setText("修改学生信息"); + menu.add(b11); + b11.addActionListener(this); + + + b22.setText("修改宿管信息"); + cx.add(b22); + b22.addActionListener(this); + + tjsd.setText("录入宿管信息"); + cx.add(tjsd); + tjsd.addActionListener(this); + this.setVisible(true); + + tjsd1.setText("删除宿管信息"); + cx.add(tjsd1); + tjsd1.addActionListener(this); + this.setVisible(true); + + tjsd2.setText("查询宿管信息"); + cx.add(tjsd2); + tjsd2.addActionListener(this); + this.setVisible(true); + + + + + ssrl.setText("寝室信息录入"); + menu3.add(ssrl); + ssrl.addActionListener(this); + sscx.setText("寝室查询"); + menu3.add(sscx); + sscx.addActionListener(this); + + } + + public void actionPerformed(ActionEvent e) { + // TODO 自动生成方法存根 + if(e.getSource()==jsq){ Calculator frame1 = new Calculator();//计算器 + frame1.setVisible(true);} + if(e.getSource()==sscx){ Querydormitoryinformation frame1 = new Querydormitoryinformation();//查询寝室信息 + frame1.setVisible(true);} + if(e.getSource()==ssrl){ Enterdormitoryinformation frame1 = new Enterdormitoryinformation();//添加寝室信息 + frame1.setVisible(true);} + if(e.getSource()==tjsd1){ Quitsg frame1 = new Quitsg();//删除宿管信息 + frame1.setVisible(true);} + if(e.getSource()==tjsd2){ Querysg frame1 = new Querysg();//查询宿管信息 + frame1.setVisible(true);} + if(e.getSource()==tjsd){ Inputsg frame1 = new Inputsg();//添加宿管信息 + frame1.setVisible(true);} + if(e.getSource()==cxwg){ Querylfz frame1 = new Querylfz();//查询来访者 + frame1.setVisible(true);} + if(e.getSource()==xslz){ Studentcheckin frame = new Studentcheckin();//学生入住 + frame.setVisible(true);} + if(e.getSource()==b11){ Modifystudent frame2 = new Modifystudent(); //修改学生 + frame2.setVisible(true);} + if(e.getSource()==b22){ Modifysg frame2 = new Modifysg(); //修改宿管信息 + frame2.setVisible(true);} + if(e.getSource()==tjlf){ Modifylfz frame = new Modifylfz();//添加来访者 + frame.setVisible(true);} + if(e.getSource()==xsbl){ Studentmoveout frame = new Studentmoveout();//学生搬离 + frame.setVisible(true);} + if(e.getSource()==xsxx){ Querystudent frame = new Querystudent();//学生信息查询... + frame.setVisible(true);} + + + } + +} \ No newline at end of file diff --git a/src/Modifylfz.java b/src/Modifylfz.java new file mode 100644 index 0000000..3c40a73 --- /dev/null +++ b/src/Modifylfz.java @@ -0,0 +1,207 @@ +package Dormitory; +import java.awt.Dimension; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; + +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JScrollPane; +import javax.swing.JTable; +import javax.swing.JTextField; +import javax.swing.table.DefaultTableModel; + + +public class Modifylfz extends JFrame { + private JTextField time; + private static final long serialVersionUID = 1L; + static DefaultTableModel data; + private ResultSet rs ; + private JTextField cf; + private JTextField yy; + private JTextField yy1; + private JTextField yy2; + private JTextField cd; + private JTextField num; + private JTextField qs; + private JTextField gy; + private JTable table; + Statement stmt = null; + Statement st = null; + + /** + * Launch the application + * @param args + */ + public static void main(String args[]) { + try { + Modifylfz frame = new Modifylfz(); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * Create the frame + */ + public Modifylfz() { + super(); + setTitle("\u6765\u8BBF\u8005\u4FE1\u606F\u4FEE\u6539"); + getContentPane().setLayout(null); + setBounds(100, 100, 800, 411); + setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + String [] s = {"来访者姓名","学生学号","日期","身份证","关系","公寓","寝室"}; + data = new DefaultTableModel(s,0); + final JScrollPane scrollPane = new JScrollPane(); + scrollPane.setBounds(0, 0, 800, 206); + getContentPane().add(scrollPane); + + try { + String url = "jdbc:sqlserver://localhost:1433; DatabaseName=TT"; // 指定连接数据库的URL + String user = "sa"; // 指定连接数据库的用户名 + String passWord = "123456"; // 指定连接数据库的密码 + Connection conn=DriverManager.getConnection(url, user, passWord); + java.sql.Statement st=conn.createStatement(); + + rs=st.executeQuery("select * from Friend"); + while(rs.next()){ + String name= rs.getString("Fname"); + String sid = rs.getString("Sno"); + String time=rs.getString("Ftime"); + String fid = rs.getString("sfz"); + String sex= rs.getString("relation"); + String gy= rs.getString("apartment"); + String qs= rs.getString("qinshi"); + String[] str = {name,sid,time,fid,sex,gy,qs}; + data.addRow(str); + } + } catch (SQLException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + + table = new JTable(data); + scrollPane.setViewportView(table); + + + final JLabel label = new JLabel(); + label.setText("来访者姓名"); + label.setBounds(0, 212, 72, 18); + getContentPane().add(label); + + gy = new JTextField(); + gy.setBounds(75, 212, 117, 24); + getContentPane().add(gy); + + final JLabel label_1 = new JLabel(); + label_1.setText("学生学号"); + label_1.setBounds(242, 212, 71, 23); + getContentPane().add(label_1); + + qs = new JTextField(); + qs.setBounds(319, 208, 119, 28); + getContentPane().add(qs); + + final JLabel label_2 = new JLabel(); + label_2.setText("日期"); + label_2.setBounds(0, 252, 75, 22); + getContentPane().add(label_2); + + num = new JTextField(); + num.setBounds(75, 250, 117, 29); + getContentPane().add(num); + + final JLabel label_3 = new JLabel(); + label_3.setText("身份证"); + label_3.setBounds(242, 253, 58, 21); + getContentPane().add(label_3); + + cd = new JTextField(); + cd.setBounds(319, 252, 119, 25); + getContentPane().add(cd); + + + final JLabel label_5 = new JLabel(); + label_5.setText("关系"); + label_5.setBounds(242, 295, 61, 18); + getContentPane().add(label_5); + + yy = new JTextField(); + yy.setBounds(320, 293, 118, 25); + getContentPane().add(yy); + + final JLabel label_6 = new JLabel(); + label_6.setText("公寓"); + label_6.setBounds(0, 340, 61, 18); + getContentPane().add(label_6); + + yy1 = new JTextField(); + yy1.setBounds(75, 340, 118, 25); + getContentPane().add(yy1); + + final JLabel label_7 = new JLabel(); + label_7.setText("寝室"); + label_7.setBounds(0, 295, 61, 18); + getContentPane().add(label_7); + + yy2 = new JTextField(); + yy2.setBounds(75, 293, 118, 25); + getContentPane().add(yy2); + + + final JButton b = new JButton(); + b.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + try { + + String url = "jdbc:sqlserver://localhost:1433; DatabaseName=TT"; // 指定连接数据库的URL + String user = "sa"; // 指定连接数据库的用户名 + String passWord = "123456"; // 指定连接数据库的密码 + Connection conn=DriverManager.getConnection(url, user, passWord); + java.sql.Statement stmt=conn.createStatement(); + + String sql="insert into Friend values('"+gy.getText()+"'," + + "'"+qs.getText()+"','"+num.getText()+"','"+cd.getText()+"','"+yy.getText()+"','"+yy1.getText()+"','"+yy2.getText()+"')"; + stmt.executeUpdate(sql); + String name=gy.getText(); + String sid = qs.getText(); + String time = num.getText(); + String fid=cd.getText(); + + String sex = yy.getText(); + String gy = yy1.getText(); String qs = yy2.getText(); + String[] str = {name,sid,time,fid,sex,gy,qs}; + data.addRow(str); + + } catch (SQLException e) { + + e.printStackTrace(); + } + + } + + }); + b.setText("添加"); + b.setBounds(454, 226, 99, 20); + getContentPane().add(b); + + final JButton button = new JButton(); + button.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) {setVisible(false); + } + }); + button.setText("取消"); + button.setBounds(454, 290, 99, 23); + getContentPane().add(button); + + + // + } + +} \ No newline at end of file diff --git a/src/Modifysg.java b/src/Modifysg.java new file mode 100644 index 0000000..59dc368 --- /dev/null +++ b/src/Modifysg.java @@ -0,0 +1,225 @@ +package Dormitory; + +import java.awt.BorderLayout; +import java.awt.FlowLayout; +import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; + +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTable; +import javax.swing.JTextField; +import javax.swing.table.DefaultTableModel; + + + + + +public class Modifysg extends JFrame implements ActionListener { + int a; + int i=0; + String sex1, name1,phone1,bh1,gy1; + Statement st = null; + ResultSet rs = null; + ResultSet rs1 = null; + Statement stmt = null; + final JPanel p = new JPanel(); + + private JTable table ; + private JButton b1 = new JButton(); + private JButton b2 = new JButton(); + private JTextField phone = new JTextField(); + private JTextField bh = new JTextField(); + private JTextField sex = new JTextField(); + private JTextField gy = new JTextField(); + private JTextField name = new JTextField(); + private static final long serialVersionUID = 1L; + static DefaultTableModel data; + /** + * Launch the application + * @param args + */ + public static void main(String args[]) { + try { + Modifysg frame = new Modifysg(); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * Create the frame + */ + public Modifysg() { + super(); + setTitle("\u5BBF\u7BA1\u4FE1\u606F\u4FEE\u6539"); + getContentPane().setLayout(new BorderLayout()); + setBounds(100, 100, 500, 375); + setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + + final JPanel p1 = new JPanel(); + getContentPane().add(p1, BorderLayout.SOUTH); + + + p1.add(b1); + b1.setText("修改"); + b1.addActionListener(this); + + + b2.setText("取消"); + b2.addActionListener(this); + p1.add(b2); + + + p.setLayout(new BorderLayout()); + getContentPane().add(p); + + final JPanel panel = new JPanel(); + panel.setLayout(new GridLayout(3,6)); + p.add(panel, BorderLayout.SOUTH); + + final JLabel label_5 = new JLabel(); + label_5.setText("宿管编号"); + panel.add(label_5); + + + panel.add(bh); + + final JLabel label_4 = new JLabel(); + label_4.setText("姓名"); + panel.add(label_4); + + + panel.add(name); + + final JLabel label_3 = new JLabel(); + label_3.setText("联系方式"); + panel.add(label_3); + + + panel.add(phone); + + final JLabel label_2 = new JLabel(); + label_2.setText("性别"); + panel.add(label_2); + + + panel.add(sex); + + final JLabel label_1 = new JLabel(); + panel.add(label_1); + label_1.setText("公寓楼号"); + + panel.add(gy); + + + String[] columnNames = new String[]{"宿管编号","姓名","联系方式","性别" ,"公寓楼"}; + data = new DefaultTableModel(columnNames ,0); + final JScrollPane scrollPane = new JScrollPane(); + p.add(scrollPane); + + try { + String url = "jdbc:sqlserver://localhost:1433; DatabaseName=TT"; // 指定连接数据库的URL + String user = "sa"; // 指定连接数据库的用户名 + String passWord = "123456"; // 指定连接数据库的密码 + Connection conn=DriverManager.getConnection(url, user, passWord); + java.sql.Statement stmt=conn.createStatement(); + String sql="select * from Manager"; + rs=stmt.executeQuery(sql); + while (rs.next()){ + String b1=rs.getString("Mno"); + String x1=rs.getString("Mname"); + String p11=rs.getString("Mphone"); + String s1=rs.getString("Msex"); + String g1 =rs.getString("apartment"); + + + + String[] str = {b1,x1,p11,s1,g1}; + data.addRow(str); + + + } + } catch (SQLException e) { + // TODO 自动生成 catch 块 + e.printStackTrace(); + } + + table = new JTable(data); + table.addMouseListener(new TableListener()); + scrollPane.setViewportView(table); + setVisible(true); + // + } + class TableListener extends MouseAdapter { + public void mouseClicked(final MouseEvent e) { + + int selRow = table.getSelectedRow(); + bh1 = table.getValueAt(selRow, 0).toString().trim(); + name1 = table.getValueAt(selRow, 1).toString().trim(); + phone1= table.getValueAt(selRow, 2).toString().trim(); + sex1= table.getValueAt(selRow, 3).toString().trim(); + gy1 = table.getValueAt(selRow, 4).toString().trim(); + + + + bh.setText(bh1); + name.setText(name1); + phone.setText(phone1); + sex.setText(sex1); + gy.setText(gy1); + + } + } + public void actionPerformed(ActionEvent e) { + if(e.getSource()==b2){setVisible(false);} + if(e.getSource()==b1){ + + try { + String url = "jdbc:sqlserver://localhost:1433; DatabaseName=TT"; // 指定连接数据库的URL + String user = "sa"; // 指定连接数据库的用户名 + String passWord = "123456"; // 指定连接数据库的密码 + Connection conn=DriverManager.getConnection(url, user, passWord); + java.sql.Statement stmt=conn.createStatement(); + + String sql="update Manager set Mno='"+bh.getText()+"',Mname='"+name.getText()+"',Mphone='"+phone.getText()+"',Msex='"+sex.getText()+"',apartment='"+gy.getText()+"' where Mno='"+bh1+"'"; + stmt.executeUpdate(sql); + Connection conn1=DriverManager.getConnection(url, user, passWord); + java.sql.Statement stmt1=conn.createStatement(); + data.setRowCount(0); + String sq="select * from Manager"; + rs=stmt.executeQuery(sq); + while (rs.next()){ + String b1=rs.getString("Mno"); + String x1=rs.getString("Mname"); + String p1=rs.getString("Mphone"); + String s1=rs.getString("Msex"); + String g1 =rs.getString("apartment"); + String[] str = {b1,x1,p1,s1,g1}; + data.addRow(str); + + + } + + } catch (SQLException e1) { + // TODO 自动生成 catch 块 + e1.printStackTrace(); + } + + } + // TODO 自动生成方法存根 + } + +} diff --git a/src/Modifystudent.java b/src/Modifystudent.java new file mode 100644 index 0000000..d320557 --- /dev/null +++ b/src/Modifystudent.java @@ -0,0 +1,236 @@ +package Dormitory; + +import java.awt.BorderLayout; +import java.awt.FlowLayout; +import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; + +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTable; +import javax.swing.JTextField; +import javax.swing.table.DefaultTableModel; + + + + + +public class Modifystudent extends JFrame implements ActionListener { + int a; + int i=0; + String qs1, num1, name1,phone1,gy1,clas1; + Statement st = null; + ResultSet rs = null; + ResultSet rs1 = null; + Statement stmt = null; + final JPanel p = new JPanel(); + + private JTable table ; + private JButton b1 = new JButton(); + private JButton b2 = new JButton(); + private JTextField phone = new JTextField(); + private JTextField gy = new JTextField(); + private JTextField qs = new JTextField(); + private JTextField clas = new JTextField(); + private JTextField name = new JTextField(); + private JTextField num = new JTextField(); + private static final long serialVersionUID = 1L; + static DefaultTableModel data; + /** + * Launch the application + * @param args + */ + public static void main(String args[]) { + try { + Modifystudent frame = new Modifystudent(); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * Create the frame + */ + public Modifystudent() { + super(); + setTitle("\u5BBF\u820D\u4FE1\u606F\u67E5\u8BE2"); + getContentPane().setLayout(new BorderLayout()); + setBounds(100, 100, 500, 375); + setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + + final JPanel p1 = new JPanel(); + getContentPane().add(p1, BorderLayout.SOUTH); + + + p1.add(b1); + b1.setText("修改"); + b1.addActionListener(this); + + + b2.setText("取消"); + b2.addActionListener(this); + p1.add(b2); + + + p.setLayout(new BorderLayout()); + getContentPane().add(p); + + final JPanel panel = new JPanel(); + panel.setLayout(new GridLayout(3,6)); + p.add(panel, BorderLayout.SOUTH); + + final JLabel label_5 = new JLabel(); + label_5.setText("\u5BBF\u820D"); + panel.add(label_5); + + + panel.add(gy); + + final JLabel label_4 = new JLabel(); + label_4.setText("电话"); + panel.add(label_4); + + + panel.add(phone); + + final JLabel label_3 = new JLabel(); + label_3.setText("\u623F\u53F7"); + panel.add(label_3); + + + panel.add(qs); + + final JLabel label_2 = new JLabel(); + label_2.setText("班级"); + panel.add(label_2); + + + panel.add(clas); + + final JLabel label_1 = new JLabel(); + panel.add(label_1); + label_1.setText("姓名"); + + panel.add(name); + + final JLabel label = new JLabel(); + panel.add(label); + label.setText("学号"); + + + panel.add(num); + String[] columnNames = new String[]{"宿舍区","房号","姓名","学号" ,"班级","个人电话"}; + data = new DefaultTableModel(columnNames ,0); + final JScrollPane scrollPane = new JScrollPane(); + p.add(scrollPane); + + try { + String url = "jdbc:sqlserver://localhost:1433; DatabaseName=TT"; // 指定连接数据库的URL + String user = "sa"; // 指定连接数据库的用户名 + String passWord = "123456"; // 指定连接数据库的密码 + Connection conn=DriverManager.getConnection(url, user, passWord); + java.sql.Statement stmt=conn.createStatement(); + String sql="select * from Student"; + rs=stmt.executeQuery(sql); + while (rs.next()){ + String g1=rs.getString("apartment"); + String q1=rs.getString("qinshi"); + String nam1=rs.getString("Sname"); + String nu1=rs.getString("Sno"); + String cla1 =rs.getString("Sclass"); + String ph1=rs.getString("Sphone"); + + + + String[] str = {g1,q1,nam1,nu1,cla1,ph1}; + data.addRow(str); + + + } + } catch (SQLException e) { + // TODO 自动生成 catch 块 + e.printStackTrace(); + } + + table = new JTable(data); + table.addMouseListener(new TableListener()); + scrollPane.setViewportView(table); + setVisible(true); + // + } + class TableListener extends MouseAdapter { + public void mouseClicked(final MouseEvent e) { + + int selRow = table.getSelectedRow(); + gy1 = table.getValueAt(selRow, 0).toString().trim(); + qs1 = table.getValueAt(selRow, 1).toString().trim(); + name1 = table.getValueAt(selRow, 2).toString().trim(); + num1= table.getValueAt(selRow, 3).toString().trim(); + clas1 = table.getValueAt(selRow, 4).toString().trim(); + phone1 = table.getValueAt(selRow, 5).toString().trim(); + + + gy.setText(gy1); + + + name.setText(name1); + qs.setText(qs1); + phone.setText(phone1); + clas.setText(clas1); + num.setText(num1); + + } + } + public void actionPerformed(ActionEvent e) { + if(e.getSource()==b2){setVisible(false);} + if(e.getSource()==b1){ + + try { + String url = "jdbc:sqlserver://localhost:1433; DatabaseName=TT"; // 指定连接数据库的URL + String user = "sa"; // 指定连接数据库的用户名 + String passWord = "123456"; // 指定连接数据库的密码 + Connection conn=DriverManager.getConnection(url, user, passWord); + java.sql.Statement stmt=conn.createStatement(); + + String sql="update Student set Sno='"+num.getText()+"',qinshi='"+qs.getText()+"',apartment='"+gy.getText()+"',Sname='"+name.getText()+"',Sclass='"+clas.getText()+"',Sphone='"+phone.getText()+"' where Sno='"+num1+"'"; + stmt.executeUpdate(sql); + Connection conn1=DriverManager.getConnection(url, user, passWord); + java.sql.Statement stmt1=conn.createStatement(); + data.setRowCount(0); + String sq="select apartment,qinshi,Sname,Sno,Sclass,Sphone from Student"; + rs=stmt1.executeQuery(sq); + while (rs.next()){ + String q1=rs.getString("apartment"); + String g1=rs.getString("qinshi"); + String nam1=rs.getString("Sname"); + String nu1=rs.getString("Sno"); + String cla1 =rs.getString("Sclass"); + String ph1=rs.getString("Sphone"); + String[] str = {q1,g1,nam1,nu1,cla1,ph1}; + data.addRow(str); + + + } + + } catch (SQLException e1) { + // TODO 自动生成 catch 块 + e1.printStackTrace(); + } + + } + // TODO 自动生成方法存根 + } + +} diff --git a/src/Other.java b/src/Other.java new file mode 100644 index 0000000..874b93b --- /dev/null +++ b/src/Other.java @@ -0,0 +1,47 @@ +package Dormitory; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; + + +public class Other { + Statement stmt = null; + Statement st = null; + ResultSet rs = null; + int a; + Connection conn; + int sh(){ + try{ + + + Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); + String url = "jdbc:sqlserver://localhost:1433; DatabaseName=TT"; // 指定连接数据库的URL + String user = "sa"; // 指定连接数据库的用户名 + String passWord = "123456"; // 指定连接数据库的密码 + Connection conn=DriverManager.getConnection(url, user, passWord); + + System.out.println("

注册并成功建立student数据库的联接.

"); + }catch(Exception ex){ + System.out.println("

注册或建立student数据库的联接不成功.

");} + + try { + String url = "jdbc:sqlserver://localhost:1433; DatabaseName=TT"; // 指定连接数据库的URL + String user = "sa"; // 指定连接数据库的用户名 + String passWord = "123456"; // 指定连接数据库的密码 + Connection conn=DriverManager.getConnection(url, user, passWord); + java.sql.Statement stmt=conn.createStatement(); + + String sql="select Sno from Student"; + rs=stmt.executeQuery(sql); + while (rs.next()){a++;} + } catch (SQLException e) { + // TODO 自动生成 catch 块 + e.printStackTrace(); + } + System.out.println(a); + return a; + } + +} diff --git a/src/Querydormitoryinformation.java b/src/Querydormitoryinformation.java new file mode 100644 index 0000000..3e5d4a0 --- /dev/null +++ b/src/Querydormitoryinformation.java @@ -0,0 +1,197 @@ +package Dormitory; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.beans.Statement; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; + +import javax.swing.ButtonGroup; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JRadioButton; +import javax.swing.JScrollPane; +import javax.swing.JTable; +import javax.swing.JTextField; +import javax.swing.table.AbstractTableModel; +import javax.swing.table.DefaultTableModel; + + +public class Querydormitoryinformation extends JFrame implements ActionListener{ + private static final long serialVersionUID = 1L; + static DefaultTableModel data; + + java.sql.Statement stmt = null; + java.sql.Statement st = null; + ResultSet rs = null; +private JTextField qy = new JTextField(); + private JTextField t = new JTextField(); + private JRadioButton r2 = new JRadioButton(); +private JRadioButton r1 = new JRadioButton(); +private JRadioButton r = new JRadioButton(); +private JButton b = new JButton(); +private JButton b1 = new JButton(); + private ButtonGroup buttonGroup = new ButtonGroup(); +private JTable table; +private JTextField qs = new JTextField(); +private JTextField qs1 = new JTextField(); + + + /** + * Launch the application + * @param args + */ + public static void main(String args[]) { + try { + Querydormitoryinformation frame = new Querydormitoryinformation(); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * Create the frame + */ + public Querydormitoryinformation() { + super("查询寝室信息"); + getContentPane().setLayout(null); + setBounds(100, 100, 550, 400); + setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + + + + + buttonGroup.add(r); + r.setText("按宿舍"); + r.setBounds(10, 313, 88, 23); + getContentPane().add(r); + + buttonGroup.add(r1); + r1.setText("已缴费"); + r1.setBounds(260, 313, 71, 23); + getContentPane().add(r1); + + buttonGroup.add(r2); + r2.setText("未缴费"); + r2.setBounds(400, 313, 71, 23); + getContentPane().add(r2); + + b.setText("确定"); + b.setBounds(146, 338, 91, 23); + b.addActionListener(this); + getContentPane().add(b); + + + b1.setText("取消"); + b1.addActionListener(this); + b1.setBounds(291, 338, 86, 23); + getContentPane().add(b1); + + qs.setBounds(104, 315,50, 20); + qs.setToolTipText("请输入公寓号"); + qs1.setBounds(160, 315,60, 20); + qs1.setToolTipText("请输入寝室号"); + getContentPane().add(qs); + getContentPane().add(qs1); + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + String [] s = {"公寓楼","寝室号","已住人数","用电量","用水量","水电费"," 是否缴费"}; + data = new DefaultTableModel(s,0); + final JScrollPane scrollPane = new JScrollPane(); + scrollPane.setBounds(0, 0, 540, 312); + getContentPane().add(scrollPane); + + table = new JTable(data); + scrollPane.setViewportView(table); + + // + } + + public void actionPerformed(ActionEvent e) { + if(e.getSource()==b){ + + try { + String url = "jdbc:sqlserver://localhost:1433; DatabaseName=TT"; // 指定连接数据库的URL + String user = "sa"; // 指定连接数据库的用户名 + String passWord = "123456"; // 指定连接数据库的密码 + if(r2.isSelected()){ + String b="否"; + String sql ="select * from Sushe where accept='"+b+"'"; + + data.setRowCount(0); + + Connection conn1=DriverManager.getConnection(url, user, passWord); + java.sql.Statement stmt1=conn1.createStatement(); + rs=stmt1.executeQuery(sql); + while(rs.next()){ + String b1= rs.getString("apartment"); + String b2 = rs.getString("qinshi"); + String b3 = rs.getString("person"); + String b4 = rs.getString("electric"); + String b5=rs.getString("water"); + String b6=rs.getString("m"); + String b7=rs.getString("accept"); + String[] str = {b1,b2,b3,b4,b5,b6,b7}; + data.addRow(str); + }} + + if(r1.isSelected()){ + String a="是"; + String sql ="select * from Sushe where accept='"+a+"'"; + + data.setRowCount(0); + + Connection conn1=DriverManager.getConnection(url, user, passWord); + java.sql.Statement stmt1=conn1.createStatement(); + rs=stmt1.executeQuery(sql); + while(rs.next()){ + String a1= rs.getString("apartment"); + String a2 = rs.getString("qinshi"); + String a3 = rs.getString("person"); + String a4 = rs.getString("electric"); + String a5=rs.getString("water"); + String a6=rs.getString("m"); + String a7=rs.getString("accept"); + String[] str = {a1,a2,a3,a4,a5,a6,a7}; + data.addRow(str); + }} + + if(r.isSelected()){ + + data.setRowCount(0); + + Connection conn1=DriverManager.getConnection(url, user, passWord); + java.sql.Statement stmt2=conn1.createStatement(); + + String sql1="select * from Sushe where apartment='"+qs.getText()+"'and qinshi='"+qs1.getText()+"'"; + rs= stmt2.executeQuery(sql1); + while(rs.next()){ + String a1= rs.getString("apartment"); + String a2 = rs.getString("qinshi"); + String a3 = rs.getString("person"); + String a4 = rs.getString("electric"); + String a5=rs.getString("water"); + String a6=rs.getString("m"); + String a7=rs.getString("accept"); + String[] str = {a1,a2,a3,a4,a5,a5,a6,a7}; + data.addRow(str); + }} + } catch (SQLException e1) { + + e1.printStackTrace(); + } + + +} + + if(e.getSource()==b1){setVisible(false);} + + + + } + + + + } \ No newline at end of file diff --git a/src/Querylfz.java b/src/Querylfz.java new file mode 100644 index 0000000..c2f2299 --- /dev/null +++ b/src/Querylfz.java @@ -0,0 +1,137 @@ +package Dormitory; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.beans.Statement; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; + +import javax.swing.ButtonGroup; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JRadioButton; +import javax.swing.JScrollPane; +import javax.swing.JTable; +import javax.swing.JTextField; +import javax.swing.table.AbstractTableModel; +import javax.swing.table.DefaultTableModel; + + +public class Querylfz extends JFrame implements ActionListener{ + private static final long serialVersionUID = 1L; + static DefaultTableModel data; + + java.sql.Statement stmt = null; + java.sql.Statement st = null; + ResultSet rs = null; +private JTextField qy = new JTextField(); + private JTextField t = new JTextField(); +private JRadioButton r1 = new JRadioButton(); +private JRadioButton r = new JRadioButton(); +private JButton b = new JButton(); +private JButton b1 = new JButton(); + private ButtonGroup buttonGroup = new ButtonGroup(); +private JTable table; +private JTextField qs = new JTextField(); + + /** + * Launch the application + * @param args + */ + public static void main(String args[]) { + try { + Querylfz frame = new Querylfz(); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * Create the frame + */ + public Querylfz() { + super("查询来访者"); + getContentPane().setLayout(null); + setBounds(100, 100, 550, 395); + setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + + + + + final JLabel label = new JLabel(); + label.setBounds(0, 300, 82, 40); + getContentPane().add(label); + label.setText("请输入学号:"); + + t.setBounds(104, 315, 102, 20); + getContentPane().add(t); + + + + b.setText("确定"); + b.setBounds(291, 325, 91, 23); + b.addActionListener(this); + getContentPane().add(b); + + + b1.setText("取消"); + b1.addActionListener(this); + b1.setBounds(390, 325, 86, 23); + getContentPane().add(b1); + + + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + String [] s = {"学号","来访者姓名","身份证","关系","公寓","寝室","时间"}; + data = new DefaultTableModel(s,0); + final JScrollPane scrollPane = new JScrollPane(); + scrollPane.setBounds(0, 0, 540, 312); + getContentPane().add(scrollPane); table = new JTable(data); + scrollPane.setViewportView(table); + } + + public void actionPerformed(ActionEvent e) { + if(e.getSource()==b){ + + try { + String url = "jdbc:sqlserver://localhost:1433; DatabaseName=TT"; // 指定连接数据库的URL + String user = "sa"; // 指定连接数据库的用户名 + String passWord = "123456"; // 指定连接数据库的密码 + //data.setRowCount(0); + + Connection conn1=DriverManager.getConnection(url, user, passWord); + java.sql.Statement stmt1=conn1.createStatement(); + + + rs=stmt1.executeQuery("select * from Friend where Sno='"+t.getText()+"'"); + while(rs.next()){ + String gony1= rs.getString("Sno"); + String qis1 = rs.getString("Fname"); + String name = rs.getString("sfz"); + String xh1 = rs.getString("relation"); + String cla1=rs.getString("apartment"); + String sex=rs.getString("qinshi"); + String time=rs.getString("Ftime"); + + String[] str = {gony1,qis1,name,xh1,cla1,sex,time}; + data.addRow(str); + } + } catch (SQLException e1) { + + e1.printStackTrace(); + } + + +} + + if(e.getSource()==b1){setVisible(false);} + + + + } + + + + } diff --git a/src/Querysg.java b/src/Querysg.java new file mode 100644 index 0000000..d8220db --- /dev/null +++ b/src/Querysg.java @@ -0,0 +1,169 @@ +package Dormitory; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.beans.Statement; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; + +import javax.swing.ButtonGroup; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JRadioButton; +import javax.swing.JScrollPane; +import javax.swing.JTable; +import javax.swing.JTextField; +import javax.swing.table.AbstractTableModel; +import javax.swing.table.DefaultTableModel; + + +public class Querysg extends JFrame implements ActionListener{ + private static final long serialVersionUID = 1L; + static DefaultTableModel data; + + java.sql.Statement stmt = null; + java.sql.Statement st = null; + ResultSet rs = null; +private JTextField qy = new JTextField(); + private JTextField t = new JTextField(); +private JRadioButton r1 = new JRadioButton(); +private JRadioButton r = new JRadioButton(); +private JButton b = new JButton(); +private JButton b1 = new JButton(); + private ButtonGroup buttonGroup = new ButtonGroup(); +private JTable table; +private JTextField qs = new JTextField(); + + /** + * Launch the application + * @param args + */ + public static void main(String args[]) { + try { + Querysg frame = new Querysg(); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * Create the frame + */ + public Querysg() { + super("查询宿管信息"); + getContentPane().setLayout(null); + setBounds(100, 100, 550, 395); + setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + + + + + buttonGroup.add(r); + r.setText("按公寓号"); + r.setBounds(10, 313, 88, 23); + getContentPane().add(r); + + buttonGroup.add(r1); + r1.setText("编号"); + r1.setBounds(243, 313, 71, 23); + getContentPane().add(r1); + + qy.setBounds(339, 316, 52, 18); + qy.setToolTipText("请输入编号"); + getContentPane().add(qy); + + + b.setText("确定"); + b.setBounds(146, 338, 91, 23); + b.addActionListener(this); + getContentPane().add(b); + + + b1.setText("取消"); + b1.addActionListener(this); + b1.setBounds(291, 340, 86, 23); + getContentPane().add(b1); + + qs.setBounds(104, 315,102, 20); + qs.setToolTipText("请输入公寓"); + getContentPane().add(qs); + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + String [] s = {"宿管编号","姓名","联系方式","性别","公寓"}; + data = new DefaultTableModel(s,0); + final JScrollPane scrollPane = new JScrollPane(); + scrollPane.setBounds(0, 0, 540, 312); + getContentPane().add(scrollPane); + + table = new JTable(data); + scrollPane.setViewportView(table); + + // + } + + public void actionPerformed(ActionEvent e) { + if(e.getSource()==b){ + + try { + String url = "jdbc:sqlserver://localhost:1433; DatabaseName=TT"; // 指定连接数据库的URL + String user = "sa"; // 指定连接数据库的用户名 + String passWord = "123456"; // 指定连接数据库的密码 + + + if(r1.isSelected()){ + String sql ="select * from Manager where Mno='"+qy.getText()+"'"; + + data.setRowCount(0); + + Connection conn1=DriverManager.getConnection(url, user, passWord); + java.sql.Statement stmt1=conn1.createStatement(); + rs=stmt1.executeQuery(sql); + while(rs.next()){ + String gony1= rs.getString("Mno"); + String qis1 = rs.getString("Mname"); + String name = rs.getString("Mphone"); + String xh1 = rs.getString("Msex"); + String cla1=rs.getString("apartment"); + + String[] str = {gony1,qis1,name,xh1,cla1}; + data.addRow(str); + }} + + if(r.isSelected()){ + + data.setRowCount(0); + + Connection conn1=DriverManager.getConnection(url, user, passWord); + java.sql.Statement stmt2=conn1.createStatement(); + String sql1="select * from Manager where apartment='"+qs.getText()+"'"; + rs= stmt2.executeQuery(sql1); + while(rs.next()){ + String gony1= rs.getString("Mno"); + String qis1 = rs.getString("Mname"); + String name = rs.getString("Mphone"); + String xh1 = rs.getString("Msex"); + String cla1=rs.getString("apartment"); + String[] str = {gony1,qis1,name,xh1,cla1}; + data.addRow(str); + }} + } catch (SQLException e1) { + + e1.printStackTrace(); + } + + +} + + if(e.getSource()==b1){setVisible(false);} + + + + } + + + + } + + \ No newline at end of file diff --git a/src/Querystudent.java b/src/Querystudent.java new file mode 100644 index 0000000..4191925 --- /dev/null +++ b/src/Querystudent.java @@ -0,0 +1,176 @@ +package Dormitory; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; + +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTable; +import javax.swing.JTextField; +import javax.swing.JToggleButton; +import javax.swing.JToolBar; + + +public class Querystudent extends JFrame implements ActionListener{ + String[] columnNames; + Object[][] results; + private JPanel panel = new JPanel(); + String s=""; + Statement stmt = null; + Statement st = null; + ResultSet rs = null; + ResultSet rs1 = null; + Statement st1 = null; + ResultSet rs2 = null; + int i=0; + int c=0; + int a=0; + + final JButton b23 = new JButton("重新查询"); + final JButton b = new JButton("学生信息查询"); + final JButton b21 = new JButton("退出"); + private JTextField s1; + private JTextField num; + /** + * Launch the application + * @param args + */ + public static void main(String args[]) { + try { + Querystudent frame = new Querystudent(); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + + public Querystudent() { + super(); + setTitle("\u5B66\u751F\u4FE1\u606F\u67E5\u8BE2"); + getContentPane().setLayout(new BorderLayout()); + getContentPane().setBackground(new Color(255, 255, 255)); + setBounds(100, 100, 467, 350); + setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + + final JToolBar toolBar = new JToolBar(); + getContentPane().add(toolBar, BorderLayout.NORTH); + + b23.setBounds(172, 142, 103, 40); + toolBar.add(b23); + b23.addActionListener(this); + + + + b.addActionListener(this); + b.setBounds(10, 131, 106,40); + toolBar.add(b); + //b21.setBounds(350,142, 103, 40); + + b21.addActionListener(this); + toolBar.add(b21); + + + + panel.setLayout(null); + getContentPane().add(panel); + + final JLabel label = new JLabel(); + label.setBounds(65, 200, 82, 40); + panel.add(label); + label.setText("请输入学号:"); + + num = new JTextField(); + num.setBounds(216, 200, 98, 21); + panel.add(num); + final JScrollPane scrollPane = new JScrollPane(); + scrollPane.setBounds(0,0,450,181); + panel.add(scrollPane); + Other h=new Other(); + a=h.sh();//计算舍员表的人数 + columnNames=new String[]{"公寓","寝室","姓名","个人电话","班级","学号"}; + Object[][] results=new Object[a][6]; + try { + String url = "jdbc:sqlserver://localhost:1433; DatabaseName=TT"; // 指定连接数据库的URL + String user = "sa"; // 指定连接数据库的用户名 + String passWord = "123456"; // 指定连接数据库的密码 + Connection conn=DriverManager.getConnection(url, user, passWord); + java.sql.Statement stmt=conn.createStatement(); + String sql="select apartment,qinshi,Sname,Sphone,Sclass,Sno from Student"; + rs=stmt.executeQuery(sql); + while (rs.next()){ + results[i][0]=rs.getString("apartment"); + results[i][1]=rs.getString("qinshi"); + results[i][2]=rs.getString("Sname"); + results[i][3]=rs.getString("Sphone"); + results[i][4]=rs.getString("Sclass"); + results[i][5]=rs.getString("Sno"); + i++; + } + } catch (SQLException e1) { + + e1.printStackTrace(); + } + + + final JTable table = new JTable(results,columnNames); + scrollPane.setViewportView(table); + + + s1 = new JTextField(); + s1.setText("显示个人信息"); + getContentPane().add(s1, BorderLayout.SOUTH); + // + } + public void actionPerformed(ActionEvent e) { + String url = "jdbc:sqlserver://localhost:1433; DatabaseName=TT"; // 指定连接数据库的URL + String user = "sa"; // 指定连接数据库的用户名 + String passWord = "123456"; // 指定连接数据库的密码 + try { + Connection conn=DriverManager.getConnection(url, user, passWord); + java.sql.Statement stmt=conn.createStatement(); + + if(e.getSource()==b){ + + a=0; + String sql="select * from Student where Sno='"+num.getText()+"'"; + rs=stmt.executeQuery(sql); + while(rs.next()){a++; + s+=rs.getString("apartment")+" "+rs.getString("qinshi")+" "+rs.getString("Sname")+" "+rs.getString("Sphone")+" "+rs.getString("Sclass")+" "+rs.getString("Sno");} + if(a==0){s1.setText("没有这个人的信息");} + else s1.setText(s); + + + } + + + if(e.getSource()==b23){ + rs=null; + s=""; + s1.setText(""); + + + + } + + if(e.getSource()==b21){ + setVisible(false); + + + + } + } catch (SQLException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } +} \ No newline at end of file diff --git a/src/Quitsg.java b/src/Quitsg.java new file mode 100644 index 0000000..ecded25 --- /dev/null +++ b/src/Quitsg.java @@ -0,0 +1,165 @@ +package Dormitory; +import java.awt.Label; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.beans.Statement; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; + +import javax.swing.ButtonGroup; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JRadioButton; +import javax.swing.JScrollPane; +import javax.swing.JTable; +import javax.swing.JTextField; +import javax.swing.table.AbstractTableModel; +import javax.swing.table.DefaultTableModel; + + +public class Quitsg extends JFrame implements ActionListener{ + private static final long serialVersionUID = 1L; + static DefaultTableModel data; + + java.sql.Statement stmt = null; + java.sql.Statement st = null; + ResultSet rs = null; +private JTextField qy = new JTextField(); + private JTextField t = new JTextField(); +private JRadioButton r1 = new JRadioButton(); +private JRadioButton r = new JRadioButton(); +private JButton b = new JButton(); +private JButton b1 = new JButton(); +final JLabel b23 = new JLabel("宿管编号"); +private JTable table; +private JTextField qs = new JTextField(); + + /** + * Launch the application + * @param args + */ + public static void main(String args[]) { + try { + Quitsg frame = new Quitsg(); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * Create the frame + */ + public Quitsg() { + super("宿管离职"); + getContentPane().setLayout(null); + setBounds(100, 100, 550, 395); + setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + + //t.setBounds(104, 315, 102, 20); + //getContentPane().add(t); + b23.setBounds(200,315,100,19); + getContentPane().add(b23); + + b.setText("确定"); + b.setBounds(146, 338, 91, 23); + b.addActionListener(this); + getContentPane().add(b); + + + b1.setText("取消"); + b1.addActionListener(this); + b1.setBounds(291, 340, 86, 23); + getContentPane().add(b1); + + qs.setBounds(280, 315, 100, 19); + qs.setToolTipText("请输入宿管编号"); + getContentPane().add(qs); + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + String [] s = {"宿管编号","姓名","联系方式","性别","公寓楼"}; + data = new DefaultTableModel(s,0); + final JScrollPane scrollPane = new JScrollPane(); + scrollPane.setBounds(0, 0, 540, 312); + getContentPane().add(scrollPane); + + + try { + String url = "jdbc:sqlserver://localhost:1433; DatabaseName=TT"; // 指定连接数据库的URL + String user = "sa"; // 指定连接数据库的用户名 + String passWord = "123456"; // 指定连接数据库的密码 + Connection conn=DriverManager.getConnection(url, user, passWord); + java.sql.Statement stmt=conn.createStatement(); + + + rs=stmt.executeQuery("select *from Manager"); + while(rs.next()){ + String gony1= rs.getString("Mno"); + String name = rs.getString("Mname"); + String xh1 = rs.getString("Mphone"); + String sex= rs.getString("Msex"); + + String a= rs.getString("apartment"); + String[] str = {gony1,name,xh1,sex,a}; + data.addRow(str); + + } + } catch (SQLException e) { + + e.printStackTrace(); } + table = new JTable(data); + scrollPane.setViewportView(table); + + // + } + + public void actionPerformed(ActionEvent e) { + if(e.getSource()==b){ + + try { + String url = "jdbc:sqlserver://localhost:1433; DatabaseName=TT"; // 指定连接数据库的URL + String user = "sa"; // 指定连接数据库的用户名 + String passWord = "123456"; // 指定连接数据库的密码 + Connection conn=DriverManager.getConnection(url, user, passWord); + java.sql.Statement stmt=conn.createStatement(); + + String sql ="delete from Manager where Mno='"+qs.getText()+"'"; + stmt.executeUpdate(sql); + data.setRowCount(0); + + Connection conn1=DriverManager.getConnection(url, user, passWord); + java.sql.Statement stmt1=conn1.createStatement(); + + + rs=stmt1.executeQuery("select *from Manager"); + while(rs.next()){ + String gony1= rs.getString("Mno"); + String qis1 = rs.getString("Mname"); + String name = rs.getString("Mphone"); + String xh1 = rs.getString("Msex"); + String cla1=rs.getString("apartment"); + + String[] str = {gony1,qis1,name,xh1,cla1}; + data.addRow(str); + } + + + } catch (SQLException e1) { + + e1.printStackTrace(); + } + + +} + + if(e.getSource()==b1){setVisible(false);} + + + + } + + + + } diff --git a/src/Studentcheckin.java b/src/Studentcheckin.java new file mode 100644 index 0000000..8acb345 --- /dev/null +++ b/src/Studentcheckin.java @@ -0,0 +1,199 @@ +package Dormitory; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; + +import javax.swing.ButtonGroup; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JTextField; + + +public class Studentcheckin extends JFrame implements ActionListener{ + + private ButtonGroup buttonGroup = new ButtonGroup(); + private JButton b1 = new JButton(); + private JComboBox jbox = new JComboBox(); + private JTextField num1 = new JTextField(); + private JTextField name = new JTextField(); + private JTextField qs = new JTextField(); + private JTextField clas = new JTextField(); + private JComboBox jbox1 = new JComboBox(); + private JTextField time = new JTextField(); + private JTextField phone = new JTextField(); + final JButton b2 = new JButton(); + String p1=""; + String p2=""; + Statement stmt = null; + Statement st = null; + ResultSet rs = null; + Connection conn; + /** + * Launch the application + * @param args + */ + public static void main(String args[]) { + try { + Studentcheckin frame = new Studentcheckin(); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * Create the frame + */ + public Studentcheckin() { + super("学生入住"); + getContentPane().setLayout(null); + setBounds(100, 100, 500, 375); + setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + + final JLabel num = new JLabel(); + num.setText("学号"); + num.setBounds(35, 34, 50, 24); + getContentPane().add(num); + + + num1.setBounds(107, 38, 89, 20); + getContentPane().add(num1); + + final JLabel label = new JLabel(); + label.setText("姓名"); + label.setBounds(35, 89, 50, 20); + getContentPane().add(label); + + + name.setBounds(107, 92, 89, 21); + getContentPane().add(name); + + final JLabel label_1 = new JLabel(); + label_1.setText("公寓"); + label_1.setBounds(25, 136, 60, 23); + getContentPane().add(label_1); + + final JPanel p = new JPanel(); + p.setBounds(101, 136, 120, 30); + getContentPane().add(p); + + + p.add(jbox); + jbox.addItem("泰山9栋"); + jbox.addItem("泰山10栋"); + jbox.addItem("泰山11栋"); + jbox.addItem("泰山12栋"); + jbox.addItem("泰山13栋"); + jbox.addItem("泰山14栋"); + + final JLabel label_2 = new JLabel(); + label_2.setText("寝室"); + label_2.setBounds(25, 195, 60, 22); + getContentPane().add(label_2); + + + qs.setBounds(107, 198, 88, 17); + getContentPane().add(qs); + + final JLabel label_3 = new JLabel(); + label_3.setText("班级"); + label_3.setBounds(21, 245, 43, 16); + getContentPane().add(label_3); + + + clas.setBounds(107, 246, 89, 15); + getContentPane().add(clas); + + final JLabel sex = new JLabel(); + sex.setText("性别"); + sex.setBounds(259, 39, 35, 19); + getContentPane().add(sex); + + final JPanel pl = new JPanel(); + pl.setBounds(300, 34, 103, 34); + getContentPane().add(pl); + + + pl.add(jbox1); + jbox1.addItem("男"); + jbox1.addItem("女"); + + + final JLabel label_4 = new JLabel(); + label_4.setText("入学时间"); + label_4.setBounds(243, 111, 51, 18); + getContentPane().add(label_4); + + + time.setBounds(310, 111, 105, 21); + getContentPane().add(time); + + final JLabel label_5 = new JLabel(); + label_5.setText("个人电话"); + label_5.setBounds(243, 196, 63, 20); + getContentPane().add(label_5); + + + phone.setBounds(310, 197, 106, 21); + getContentPane().add(phone); + + + buttonGroup.add(b1); + b1.setText("确定"); + b1.setBounds(49, 290, 100, 25); + b1.addActionListener(this); + getContentPane().add(b1); + + + buttonGroup.add(b2); + b2.setText("取消"); + b2.setBounds(300, 288, 93, 27); + b2.addActionListener(this); + getContentPane().add(b2); + setVisible(true); + // + } + public void actionPerformed(ActionEvent e) + { + if(e.getSource()==b2){ setVisible(false);} + + if(e.getSource()==b1){ + try{ + + String url = "jdbc:sqlserver://localhost:1433; DatabaseName=TT"; // 指定连接数据库的URL + String user = "sa"; // 指定连接数据库的用户名 + String passWord = "123456"; // 指定连接数据库的密码 + Connection conn=DriverManager.getConnection(url, user, passWord); + java.sql.Statement stmt=conn.createStatement(); + System.out.println("

注册并成功建立student数据库的联接.

"); + }catch(Exception ex){ + System.out.println("

注册或建立student数据库的联接不成功.

");} + } + p1=jbox.getSelectedItem().toString();// + p2=jbox1.getSelectedItem().toString(); // + try { + String url = "jdbc:sqlserver://localhost:1433; DatabaseName=TT"; // 指定连接数据库的URL + String user = "sa"; // 指定连接数据库的用户名 + String passWord = "123456"; // 指定连接数据库的密码 + Connection conn=DriverManager.getConnection(url, user, passWord); + java.sql.Statement stmt=conn.createStatement(); + stmt = conn.createStatement(); + String sql="insert into Student values('"+p1+"','"+qs.getText()+"','"+name.getText()+"','"+num1.getText()+"'," + + "'"+clas.getText()+"','"+p2+"','"+time.getText()+"','"+phone.getText()+"')"; + stmt.executeUpdate(sql); + JOptionPane.showMessageDialog(null,"成功添加数据",null,JOptionPane.WARNING_MESSAGE); + } catch (SQLException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } +} diff --git a/src/Studentmoveout.java b/src/Studentmoveout.java new file mode 100644 index 0000000..92ca2c3 --- /dev/null +++ b/src/Studentmoveout.java @@ -0,0 +1,205 @@ +package Dormitory; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.beans.Statement; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; + +import javax.swing.ButtonGroup; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JRadioButton; +import javax.swing.JScrollPane; +import javax.swing.JTable; +import javax.swing.JTextField; +import javax.swing.table.AbstractTableModel; +import javax.swing.table.DefaultTableModel; + + +public class Studentmoveout extends JFrame implements ActionListener{ + private static final long serialVersionUID = 1L; + static DefaultTableModel data; + + java.sql.Statement stmt = null; + java.sql.Statement st = null; + ResultSet rs = null; +private JTextField qy = new JTextField(); + private JTextField t = new JTextField(); +private JRadioButton r1 = new JRadioButton(); +private JRadioButton r = new JRadioButton(); +private JButton b = new JButton(); +private JButton b1 = new JButton(); + private ButtonGroup buttonGroup = new ButtonGroup(); +private JTable table; +private JTextField qs = new JTextField(); + + /** + * Launch the application + * @param args + */ + public static void main(String args[]) { + try { + Studentmoveout frame = new Studentmoveout(); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * Create the frame + */ + public Studentmoveout() { + super("学生搬离"); + getContentPane().setLayout(null); + setBounds(100, 100, 550, 395); + setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + + + + + buttonGroup.add(r); + r.setText("按学号"); + r.setBounds(10, 313, 88, 23); + getContentPane().add(r); + + + t.setBounds(104, 315, 102, 20); + getContentPane().add(t); + + buttonGroup.add(r1); + r1.setText("按宿舍"); + r1.setBounds(243, 313, 71, 23); + getContentPane().add(r1); + + qy.setBounds(339, 316, 52, 18); + qy.setToolTipText("请输入公寓"); + getContentPane().add(qy); + + + b.setText("确定"); + b.setBounds(146, 338, 91, 23); + b.addActionListener(this); + getContentPane().add(b); + + + b1.setText("取消"); + b1.addActionListener(this); + b1.setBounds(291, 340, 86, 23); + getContentPane().add(b1); + + qs.setBounds(408, 315, 86, 19); + qs.setToolTipText("请输入寝室"); + getContentPane().add(qs); + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + String [] s = {"公寓","寝室","姓名","学号","班级","性别","电话"}; + data = new DefaultTableModel(s,0); + final JScrollPane scrollPane = new JScrollPane(); + scrollPane.setBounds(0, 0, 540, 312); + getContentPane().add(scrollPane); + + try { + String url = "jdbc:sqlserver://localhost:1433; DatabaseName=TT"; // 指定连接数据库的URL + String user = "sa"; // 指定连接数据库的用户名 + String passWord = "123456"; // 指定连接数据库的密码 + Connection conn=DriverManager.getConnection(url, user, passWord); + java.sql.Statement stmt=conn.createStatement(); + + + rs=stmt.executeQuery("select *from Student"); + while(rs.next()){ + String gony1= rs.getString("apartment"); + String qis1 = rs.getString("qinshi"); + String name = rs.getString("Sname"); + String xh1 = rs.getString("Sno"); + String cla1=rs.getString("Sclass"); + String sex= rs.getString("Ssex"); + + String pho1= rs.getString("Sphone"); + String[] str = {gony1,qis1,name,xh1,cla1,sex,pho1}; + data.addRow(str); + + } + } catch (SQLException e) { + + e.printStackTrace(); } + table = new JTable(data); + scrollPane.setViewportView(table); + + // + } + + public void actionPerformed(ActionEvent e) { + if(e.getSource()==b){ + + try { + String url = "jdbc:sqlserver://localhost:1433; DatabaseName=TT"; // 指定连接数据库的URL + String user = "sa"; // 指定连接数据库的用户名 + String passWord = "123456"; // 指定连接数据库的密码 + Connection conn=DriverManager.getConnection(url, user, passWord); + java.sql.Statement stmt=conn.createStatement(); + + if(r1.isSelected()){ + String sql ="delete from Student where apartment='"+qy.getText()+"' and qinshi='"+qs.getText()+"'"; + stmt.executeUpdate(sql); + data.setRowCount(0); + + Connection conn1=DriverManager.getConnection(url, user, passWord); + java.sql.Statement stmt1=conn1.createStatement(); + + + rs=stmt1.executeQuery("select *from Student"); + while(rs.next()){ + String gony1= rs.getString("apartment"); + String qis1 = rs.getString("qinshi"); + String name = rs.getString("Sname"); + String xh1 = rs.getString("Sno"); + String cla1=rs.getString("Sclass"); + String sex=rs.getString("Ssex"); + + String pho1= rs.getString("Sphone"); + String[] str = {gony1,qis1,name,xh1,cla1,sex,pho1}; + data.addRow(str); + }} + + if(r.isSelected()){ String sql ="delete from Student where Sno='"+t.getText()+"'"; + stmt.executeUpdate(sql); + data.setRowCount(0); + + Connection conn1=DriverManager.getConnection(url, user, passWord); + java.sql.Statement stmt1=conn1.createStatement(); + + + rs=stmt1.executeQuery("select *from Student"); + while(rs.next()){ + String gony1= rs.getString("apartment"); + String qis1 = rs.getString("qinshi"); + String name = rs.getString("Sname"); + String xh1 = rs.getString("Sno"); + String cla1=rs.getString("Sclass"); + String sex=rs.getString("Ssex"); + + String pho1= rs.getString("Sphone"); + String[] str = {gony1,qis1,name,xh1,cla1,sex,pho1}; + data.addRow(str); + }} + } catch (SQLException e1) { + + e1.printStackTrace(); + } + + +} + + if(e.getSource()==b1){setVisible(false);} + + + + } + + + + } -- Gitee