diff --git a/Stock Management System.pdf b/Stock Management System.pdf new file mode 100644 index 0000000..fe3df59 Binary files /dev/null and b/Stock Management System.pdf differ diff --git a/StockManagementSystem/build.xml b/StockManagementSystem/build.xml new file mode 100644 index 0000000..94ea39b --- /dev/null +++ b/StockManagementSystem/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project FASSystem. + + + diff --git a/StockManagementSystem/build/built-jar.properties b/StockManagementSystem/build/built-jar.properties new file mode 100644 index 0000000..5c09f68 --- /dev/null +++ b/StockManagementSystem/build/built-jar.properties @@ -0,0 +1,4 @@ +#Wed, 04 Mar 2020 16:15:43 +0530 + + +C\:\\Users\\PRATAP\ KUMAR\\OneDrive\\Documents\\NetBeansProjects\\StockManagementSystem= diff --git a/StockManagementSystem/build/classes/MainFiles/DBConnect.class b/StockManagementSystem/build/classes/MainFiles/DBConnect.class new file mode 100644 index 0000000..5463cda Binary files /dev/null and b/StockManagementSystem/build/classes/MainFiles/DBConnect.class differ diff --git a/StockManagementSystem/build/classes/MainFiles/Inventory$6.class b/StockManagementSystem/build/classes/MainFiles/Inventory$6.class new file mode 100644 index 0000000..079727d Binary files /dev/null and b/StockManagementSystem/build/classes/MainFiles/Inventory$6.class differ diff --git a/StockManagementSystem/build/classes/MainFiles/Inventory.class b/StockManagementSystem/build/classes/MainFiles/Inventory.class new file mode 100644 index 0000000..59a8ecf Binary files /dev/null and b/StockManagementSystem/build/classes/MainFiles/Inventory.class differ diff --git a/StockManagementSystem/build/classes/MainFiles/Login$4.class b/StockManagementSystem/build/classes/MainFiles/Login$4.class new file mode 100644 index 0000000..683833d Binary files /dev/null and b/StockManagementSystem/build/classes/MainFiles/Login$4.class differ diff --git a/StockManagementSystem/build/classes/MainFiles/Login.class b/StockManagementSystem/build/classes/MainFiles/Login.class new file mode 100644 index 0000000..1a00ff5 Binary files /dev/null and b/StockManagementSystem/build/classes/MainFiles/Login.class differ diff --git a/StockManagementSystem/build/classes/MainFiles/Purchase$11.class b/StockManagementSystem/build/classes/MainFiles/Purchase$11.class new file mode 100644 index 0000000..ca8771a Binary files /dev/null and b/StockManagementSystem/build/classes/MainFiles/Purchase$11.class differ diff --git a/StockManagementSystem/build/classes/MainFiles/Purchase.class b/StockManagementSystem/build/classes/MainFiles/Purchase.class new file mode 100644 index 0000000..b1ac71d Binary files /dev/null and b/StockManagementSystem/build/classes/MainFiles/Purchase.class differ diff --git a/StockManagementSystem/build/classes/MainFiles/Searchproduct$12.class b/StockManagementSystem/build/classes/MainFiles/Searchproduct$12.class new file mode 100644 index 0000000..e19b6ad Binary files /dev/null and b/StockManagementSystem/build/classes/MainFiles/Searchproduct$12.class differ diff --git a/StockManagementSystem/build/classes/MainFiles/Searchproduct.class b/StockManagementSystem/build/classes/MainFiles/Searchproduct.class new file mode 100644 index 0000000..b0f65fc Binary files /dev/null and b/StockManagementSystem/build/classes/MainFiles/Searchproduct.class differ diff --git a/StockManagementSystem/build/classes/MainFiles/Slogin$5.class b/StockManagementSystem/build/classes/MainFiles/Slogin$5.class new file mode 100644 index 0000000..5ab6dfd Binary files /dev/null and b/StockManagementSystem/build/classes/MainFiles/Slogin$5.class differ diff --git a/StockManagementSystem/build/classes/MainFiles/Slogin.class b/StockManagementSystem/build/classes/MainFiles/Slogin.class new file mode 100644 index 0000000..a548c65 Binary files /dev/null and b/StockManagementSystem/build/classes/MainFiles/Slogin.class differ diff --git a/StockManagementSystem/build/classes/MainFiles/Track$7.class b/StockManagementSystem/build/classes/MainFiles/Track$7.class new file mode 100644 index 0000000..bb1eeb7 Binary files /dev/null and b/StockManagementSystem/build/classes/MainFiles/Track$7.class differ diff --git a/StockManagementSystem/build/classes/MainFiles/Track.class b/StockManagementSystem/build/classes/MainFiles/Track.class new file mode 100644 index 0000000..e5eb270 Binary files /dev/null and b/StockManagementSystem/build/classes/MainFiles/Track.class differ diff --git a/StockManagementSystem/build/classes/MainFiles/addproduct$4.class b/StockManagementSystem/build/classes/MainFiles/addproduct$4.class new file mode 100644 index 0000000..24f5fcb Binary files /dev/null and b/StockManagementSystem/build/classes/MainFiles/addproduct$4.class differ diff --git a/StockManagementSystem/build/classes/MainFiles/addtocart$5.class b/StockManagementSystem/build/classes/MainFiles/addtocart$5.class new file mode 100644 index 0000000..74911d3 Binary files /dev/null and b/StockManagementSystem/build/classes/MainFiles/addtocart$5.class differ diff --git a/StockManagementSystem/build/classes/MainFiles/addtocart.class b/StockManagementSystem/build/classes/MainFiles/addtocart.class new file mode 100644 index 0000000..f8616ab Binary files /dev/null and b/StockManagementSystem/build/classes/MainFiles/addtocart.class differ diff --git a/StockManagementSystem/build/classes/MainFiles/bill$4.class b/StockManagementSystem/build/classes/MainFiles/bill$4.class new file mode 100644 index 0000000..8d1440e Binary files /dev/null and b/StockManagementSystem/build/classes/MainFiles/bill$4.class differ diff --git a/StockManagementSystem/build/classes/MainFiles/bill.class b/StockManagementSystem/build/classes/MainFiles/bill.class new file mode 100644 index 0000000..b53da00 Binary files /dev/null and b/StockManagementSystem/build/classes/MainFiles/bill.class differ diff --git a/StockManagementSystem/build/classes/MainFiles/mainFrame$11.class b/StockManagementSystem/build/classes/MainFiles/mainFrame$11.class new file mode 100644 index 0000000..c25bec4 Binary files /dev/null and b/StockManagementSystem/build/classes/MainFiles/mainFrame$11.class differ diff --git a/StockManagementSystem/build/classes/MainFiles/mainFrame.class b/StockManagementSystem/build/classes/MainFiles/mainFrame.class new file mode 100644 index 0000000..24bb172 Binary files /dev/null and b/StockManagementSystem/build/classes/MainFiles/mainFrame.class differ diff --git a/StockManagementSystem/build/classes/MainFiles/returnproduct$10.class b/StockManagementSystem/build/classes/MainFiles/returnproduct$10.class new file mode 100644 index 0000000..88677bf Binary files /dev/null and b/StockManagementSystem/build/classes/MainFiles/returnproduct$10.class differ diff --git a/StockManagementSystem/build/classes/MainFiles/returnproduct.class b/StockManagementSystem/build/classes/MainFiles/returnproduct.class new file mode 100644 index 0000000..d282fc6 Binary files /dev/null and b/StockManagementSystem/build/classes/MainFiles/returnproduct.class differ diff --git a/StockManagementSystem/build/classes/MainFiles/supplierapprove$5.class b/StockManagementSystem/build/classes/MainFiles/supplierapprove$5.class new file mode 100644 index 0000000..a297707 Binary files /dev/null and b/StockManagementSystem/build/classes/MainFiles/supplierapprove$5.class differ diff --git a/StockManagementSystem/build/classes/MainFiles/supplierapprove.class b/StockManagementSystem/build/classes/MainFiles/supplierapprove.class new file mode 100644 index 0000000..6fca831 Binary files /dev/null and b/StockManagementSystem/build/classes/MainFiles/supplierapprove.class differ diff --git a/StockManagementSystem/nbproject/build-impl.xml b/StockManagementSystem/nbproject/build-impl.xml new file mode 100644 index 0000000..da0032c --- /dev/null +++ b/StockManagementSystem/nbproject/build-impl.xml @@ -0,0 +1,1420 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No tests executed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set JVM to use for profiling in profiler.info.jvm + Must set profiler agent JVM arguments in profiler.info.jvmargs.agent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + To run this application from the command line without Ant, try: + + java -jar "${dist.jar.resolved}" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + Must select one file in the IDE or set profile.class + This target only works when run from inside the NetBeans IDE. + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + + + Must select some files in the IDE or set test.includes + + + + + Must select one file in the IDE or set run.class + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + Must select some files in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + Must select one file in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + + + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/StockManagementSystem/nbproject/genfiles.properties b/StockManagementSystem/nbproject/genfiles.properties new file mode 100644 index 0000000..a0d5f67 --- /dev/null +++ b/StockManagementSystem/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=eeee8e93 +build.xml.script.CRC32=2ea1514d +build.xml.stylesheet.CRC32=8064a381@1.80.1.48 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=eeee8e93 +nbproject/build-impl.xml.script.CRC32=e71652aa +nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48 diff --git a/StockManagementSystem/nbproject/private/private.properties b/StockManagementSystem/nbproject/private/private.properties new file mode 100644 index 0000000..a9b4267 --- /dev/null +++ b/StockManagementSystem/nbproject/private/private.properties @@ -0,0 +1,2 @@ +file.reference.mysql-connector-java-5.1.6.jar=F:\\softwares\\mysql-connector-java-5.1.37-bin.jar +user.properties.file=C:\\Users\\PRATAP KUMAR\\AppData\\Roaming\\NetBeans\\8.2\\build.properties diff --git a/StockManagementSystem/nbproject/private/private.xml b/StockManagementSystem/nbproject/private/private.xml new file mode 100644 index 0000000..09a7665 --- /dev/null +++ b/StockManagementSystem/nbproject/private/private.xml @@ -0,0 +1,33 @@ + + + + + + file:/C:/Users/PRATAP%20KUMAR/Documents/NetBeansProjects/LibraryManagementSystem/LibraryManagementSystem/src/MainFiles/Purchase.java + file:/C:/Users/PRATAP%20KUMAR/Documents/NetBeansProjects/LibraryManagementSystem/LibraryManagementSystem/src/MainFiles/Slogin.java + file:/C:/Users/PRATAP%20KUMAR/Documents/NetBeansProjects/LibraryManagementSystem/LibraryManagementSystem/src/MainFiles/Login.java + file:/C:/Users/PRATAP%20KUMAR/Documents/NetBeansProjects/LibraryManagementSystem/LibraryManagementSystem/src/MainFiles/bill.java + file:/C:/Users/PRATAP%20KUMAR/Documents/NetBeansProjects/LibraryManagementSystem/LibraryManagementSystem/src/MainFiles/addproduct.java + + + file:/C:/Users/PRATAP%20KUMAR/OneDrive/Documents/NetBeansProjects/StockManagementSystem/src/MainFiles/two.jpg + file:/C:/Users/PRATAP%20KUMAR/OneDrive/Documents/NetBeansProjects/StockManagementSystem/src/MainFiles/Inventory.java + file:/C:/Users/PRATAP%20KUMAR/OneDrive/Documents/NetBeansProjects/StockManagementSystem/src/MainFiles/four.png + file:/C:/Users/PRATAP%20KUMAR/OneDrive/Documents/NetBeansProjects/StockManagementSystem/src/MainFiles/bill.java + file:/C:/Users/PRATAP%20KUMAR/OneDrive/Documents/NetBeansProjects/StockManagementSystem/src/MainFiles/Slogin.java + file:/C:/Users/PRATAP%20KUMAR/OneDrive/Documents/NetBeansProjects/StockManagementSystem/src/MainFiles/Track.java + file:/C:/Users/PRATAP%20KUMAR/OneDrive/Documents/NetBeansProjects/StockManagementSystem/src/MainFiles/one.jpg + file:/C:/Users/PRATAP%20KUMAR/OneDrive/Documents/NetBeansProjects/StockManagementSystem/src/MainFiles/three.png + file:/C:/Users/PRATAP%20KUMAR/OneDrive/Documents/NetBeansProjects/StockManagementSystem/src/MainFiles/epaln.JPG + file:/C:/Users/PRATAP%20KUMAR/OneDrive/Documents/NetBeansProjects/StockManagementSystem/src/MainFiles/Purchase.java + file:/C:/Users/PRATAP%20KUMAR/OneDrive/Documents/NetBeansProjects/StockManagementSystem/src/MainFiles/returnproduct.java + file:/C:/Users/PRATAP%20KUMAR/OneDrive/Documents/NetBeansProjects/StockManagementSystem/src/MainFiles/mainFrame.java + file:/C:/Users/PRATAP%20KUMAR/OneDrive/Documents/NetBeansProjects/StockManagementSystem/src/MainFiles/addproduct.java + file:/C:/Users/PRATAP%20KUMAR/OneDrive/Documents/NetBeansProjects/StockManagementSystem/src/MainFiles/DBConnect.java + file:/C:/Users/PRATAP%20KUMAR/OneDrive/Documents/NetBeansProjects/StockManagementSystem/src/MainFiles/supplierapprove.java + file:/C:/Users/PRATAP%20KUMAR/OneDrive/Documents/NetBeansProjects/StockManagementSystem/src/MainFiles/Login.java + file:/C:/Users/PRATAP%20KUMAR/OneDrive/Documents/NetBeansProjects/StockManagementSystem/src/MainFiles/addtocart.java + file:/C:/Users/PRATAP%20KUMAR/OneDrive/Documents/NetBeansProjects/StockManagementSystem/src/MainFiles/Searchproduct.java + + + diff --git a/StockManagementSystem/nbproject/project.properties b/StockManagementSystem/nbproject/project.properties new file mode 100644 index 0000000..8b6f25a --- /dev/null +++ b/StockManagementSystem/nbproject/project.properties @@ -0,0 +1,77 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processor.options= +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +# Uncomment to specify the preferred debugger connection transport: +#debug.transport=dt_socket +debug.classpath=\ + ${run.classpath} +debug.test.classpath=\ + ${run.test.classpath} +# Files in build.classes.dir which should be excluded from distribution jar +dist.archive.excludes= +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/FASSystem.jar +dist.javadoc.dir=${dist.dir}/javadoc +excludes= +file.reference.mysql-connector-java-5.1.6.jar=/home/vinayak/Desktop/JAR/mysql-connector-java-5.1.6.jar +includes=** +jar.compress=false +javac.classpath=\ + ${libs.MySQLDriver.classpath}:\ + ${file.reference.mysql-connector-java-5.1.6.jar}:\ + ${libs.absolutelayout.classpath} +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.processorpath=\ + ${javac.classpath} +javac.source=1.8 +javac.target=1.8 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +main.class=MainFiles.Login +meta.inf.dir=${src.dir}/META-INF +mkdist.disabled=true +platform.active=default_platform +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project. +# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. +# To set system properties for unit tests define test-sys-prop.name=value: +run.jvmargs= +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/StockManagementSystem/nbproject/project.xml b/StockManagementSystem/nbproject/project.xml new file mode 100644 index 0000000..8dfbc53 --- /dev/null +++ b/StockManagementSystem/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + FASSystem + + + + + + + + + diff --git a/StockManagementSystem/src/MainFiles/DBConnect.java b/StockManagementSystem/src/MainFiles/DBConnect.java new file mode 100644 index 0000000..8f04b48 --- /dev/null +++ b/StockManagementSystem/src/MainFiles/DBConnect.java @@ -0,0 +1,35 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package MainFiles; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.Statement; + +/** + * + * @author vinayak + */ +public class DBConnect { + static Connection ConnectDb() { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + private Connection con; + private Statement st; + private ResultSet rs; + + @SuppressWarnings({"BroadCatchBlock", "TooBroadCatch"}) + public DBConnect(){ + try{ + Class.forName("com.mysql.jdbc.Driver"); + con = DriverManager.getConnection("jdbc:mysql://localhost:3306/bus","root",""); + st = con.createStatement(); + + }catch(Exception e){System.out.println("Error"+e);} + + } +} diff --git a/StockManagementSystem/src/MainFiles/Inventory.form b/StockManagementSystem/src/MainFiles/Inventory.form new file mode 100644 index 0000000..877e33f --- /dev/null +++ b/StockManagementSystem/src/MainFiles/Inventory.form @@ -0,0 +1,194 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="300" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="300" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="300" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="300" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="300" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="300" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + </TableColumnModel> + </Property> + <Property name="rowHeight" type="int" value="30"/> + <Property name="rowMargin" type="int" value="2"/> + <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> + <TableHeader reorderingAllowed="true" resizingAllowed="true"/> + </Property> + </Properties> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JButton" name="jButton1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Display Inventory"/> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jButton1MouseClicked"/> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="jButton2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Back"/> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jButton2MouseClicked"/> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/> + </Events> + </Component> + </SubComponents> +</Form> diff --git a/StockManagementSystem/src/MainFiles/Inventory.java b/StockManagementSystem/src/MainFiles/Inventory.java new file mode 100644 index 0000000..ef5efbe --- /dev/null +++ b/StockManagementSystem/src/MainFiles/Inventory.java @@ -0,0 +1,248 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package MainFiles; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.Statement; +import javax.swing.JOptionPane; +import javax.swing.table.DefaultTableModel; + +/** + * + * @author pratap + */ +public class Inventory extends javax.swing.JFrame { + + /** + * Creates new form SearchBook + */ + public Inventory() { + initComponents(); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents + private void initComponents() { + + jLabel2 = new javax.swing.JLabel(); + jLabel3 = new javax.swing.JLabel(); + jScrollPane1 = new javax.swing.JScrollPane(); + table = new javax.swing.JTable(); + jButton1 = new javax.swing.JButton(); + jButton2 = new javax.swing.JButton(); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + + jLabel2.setFont(new java.awt.Font("Times New Roman", 1, 48)); // NOI18N + jLabel2.setText("Inventory"); + + jLabel3.setFont(new java.awt.Font("Ubuntu", 1, 15)); // NOI18N + + table.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); + table.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + table.setModel(new javax.swing.table.DefaultTableModel( + new Object [][] { + + }, + new String [] { + "Item_Id", "item_name", "quantity", "price", "mfd", "exp", "batchno" + } + ) { + boolean[] canEdit = new boolean [] { + false, false, false, false, false, false, false + }; + + public boolean isCellEditable(int rowIndex, int columnIndex) { + return canEdit [columnIndex]; + } + }); + table.setRowHeight(30); + table.setRowMargin(2); + jScrollPane1.setViewportView(table); + if (table.getColumnModel().getColumnCount() > 0) { + table.getColumnModel().getColumn(0).setMaxWidth(300); + table.getColumnModel().getColumn(1).setMaxWidth(300); + table.getColumnModel().getColumn(2).setMaxWidth(300); + table.getColumnModel().getColumn(3).setMaxWidth(300); + table.getColumnModel().getColumn(4).setMaxWidth(300); + table.getColumnModel().getColumn(5).setMaxWidth(300); + table.getColumnModel().getColumn(6).setMaxWidth(300); + } + + jButton1.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jButton1.setText("Display Inventory"); + jButton1.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + jButton1MouseClicked(evt); + } + }); + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); + + jButton2.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jButton2.setText("Back"); + jButton2.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + jButton2MouseClicked(evt); + } + }); + jButton2.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton2ActionPerformed(evt); + } + }); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(521, 521, 521) + .addComponent(jLabel3)) + .addGroup(layout.createSequentialGroup() + .addGap(379, 379, 379) + .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 295, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addGap(66, 66, 66) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 1016, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(layout.createSequentialGroup() + .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(13, 13, 13))))) + .addContainerGap(31, Short.MAX_VALUE)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(25, 25, 25) + .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(33, 33, 33) + .addComponent(jButton1) + .addGap(32, 32, 32) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 355, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addGap(19, 19, 19) + .addComponent(jButton2))) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton2MouseClicked + this.setVisible(false); + mainFrame mm=new mainFrame(); + mm.setVisible(true); + }//GEN-LAST:event_jButton2MouseClicked + + private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked + //String ii=.getText(); + DefaultTableModel model = (DefaultTableModel) table.getModel(); + try { + Class.forName("java.sql.DriverManager"); + Connection con = (Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/fs", "root", ""); + + Statement stmt = con.createStatement(); + String query = "select * from inventory "; + ResultSet rs=stmt.executeQuery(query); + + while(rs.next()) { + String id = rs.getString("item_id"); + String name = rs.getString("item_name"); + String qun = rs.getString("quantity"); + String price = rs.getString("price"); + + String mfd = rs.getString("mfd"); + String exp = rs.getString("exp"); + String batchno = rs.getString("batchno"); + + + + model.addRow(new Object[] {id,name,qun,price,mfd,exp,batchno}); + } + rs.close(); + //stmt.close(); + //con.close(); + } catch (Exception e) { + JOptionPane.showMessageDialog(this, e.getMessage()); + //e.printStackTrace(); + } + }//GEN-LAST:event_jButton1MouseClicked + + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_jButton1ActionPerformed + + private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_jButton2ActionPerformed + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + /* Set the Nimbus look and feel */ + //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> + /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. + * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html + */ + try { + for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { + if ("Nimbus".equals(info.getName())) { + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } catch (ClassNotFoundException ex) { + java.util.logging.Logger.getLogger(Inventory.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(Inventory.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(Inventory.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(Inventory.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new Inventory().setVisible(true); + + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jButton1; + private javax.swing.JButton jButton2; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JTable table; + // End of variables declaration//GEN-END:variables +} diff --git a/StockManagementSystem/src/MainFiles/Login.form b/StockManagementSystem/src/MainFiles/Login.form new file mode 100644 index 0000000..e55302d --- /dev/null +++ b/StockManagementSystem/src/MainFiles/Login.form @@ -0,0 +1,187 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JDialogFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="2"/> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="be" green="65" red="75" type="rgb"/> + </Property> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + <SyntheticProperty name="generateCenter" type="boolean" value="false"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="151" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="jLabel3" min="-2" pref="138" max="-2" attributes="0"/> + <Component id="jLabel2" min="-2" pref="138" max="-2" attributes="0"/> + </Group> + <EmptySpace min="99" pref="99" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="uname" alignment="0" min="-2" pref="139" max="-2" attributes="0"/> + <Component id="pass" alignment="0" min="-2" pref="139" max="-2" attributes="0"/> + </Group> + </Group> + <Component id="jLabel1" alignment="0" min="-2" pref="362" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="45" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <Component id="login" min="-2" pref="126" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="196" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <Component id="jButton1" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="134" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + <Component id="jLabel5" min="-2" pref="635" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="438" max="-2" attributes="0"/> + <Component id="jLabel4" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace pref="72" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="50" max="-2" attributes="0"/> + <Component id="jLabel4" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="53" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Group type="102" attributes="0"> + <Component id="jLabel1" min="-2" pref="56" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="54" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="uname" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="63" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="pass" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel3" alignment="3" min="-2" pref="28" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="71" max="-2" attributes="0"/> + <Component id="login" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="jButton1" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <EmptySpace min="16" pref="16" max="-2" attributes="0"/> + <Component id="jLabel5" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace pref="86" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="36" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value=" RETAILER LOGIN "/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="uname"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="pass"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="login"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="LOGIN"/> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="loginMouseClicked"/> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="loginActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Username"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel3"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Password"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="jButton1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="SUPPILER LOGIN"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel4"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="2" name="C:\Users\PRATAP KUMAR\OneDrive\Documents\NetBeansProjects\StockManagementSystem\src\MainFiles\epaln.JPG"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel5"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="2" name="C:\Users\PRATAP KUMAR\OneDrive\Documents\NetBeansProjects\StockManagementSystem\src\MainFiles\one.jpg"/> + </Property> + </Properties> + </Component> + </SubComponents> +</Form> diff --git a/StockManagementSystem/src/MainFiles/Login.java b/StockManagementSystem/src/MainFiles/Login.java new file mode 100644 index 0000000..5e967e5 --- /dev/null +++ b/StockManagementSystem/src/MainFiles/Login.java @@ -0,0 +1,241 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package MainFiles; + +import javax.swing.JOptionPane; + +/** + * + * @author pratap + */ +public class Login extends javax.swing.JDialog { + + /** + * Creates new form Login + */ + public Login(java.awt.Frame parent, boolean modal) { + super(parent, modal); + initComponents(); + } + + Login() { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents + private void initComponents() { + + jLabel1 = new javax.swing.JLabel(); + uname = new javax.swing.JTextField(); + pass = new javax.swing.JTextField(); + login = new javax.swing.JButton(); + jLabel2 = new javax.swing.JLabel(); + jLabel3 = new javax.swing.JLabel(); + jButton1 = new javax.swing.JButton(); + jLabel4 = new javax.swing.JLabel(); + jLabel5 = new javax.swing.JLabel(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setBackground(new java.awt.Color(117, 101, 190)); + + jLabel1.setFont(new java.awt.Font("Times New Roman", 1, 36)); // NOI18N + jLabel1.setText(" RETAILER LOGIN "); + + uname.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + + pass.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + + login.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + login.setText("LOGIN"); + login.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + loginMouseClicked(evt); + } + }); + login.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + loginActionPerformed(evt); + } + }); + + jLabel2.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel2.setText("Username"); + + jLabel3.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel3.setText("Password"); + + jButton1.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jButton1.setText("SUPPILER LOGIN"); + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); + + jLabel4.setIcon(new javax.swing.ImageIcon("C:\\Users\\PRATAP KUMAR\\OneDrive\\Documents\\NetBeansProjects\\StockManagementSystem\\src\\MainFiles\\epaln.JPG")); // NOI18N + + jLabel5.setIcon(new javax.swing.ImageIcon("C:\\Users\\PRATAP KUMAR\\OneDrive\\Documents\\NetBeansProjects\\StockManagementSystem\\src\\MainFiles\\one.jpg")); // NOI18N + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(151, 151, 151) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(99, 99, 99) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(uname, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(pass, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 362, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(45, 45, 45)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addComponent(login, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(196, 196, 196)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addComponent(jButton1) + .addGap(134, 134, 134))))) + .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 635, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addGap(438, 438, 438) + .addComponent(jLabel4))) + .addContainerGap(72, Short.MAX_VALUE)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(50, 50, 50) + .addComponent(jLabel4) + .addGap(53, 53, 53) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(54, 54, 54) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(uname, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel2)) + .addGap(63, 63, 63) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(pass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(71, 71, 71) + .addComponent(login) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jButton1)) + .addGroup(layout.createSequentialGroup() + .addGap(16, 16, 16) + .addComponent(jLabel5))) + .addContainerGap(86, Short.MAX_VALUE)) + ); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + private void loginMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_loginMouseClicked + if(evt.getSource()==login) + { + if(uname.getText().length()==0 && pass.getText().length()==0) + { + JOptionPane.showMessageDialog(null,"!!Enter the valid entries.."); + } + else + if(uname.getText().equals("admin") && pass.getText().equals("123")) + { + this.setVisible(false); + mainFrame d = new mainFrame(); + d.setVisible(true); + } + else + { + JOptionPane.showMessageDialog(null,"Invalid!! Try again.."); + uname.setText(null); + pass.setText(null); + + } + } + }//GEN-LAST:event_loginMouseClicked + + private void loginActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_loginActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_loginActionPerformed + + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + this.setVisible(false); + Slogin ab1 = new Slogin(); + ab1.setVisible(true); // TODO add your handling code here: + }//GEN-LAST:event_jButton1ActionPerformed + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + /* Set the Nimbus look and feel */ + //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> + /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. + * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html + */ + try { + for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { + if ("Nimbus".equals(info.getName())) { + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } catch (ClassNotFoundException ex) { + java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + //</editor-fold> + + /* Create and display the dialog */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + Login dialog = new Login(new javax.swing.JFrame(), true); + dialog.addWindowListener(new java.awt.event.WindowAdapter() { + @Override + public void windowClosing(java.awt.event.WindowEvent e) { + System.exit(0); + } + }); + dialog.setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jButton1; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JLabel jLabel4; + private javax.swing.JLabel jLabel5; + private javax.swing.JButton login; + private javax.swing.JTextField pass; + private javax.swing.JTextField uname; + // End of variables declaration//GEN-END:variables +} diff --git a/StockManagementSystem/src/MainFiles/Purchase.form b/StockManagementSystem/src/MainFiles/Purchase.form new file mode 100644 index 0000000..5d4d3d9 --- /dev/null +++ b/StockManagementSystem/src/MainFiles/Purchase.form @@ -0,0 +1,389 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="3"/> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="0" green="ff" red="0" type="rgb"/> + </Property> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + <SyntheticProperty name="generateCenter" type="boolean" value="false"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="48" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel8" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="jLabel9" min="-2" max="-2" attributes="0"/> + <Component id="jLabel6" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="27" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Component id="jTextField4" pref="177" max="32767" attributes="0"/> + <Component id="jTextField5" max="32767" attributes="0"/> + </Group> + <EmptySpace max="32767" attributes="0"/> + <Component id="jScrollPane1" min="-2" pref="748" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="50" max="-2" attributes="0"/> + <Component id="jButton3" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="63" max="-2" attributes="0"/> + <Component id="jButton5" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="jTextField3" alignment="1" min="-2" pref="177" max="-2" attributes="0"/> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel4" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="jLabel5" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="103" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jTextField2" min="-2" pref="177" max="-2" attributes="0"/> + <Component id="jTextField1" min="-2" pref="177" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <EmptySpace min="-2" pref="241" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jButton1" alignment="0" min="-2" pref="117" max="-2" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel2" min="-2" pref="238" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="42" max="-2" attributes="0"/> + <Component id="bid" min="-2" pref="169" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="417" max="-2" attributes="0"/> + <Component id="jLabel1" min="-2" pref="163" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="571" max="-2" attributes="0"/> + <Component id="jButton2" min="-2" pref="95" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + </Group> + </Group> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jButton2" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="34" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel2" min="-2" max="-2" attributes="0"/> + <Component id="bid" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="59" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel4" min="-2" max="-2" attributes="0"/> + <Component id="jTextField2" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="20" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jTextField1" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="40" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel8" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jTextField3" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="48" max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="jTextField4" min="-2" max="-2" attributes="0"/> + <Component id="jLabel9" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="60" max="-2" attributes="0"/> + <Component id="jLabel6" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="92" max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace pref="60" max="32767" attributes="0"/> + <Component id="jTextField5" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="86" max="-2" attributes="0"/> + </Group> + </Group> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jButton3" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jButton5" alignment="3" min="-2" pref="37" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="48" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="36" max="-2" attributes="0"/> + <Component id="jButton1" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="33" max="-2" attributes="0"/> + <Component id="jScrollPane1" min="-2" pref="277" max="-2" attributes="0"/> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Search Product By Id"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="bid"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + </Properties> + </Component> + <Container class="javax.swing.JScrollPane" name="jScrollPane1"> + <AuxValues> + <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> + </AuxValues> + + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> + <SubComponents> + <Component class="javax.swing.JTable" name="table"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> + <Table columnCount="4" rowCount="0"> + <Column editable="false" title="item_id" type="java.lang.Object"/> + <Column editable="false" title="item_name" type="java.lang.Object"/> + <Column editable="false" title="quntatity" type="java.lang.Object"/> + <Column editable="false" title="price" type="java.lang.Object"/> + </Table> + </Property> + <Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor"> + <TableColumnModel selectionModel="0"> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + </TableColumnModel> + </Property> + <Property name="rowHeight" type="int" value="25"/> + <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> + <TableHeader reorderingAllowed="true" resizingAllowed="true"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="tableMouseClicked"/> + </Events> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JButton" name="jButton1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor"> + <FontInfo relative="true"> + <Font bold="true" component="jButton1" property="font" relativeSize="true" size="11"/> + </FontInfo> + </Property> + <Property name="text" type="java.lang.String" value="Search"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jButton1MouseClicked"/> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="jButton2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor"> + <FontInfo relative="true"> + <Font bold="true" component="jButton2" property="font" relativeSize="true" size="11"/> + </FontInfo> + </Property> + <Property name="text" type="java.lang.String" value="Back"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jButton2MouseClicked"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel4"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Item_Id:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel5"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Item_Name:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel6"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Total Price:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel8"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Qunatity (in lit/kg):"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel9"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Price Per Unit:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="jTextField1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor"> + <FontInfo relative="true"> + <Font bold="true" component="jTextField1" property="font" relativeSize="true" size="11"/> + </FontInfo> + </Property> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jTextField1ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JTextField" name="jTextField2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor"> + <FontInfo relative="true"> + <Font bold="true" component="jTextField2" property="font" relativeSize="true" size="11"/> + </FontInfo> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="jTextField3"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jTextField3MouseClicked"/> + <EventHandler event="mouseEntered" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jTextField3MouseEntered"/> + <EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jTextField3MouseExited"/> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jTextField3ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JTextField" name="jTextField4"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="jTextField5"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="jButton3"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor"> + <FontInfo relative="true"> + <Font bold="true" component="jButton3" property="font" relativeSize="true" size="11"/> + </FontInfo> + </Property> + <Property name="text" type="java.lang.String" value="Purchase"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton3ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="36" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Purchase"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="jButton5"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Purchase Return"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton5ActionPerformed"/> + </Events> + </Component> + </SubComponents> +</Form> diff --git a/StockManagementSystem/src/MainFiles/Purchase.java b/StockManagementSystem/src/MainFiles/Purchase.java new file mode 100644 index 0000000..5d1473e --- /dev/null +++ b/StockManagementSystem/src/MainFiles/Purchase.java @@ -0,0 +1,533 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package MainFiles; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import javax.swing.JOptionPane; +import javax.swing.table.DefaultTableModel; + +/** + * + * @author pratap + */ +public class Purchase extends javax.swing.JFrame { + + /** + * Creates new form SearchBook + */ + public Purchase() { + initComponents(); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents + private void initComponents() { + + jLabel2 = new javax.swing.JLabel(); + bid = new javax.swing.JTextField(); + jScrollPane1 = new javax.swing.JScrollPane(); + table = new javax.swing.JTable(); + jButton1 = new javax.swing.JButton(); + jButton2 = new javax.swing.JButton(); + jLabel4 = new javax.swing.JLabel(); + jLabel5 = new javax.swing.JLabel(); + jLabel6 = new javax.swing.JLabel(); + jLabel8 = new javax.swing.JLabel(); + jLabel9 = new javax.swing.JLabel(); + jTextField1 = new javax.swing.JTextField(); + jTextField2 = new javax.swing.JTextField(); + jTextField3 = new javax.swing.JTextField(); + jTextField4 = new javax.swing.JTextField(); + jTextField5 = new javax.swing.JTextField(); + jButton3 = new javax.swing.JButton(); + jLabel1 = new javax.swing.JLabel(); + jButton5 = new javax.swing.JButton(); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + setBackground(new java.awt.Color(0, 255, 0)); + + jLabel2.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel2.setText("Search Product By Id"); + + bid.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + + table.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + table.setModel(new javax.swing.table.DefaultTableModel( + new Object [][] { + + }, + new String [] { + "item_id", "item_name", "quntatity", "price" + } + ) { + boolean[] canEdit = new boolean [] { + false, false, false, false + }; + + public boolean isCellEditable(int rowIndex, int columnIndex) { + return canEdit [columnIndex]; + } + }); + table.setRowHeight(25); + table.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + tableMouseClicked(evt); + } + }); + jScrollPane1.setViewportView(table); + + jButton1.setFont(jButton1.getFont().deriveFont(jButton1.getFont().getStyle() | java.awt.Font.BOLD, jButton1.getFont().getSize()+11)); + jButton1.setText("Search"); + jButton1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + jButton1.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + jButton1MouseClicked(evt); + } + }); + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); + + jButton2.setFont(jButton2.getFont().deriveFont(jButton2.getFont().getStyle() | java.awt.Font.BOLD, jButton2.getFont().getSize()+11)); + jButton2.setText("Back"); + jButton2.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + jButton2.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + jButton2MouseClicked(evt); + } + }); + + jLabel4.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel4.setText("Item_Id:"); + + jLabel5.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel5.setText("Item_Name:"); + + jLabel6.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel6.setText("Total Price:"); + + jLabel8.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel8.setText("Qunatity (in lit/kg):"); + + jLabel9.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel9.setText("Price Per Unit:"); + + jTextField1.setFont(jTextField1.getFont().deriveFont(jTextField1.getFont().getStyle() | java.awt.Font.BOLD, jTextField1.getFont().getSize()+11)); + jTextField1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jTextField1ActionPerformed(evt); + } + }); + + jTextField2.setFont(jTextField2.getFont().deriveFont(jTextField2.getFont().getStyle() | java.awt.Font.BOLD, jTextField2.getFont().getSize()+11)); + + jTextField3.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jTextField3.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + jTextField3MouseClicked(evt); + } + public void mouseEntered(java.awt.event.MouseEvent evt) { + jTextField3MouseEntered(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + jTextField3MouseExited(evt); + } + }); + jTextField3.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jTextField3ActionPerformed(evt); + } + }); + + jTextField4.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + + jTextField5.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + + jButton3.setFont(jButton3.getFont().deriveFont(jButton3.getFont().getStyle() | java.awt.Font.BOLD, jButton3.getFont().getSize()+11)); + jButton3.setText("Purchase"); + jButton3.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton3ActionPerformed(evt); + } + }); + + jLabel1.setFont(new java.awt.Font("Times New Roman", 1, 36)); // NOI18N + jLabel1.setText("Purchase"); + + jButton5.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jButton5.setText("Purchase Return"); + jButton5.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton5ActionPerformed(evt); + } + }); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(48, 48, 48) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel8) + .addComponent(jLabel9) + .addComponent(jLabel6)) + .addGap(27, 27, 27) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(jTextField4, javax.swing.GroupLayout.DEFAULT_SIZE, 177, Short.MAX_VALUE) + .addComponent(jTextField5)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 748, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(50, 50, 50) + .addComponent(jButton3) + .addGap(63, 63, 63) + .addComponent(jButton5)) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 177, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel4) + .addComponent(jLabel5)) + .addGap(103, 103, 103) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 177, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 177, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addGap(241, 241, 241) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 238, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(42, 42, 42) + .addComponent(bid, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addGroup(layout.createSequentialGroup() + .addGap(417, 417, 417) + .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(571, 571, 571) + .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(0, 0, Short.MAX_VALUE))) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jButton2) + .addComponent(jLabel1)) + .addGap(34, 34, 34) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel2) + .addComponent(bid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGroup(layout.createSequentialGroup() + .addGap(59, 59, 59) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel4) + .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(20, 20, 20) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel5) + .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(40, 40, 40) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel8) + .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(48, 48, 48) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel9)) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(60, 60, 60) + .addComponent(jLabel6) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 92, Short.MAX_VALUE)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 60, Short.MAX_VALUE) + .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(86, 86, 86))) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jButton3) + .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(48, 48, 48)) + .addGroup(layout.createSequentialGroup() + .addGap(36, 36, 36) + .addComponent(jButton1) + .addGap(33, 33, 33) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 277, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 0, Short.MAX_VALUE)))) + ); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked + String ii=bid.getText(); + DefaultTableModel model = (DefaultTableModel) table.getModel(); + try { + Class.forName("java.sql.DriverManager"); + Connection con = (Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/fs", "root", ""); + + Statement stmt = con.createStatement(); + String query = "select * from inventory where item_id='"+ii+"' "; + ResultSet rs=stmt.executeQuery(query); + + while(rs.next()) { + String id = rs.getString("item_id"); + String name = rs.getString("item_name"); + String qun = rs.getString("quantity"); + String price = rs.getString("price"); + + + + + + model.addRow(new Object[] {id,name,qun,price}); + } + rs.close(); + //stmt.close(); + //con.close(); + } catch (Exception e) { + JOptionPane.showMessageDialog(this, e.getMessage()); + //e.printStackTrace(); + } + + }//GEN-LAST:event_jButton1MouseClicked + + private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton2MouseClicked + this.setVisible(false); + mainFrame mm=new mainFrame(); + mm.setVisible(true); + }//GEN-LAST:event_jButton2MouseClicked + + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + jTextField1.setText(""); + jTextField2.setText(""); + jTextField3.setText(""); + jTextField4.setText(""); + jTextField5.setText(""); + + +// TODO add your handling code here: + }//GEN-LAST:event_jButton1ActionPerformed + + private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField1ActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_jTextField1ActionPerformed + + private void tableMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tableMouseClicked + DefaultTableModel model=(DefaultTableModel)table.getModel(); + int selectedRowIndex =table.getSelectedRow(); + jTextField1.setText(model.getValueAt(selectedRowIndex,0).toString()); + jTextField2.setText(model.getValueAt(selectedRowIndex,1).toString()); + //String s=model.getValueAt(selectedRowIndex,2).toString(); + jTextField4.setText(model.getValueAt(selectedRowIndex,3).toString()); + // jTextField5.setText(model.getValueAt(selectedRowIndex,0).toString()); + + + }//GEN-LAST:event_tableMouseClicked + + private void jTextField3MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextField3MouseEntered + + + }//GEN-LAST:event_jTextField3MouseEntered + + private void jTextField3MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextField3MouseClicked + // TODO add your handling code here: + }//GEN-LAST:event_jTextField3MouseClicked + + private void jTextField3MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextField3MouseExited + String qun= jTextField3.getText(); + String pri=jTextField4.getText(); + int N3=Integer.parseInt(pri); + int N1=Integer.parseInt(qun); + int N2=N1; + int N4=N1*(N3-10); + jTextField5.setText(String.valueOf(N4)); // TODO add your handling code here: + }//GEN-LAST:event_jTextField3MouseExited + + private void jTextField3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField3ActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_jTextField3ActionPerformed + + private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed + String item_id=jTextField1.getText(); + String item_name=jTextField2.getText(); + String quantity=jTextField3.getText(); + String price=jTextField4.getText(); + String totprice = jTextField5.getText(); + + + try{ + Class.forName("com.mysql.jdbc.Driver"); + Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/fs","root",""); + String query = "insert into purchase(item_id,item_name,quantity,price,totprice) values('"+item_id+"','"+item_name+"','"+quantity+"','"+price+"','"+totprice+"')"; + Statement smt3=con.createStatement(); + //ResultSet rs=smt3.executeQueryUpdate(query); + + int success=smt3.executeUpdate(query); + if(success==1) + { + JOptionPane.showMessageDialog(this, "Product Successfully Requested "); + //emp1.showMessageDialog(this, "Problem in Saving. Retry"); + } + else + { + + JOptionPane.showMessageDialog(this, "Problem in Saving. Retry"); + } + + + } + + catch(Exception e) + { + JOptionPane.showMessageDialog(this, e.getMessage()); + } // TODO add your handling code here: + /* + new addtocart().setVisible(true);*/ + }//GEN-LAST:event_jButton3ActionPerformed + + private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed + workWithDatabase(); +} + public void workWithDatabase() + { + Connection c=null; + Statement s=null; + ResultSet rs1=null; + int flag=0; + try{ + + Class.forName("com.mysql.jdbc.Driver"); + c=DriverManager.getConnection("jdbc:mysql://localhost/fs","root",""); + s=c.createStatement(); + + DefaultTableModel model = (DefaultTableModel) table.getModel(); + int selectedRowIndex =table.getSelectedRow(); + String a=model.getValueAt(selectedRowIndex,0).toString(); + + // String c1=model.getValueAt(selectedRowIndex,2).toString(); + String c1=jTextField3.getText(); + + String s1=a; + + // rs1 = s.executeQuery ("select quantity from inventory where item_id="+"'"+s1+"'"); + + int id=Integer.parseInt(c1); + rs1 = s.executeQuery ("select quantity from inventory where item_id="+"'"+s1+"'"); + + + // jLabel6.setText(s1); + + while(rs1.next()) { + String id1=rs1.getString("quantity"); + int id2=Integer.parseInt(id1); + + int id3=id2-id; + s.executeUpdate("Update inventory set quantity="+id3+" where item_id="+"'"+s1+"'"); + + } + /* while(rs1.next()) + { + String quantity1=rs1.getString("quantity"); + String q3 = quantity1; + + + }*/ + rs1.close(); + + + + +} + catch(SQLException | ClassNotFoundException e1) + { + System.out.println(e1); + } + + // TODO add your handling code here: + }//GEN-LAST:event_jButton5ActionPerformed + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + /* Set the Nimbus look and feel */ + //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> + /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. + * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html + */ + try { + for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { + if ("Nimbus".equals(info.getName())) { + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } catch (ClassNotFoundException ex) { + java.util.logging.Logger.getLogger(Purchase.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(Purchase.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(Purchase.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(Purchase.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new Purchase().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JTextField bid; + private javax.swing.JButton jButton1; + private javax.swing.JButton jButton2; + private javax.swing.JButton jButton3; + private javax.swing.JButton jButton5; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel4; + private javax.swing.JLabel jLabel5; + private javax.swing.JLabel jLabel6; + private javax.swing.JLabel jLabel8; + private javax.swing.JLabel jLabel9; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JTextField jTextField1; + private javax.swing.JTextField jTextField2; + private javax.swing.JTextField jTextField3; + private javax.swing.JTextField jTextField4; + private javax.swing.JTextField jTextField5; + private javax.swing.JTable table; + // End of variables declaration//GEN-END:variables +} diff --git a/StockManagementSystem/src/MainFiles/Searchproduct.form b/StockManagementSystem/src/MainFiles/Searchproduct.form new file mode 100644 index 0000000..39979bd --- /dev/null +++ b/StockManagementSystem/src/MainFiles/Searchproduct.form @@ -0,0 +1,425 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="3"/> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="0" green="ff" red="33" type="rgb"/> + </Property> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="36" style="1"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="0" green="ff" red="0" type="rgb"/> + </Property> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + <SyntheticProperty name="generateCenter" type="boolean" value="false"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="jButton2" min="-2" pref="95" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="jLabel1" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="331" max="-2" attributes="0"/> + <Component id="jButton4" min="-2" pref="236" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="31" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel6" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="155" max="-2" attributes="0"/> + <Component id="jTextField5" max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel5" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="152" max="-2" attributes="0"/> + <Component id="jTextField2" min="-2" pref="158" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel9" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="jLabel8" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="76" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Component id="jTextField3" max="32767" attributes="0"/> + <Component id="jTextField4" min="-2" pref="158" max="-2" attributes="0"/> + </Group> + </Group> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="-2" pref="10" max="-2" attributes="0"/> + <Component id="jLabel4" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="jTextField1" min="-2" pref="158" max="-2" attributes="0"/> + </Group> + </Group> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jScrollPane1" max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="162" max="-2" attributes="0"/> + <Component id="jLabel2" min="-2" pref="195" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="35" max="-2" attributes="0"/> + <Component id="bid" min="-2" pref="149" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="jButton1" min="-2" pref="29" max="-2" attributes="0"/> + <EmptySpace min="0" pref="195" max="32767" attributes="0"/> + </Group> + </Group> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="136" max="-2" attributes="0"/> + <Component id="jButton3" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="900" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="52" max="-2" attributes="0"/> + <Component id="jLabel1" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="27" max="-2" attributes="0"/> + <Component id="jButton2" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jButton4" min="-2" pref="66" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="-2" pref="99" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jTextField1" alignment="3" min="-2" pref="44" max="-2" attributes="0"/> + <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="35" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jButton1" alignment="0" min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel2" alignment="3" max="32767" attributes="0"/> + <Component id="bid" alignment="3" min="-2" pref="37" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="-2" pref="48" max="-2" attributes="0"/> + </Group> + </Group> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jTextField2" alignment="3" min="-2" pref="48" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="20" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel8" min="-2" max="-2" attributes="0"/> + <Component id="jTextField3" min="-2" pref="42" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="26" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel9" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jTextField4" alignment="3" min="-2" pref="43" max="-2" attributes="0"/> + </Group> + <EmptySpace max="32767" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jTextField5" alignment="3" min="-2" pref="44" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="51" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="22" max="-2" attributes="0"/> + <Component id="jScrollPane1" min="-2" pref="265" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + </Group> + </Group> + <Component id="jButton3" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="207" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Search Product"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="bid"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + </Properties> + </Component> + <Container class="javax.swing.JScrollPane" name="jScrollPane1"> + <AuxValues> + <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> + </AuxValues> + + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> + <SubComponents> + <Component class="javax.swing.JTable" name="table"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> + <Table columnCount="7" rowCount="0"> + <Column editable="false" title="item_id" type="java.lang.Object"/> + <Column editable="false" title="item_name" type="java.lang.Object"/> + <Column editable="false" title="quntatity" type="java.lang.Object"/> + <Column editable="false" title="price" type="java.lang.Object"/> + <Column editable="false" title="mfd" type="java.lang.Object"/> + <Column editable="false" title="exp" type="java.lang.Object"/> + <Column editable="false" title="batchno" type="java.lang.Object"/> + </Table> + </Property> + <Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor"> + <TableColumnModel selectionModel="0"> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="120" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="20" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="140" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="150" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="40" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + </TableColumnModel> + </Property> + <Property name="rowHeight" type="int" value="25"/> + <Property name="rowMargin" type="int" value="2"/> + <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> + <TableHeader reorderingAllowed="true" resizingAllowed="true"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="tableMouseClicked"/> + </Events> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JButton" name="jButton1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor"> + <FontInfo relative="true"> + <Font bold="true" component="jButton1" property="font" relativeSize="true" size="11"/> + </FontInfo> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="2" name="C:\Users\PRATAP KUMAR\OneDrive\Desktop\four.png"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jButton1MouseClicked"/> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="jButton2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor"> + <FontInfo relative="true"> + <Font bold="true" component="jButton2" property="font" relativeSize="true" size="11"/> + </FontInfo> + </Property> + <Property name="text" type="java.lang.String" value="Back"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jButton2MouseClicked"/> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel4"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Item_Id:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel5"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Item_Name:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel6"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Total Price:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel8"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Qunatity (in lit/kg):"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel9"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Price Per Unit:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="jTextField1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor"> + <FontInfo relative="true"> + <Font bold="true" component="jTextField1" property="font" relativeSize="true" size="11"/> + </FontInfo> + </Property> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jTextField1ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JTextField" name="jTextField2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor"> + <FontInfo relative="true"> + <Font bold="true" component="jTextField2" property="font" relativeSize="true" size="11"/> + </FontInfo> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="jTextField3"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jTextField3MouseClicked"/> + <EventHandler event="mouseEntered" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jTextField3MouseEntered"/> + <EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jTextField3MouseExited"/> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jTextField3ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JTextField" name="jTextField4"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="jTextField5"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="jButton3"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor"> + <FontInfo relative="true"> + <Font bold="true" component="jButton3" property="font" relativeSize="true" size="11"/> + </FontInfo> + </Property> + <Property name="text" type="java.lang.String" value="Add to cart"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton3ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="jButton4"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="36" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="View Cart"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton4ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="36" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Search Product"/> + </Properties> + </Component> + </SubComponents> +</Form> diff --git a/StockManagementSystem/src/MainFiles/Searchproduct.java b/StockManagementSystem/src/MainFiles/Searchproduct.java new file mode 100644 index 0000000..0f6ba79 --- /dev/null +++ b/StockManagementSystem/src/MainFiles/Searchproduct.java @@ -0,0 +1,502 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package MainFiles; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.Statement; +import javax.swing.JOptionPane; +import javax.swing.table.DefaultTableModel; + +/** + * + * @author pratap + */ +public class Searchproduct extends javax.swing.JFrame { + + /** + * Creates new form SearchBook + */ + public Searchproduct() { + initComponents(); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents + private void initComponents() { + + jLabel2 = new javax.swing.JLabel(); + bid = new javax.swing.JTextField(); + jScrollPane1 = new javax.swing.JScrollPane(); + table = new javax.swing.JTable(); + jButton1 = new javax.swing.JButton(); + jButton2 = new javax.swing.JButton(); + jLabel4 = new javax.swing.JLabel(); + jLabel5 = new javax.swing.JLabel(); + jLabel6 = new javax.swing.JLabel(); + jLabel8 = new javax.swing.JLabel(); + jLabel9 = new javax.swing.JLabel(); + jTextField1 = new javax.swing.JTextField(); + jTextField2 = new javax.swing.JTextField(); + jTextField3 = new javax.swing.JTextField(); + jTextField4 = new javax.swing.JTextField(); + jTextField5 = new javax.swing.JTextField(); + jButton3 = new javax.swing.JButton(); + jButton4 = new javax.swing.JButton(); + jLabel1 = new javax.swing.JLabel(); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + setBackground(new java.awt.Color(51, 255, 0)); + setFont(new java.awt.Font("Times New Roman", 1, 36)); // NOI18N + setForeground(new java.awt.Color(0, 255, 0)); + + jLabel2.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel2.setText("Search Product"); + + bid.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + + table.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + table.setModel(new javax.swing.table.DefaultTableModel( + new Object [][] { + + }, + new String [] { + "item_id", "item_name", "quntatity", "price", "mfd", "exp", "batchno" + } + ) { + boolean[] canEdit = new boolean [] { + false, false, false, false, false, false, false + }; + + public boolean isCellEditable(int rowIndex, int columnIndex) { + return canEdit [columnIndex]; + } + }); + table.setRowHeight(25); + table.setRowMargin(2); + table.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + tableMouseClicked(evt); + } + }); + jScrollPane1.setViewportView(table); + if (table.getColumnModel().getColumnCount() > 0) { + table.getColumnModel().getColumn(1).setMinWidth(120); + table.getColumnModel().getColumn(3).setMinWidth(20); + table.getColumnModel().getColumn(4).setMinWidth(140); + table.getColumnModel().getColumn(5).setMinWidth(150); + table.getColumnModel().getColumn(6).setMinWidth(40); + } + + jButton1.setFont(jButton1.getFont().deriveFont(jButton1.getFont().getStyle() | java.awt.Font.BOLD, jButton1.getFont().getSize()+11)); + jButton1.setIcon(new javax.swing.ImageIcon("C:\\Users\\PRATAP KUMAR\\OneDrive\\Desktop\\four.png")); // NOI18N + jButton1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + jButton1.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + jButton1MouseClicked(evt); + } + }); + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); + + jButton2.setFont(jButton2.getFont().deriveFont(jButton2.getFont().getStyle() | java.awt.Font.BOLD, jButton2.getFont().getSize()+11)); + jButton2.setText("Back"); + jButton2.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + jButton2.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + jButton2MouseClicked(evt); + } + }); + jButton2.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton2ActionPerformed(evt); + } + }); + + jLabel4.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel4.setText("Item_Id:"); + + jLabel5.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel5.setText("Item_Name:"); + + jLabel6.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel6.setText("Total Price:"); + + jLabel8.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel8.setText("Qunatity (in lit/kg):"); + + jLabel9.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel9.setText("Price Per Unit:"); + + jTextField1.setFont(jTextField1.getFont().deriveFont(jTextField1.getFont().getStyle() | java.awt.Font.BOLD, jTextField1.getFont().getSize()+11)); + jTextField1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jTextField1ActionPerformed(evt); + } + }); + + jTextField2.setFont(jTextField2.getFont().deriveFont(jTextField2.getFont().getStyle() | java.awt.Font.BOLD, jTextField2.getFont().getSize()+11)); + + jTextField3.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jTextField3.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + jTextField3MouseClicked(evt); + } + public void mouseEntered(java.awt.event.MouseEvent evt) { + jTextField3MouseEntered(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + jTextField3MouseExited(evt); + } + }); + jTextField3.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jTextField3ActionPerformed(evt); + } + }); + + jTextField4.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + + jTextField5.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + + jButton3.setFont(jButton3.getFont().deriveFont(jButton3.getFont().getStyle() | java.awt.Font.BOLD, jButton3.getFont().getSize()+11)); + jButton3.setText("Add to cart"); + jButton3.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton3ActionPerformed(evt); + } + }); + + jButton4.setFont(new java.awt.Font("Times New Roman", 1, 36)); // NOI18N + jButton4.setText("View Cart"); + jButton4.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton4ActionPerformed(evt); + } + }); + + jLabel1.setFont(new java.awt.Font("Times New Roman", 1, 36)); // NOI18N + jLabel1.setText("Search Product"); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jLabel1) + .addGap(331, 331, 331) + .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 236, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(31, 31, 31)) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel6) + .addGap(155, 155, 155) + .addComponent(jTextField5)) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel5) + .addGap(152, 152, 152) + .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel9) + .addComponent(jLabel8)) + .addGap(76, 76, 76) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(jTextField3) + .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addGap(10, 10, 10) + .addComponent(jLabel4) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(18, 18, 18) + .addComponent(jScrollPane1)) + .addGroup(layout.createSequentialGroup() + .addGap(162, 162, 162) + .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 195, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(35, 35, 35) + .addComponent(bid, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 195, Short.MAX_VALUE)))) + .addGroup(layout.createSequentialGroup() + .addGap(136, 136, 136) + .addComponent(jButton3) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 900, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addContainerGap()))) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(52, 52, 52) + .addComponent(jLabel1)) + .addGroup(layout.createSequentialGroup() + .addGap(27, 27, 27) + .addComponent(jButton2)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addContainerGap() + .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(99, 99, 99) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel4)) + .addGap(35, 35, 35)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jButton1) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(bid, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(48, 48, 48))) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel5) + .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(20, 20, 20) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel8) + .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(26, 26, 26) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel9) + .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel6) + .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(51, 51, 51)) + .addGroup(layout.createSequentialGroup() + .addGap(22, 22, 22) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 265, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) + .addComponent(jButton3) + .addGap(207, 207, 207)) + ); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked + String ii=bid.getText(); + DefaultTableModel model = (DefaultTableModel) table.getModel(); + try { + Class.forName("java.sql.DriverManager"); + Connection con = (Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/fs", "root", ""); + + Statement stmt = con.createStatement(); + String query = "select * from inventory where item_id='"+ii+"' "; + ResultSet rs=stmt.executeQuery(query); + + while(rs.next()) { + String id = rs.getString("item_id"); + String name = rs.getString("item_name"); + String qun = rs.getString("quantity"); + String price = rs.getString("price"); + + String mfd = rs.getString("mfd"); + String exp = rs.getString("exp"); + String batchno = rs.getString("batchno"); + + + + model.addRow(new Object[] {id,name,qun,price,mfd,exp,batchno}); + } + rs.close(); + //stmt.close(); + //con.close(); + } catch (Exception e) { + JOptionPane.showMessageDialog(this, e.getMessage()); + //e.printStackTrace(); + } + + }//GEN-LAST:event_jButton1MouseClicked + + private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton2MouseClicked + this.setVisible(false); + mainFrame mm=new mainFrame(); + mm.setVisible(true); + }//GEN-LAST:event_jButton2MouseClicked + + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + jTextField1.setText(""); + jTextField2.setText(""); + jTextField3.setText(""); + jTextField4.setText(""); + jTextField5.setText(""); + + +// TODO add your handling code here: + }//GEN-LAST:event_jButton1ActionPerformed + + private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField1ActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_jTextField1ActionPerformed + + private void tableMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tableMouseClicked + DefaultTableModel model=(DefaultTableModel)table.getModel(); + int selectedRowIndex =table.getSelectedRow(); + jTextField1.setText(model.getValueAt(selectedRowIndex,0).toString()); + jTextField2.setText(model.getValueAt(selectedRowIndex,1).toString()); + //String s=model.getValueAt(selectedRowIndex,2).toString(); + jTextField4.setText(model.getValueAt(selectedRowIndex,3).toString()); + // jTextField5.setText(model.getValueAt(selectedRowIndex,0).toString()); + + + }//GEN-LAST:event_tableMouseClicked + + private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed + this.setVisible(false); + addtocart bc = new addtocart(); + bc.setVisible(true); // TODO add your handling code here: + }//GEN-LAST:event_jButton4ActionPerformed + + private void jTextField3MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextField3MouseEntered + + + }//GEN-LAST:event_jTextField3MouseEntered + + private void jTextField3MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextField3MouseClicked + // TODO add your handling code here: + }//GEN-LAST:event_jTextField3MouseClicked + + private void jTextField3MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextField3MouseExited + String qun= jTextField3.getText(); + String pri=jTextField4.getText(); + int N3=Integer.parseInt(pri); + int N1=Integer.parseInt(qun); + int N2=N1; + int N4=N1*N3; + jTextField5.setText(String.valueOf(N4)); // TODO add your handling code here: + }//GEN-LAST:event_jTextField3MouseExited + + private void jTextField3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField3ActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_jTextField3ActionPerformed + + private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed + String item_id=jTextField1.getText(); + String item_name=jTextField2.getText(); + String quantity=jTextField3.getText(); + String price=jTextField4.getText(); + String totprice = jTextField5.getText(); + + + try{ + Class.forName("com.mysql.jdbc.Driver"); + Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/fs","root",""); + String query = "insert into cart(item_id,item_name,quantity,price,totprice) values('"+item_id+"','"+item_name+"','"+quantity+"','"+price+"','"+totprice+"')"; + Statement smt3=con.createStatement(); + //ResultSet rs=smt3.executeQueryUpdate(query); + + int success=smt3.executeUpdate(query); + if(success==1) + { + JOptionPane.showMessageDialog(this, "Product Successfully Added to cart "); + //emp1.showMessageDialog(this, "Problem in Saving. Retry"); + } + else + { + + JOptionPane.showMessageDialog(this, "Problem in Saving. Retry"); + } + + + } + + catch(Exception e) + { + JOptionPane.showMessageDialog(this, e.getMessage()); + } // TODO add your handling code here: + /* + new addtocart().setVisible(true);*/ + }//GEN-LAST:event_jButton3ActionPerformed + + private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_jButton2ActionPerformed + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + /* Set the Nimbus look and feel */ + //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> + /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. + * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html + */ + try { + for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { + if ("Nimbus".equals(info.getName())) { + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } catch (ClassNotFoundException ex) { + java.util.logging.Logger.getLogger(Searchproduct.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(Searchproduct.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(Searchproduct.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(Searchproduct.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + //</editor-fold> + //</editor-fold> + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new Searchproduct().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JTextField bid; + private javax.swing.JButton jButton1; + private javax.swing.JButton jButton2; + private javax.swing.JButton jButton3; + private javax.swing.JButton jButton4; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel4; + private javax.swing.JLabel jLabel5; + private javax.swing.JLabel jLabel6; + private javax.swing.JLabel jLabel8; + private javax.swing.JLabel jLabel9; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JTextField jTextField1; + private javax.swing.JTextField jTextField2; + private javax.swing.JTextField jTextField3; + private javax.swing.JTextField jTextField4; + private javax.swing.JTextField jTextField5; + private javax.swing.JTable table; + // End of variables declaration//GEN-END:variables +} diff --git a/StockManagementSystem/src/MainFiles/Slogin.form b/StockManagementSystem/src/MainFiles/Slogin.form new file mode 100644 index 0000000..7592496 --- /dev/null +++ b/StockManagementSystem/src/MainFiles/Slogin.form @@ -0,0 +1,174 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="3"/> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="18" style="1"/> + </Property> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + <SyntheticProperty name="generateCenter" type="boolean" value="false"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace pref="23" max="32767" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Component id="jLabel2" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="jTextField2" min="-2" pref="138" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <Component id="jLabel1" min="-2" pref="124" max="-2" attributes="0"/> + <EmptySpace pref="58" max="32767" attributes="0"/> + <Component id="jTextField1" min="-2" pref="138" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="-2" pref="29" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel3" min="-2" max="-2" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <Component id="jButton1" min="-2" pref="125" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="39" max="-2" attributes="0"/> + <Component id="jButton5" min="-2" pref="111" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace max="32767" attributes="0"/> + </Group> + </Group> + <Component id="jLabel4" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="37" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <Group type="103" groupAlignment="1" max="-2" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="-2" pref="74" max="-2" attributes="0"/> + <Component id="jLabel4" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="-2" pref="39" max="-2" attributes="0"/> + <Component id="jLabel3" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jTextField1" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="65" max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="jLabel2" min="-2" max="-2" attributes="0"/> + <Component id="jTextField2" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="60" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jButton1" alignment="3" min="-2" pref="57" max="-2" attributes="0"/> + <Component id="jButton5" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="66" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace pref="124" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Username:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Password:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel3"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="36" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="SUPPLIER LOGIN"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="jButton1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="LOGIN"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JTextField" name="jTextField1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jTextField1ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JTextField" name="jTextField2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel4"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="2" name="C:\Users\PRATAP KUMAR\OneDrive\Desktop\one.jpg"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="jButton5"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="BACK"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jButton5MouseClicked"/> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton5ActionPerformed"/> + </Events> + </Component> + </SubComponents> +</Form> diff --git a/StockManagementSystem/src/MainFiles/Slogin.java b/StockManagementSystem/src/MainFiles/Slogin.java new file mode 100644 index 0000000..c5d8bc7 --- /dev/null +++ b/StockManagementSystem/src/MainFiles/Slogin.java @@ -0,0 +1,227 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package MainFiles; + +import javax.swing.JOptionPane; + +/** + * + * @author pratap + */ +public class Slogin extends javax.swing.JFrame { + + /** + * Creates new form Slogin + */ + public Slogin() { + initComponents(); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents + private void initComponents() { + + jLabel1 = new javax.swing.JLabel(); + jLabel2 = new javax.swing.JLabel(); + jLabel3 = new javax.swing.JLabel(); + jButton1 = new javax.swing.JButton(); + jTextField1 = new javax.swing.JTextField(); + jTextField2 = new javax.swing.JTextField(); + jLabel4 = new javax.swing.JLabel(); + jButton5 = new javax.swing.JButton(); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N + + jLabel1.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel1.setText("Username:"); + + jLabel2.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel2.setText("Password:"); + + jLabel3.setFont(new java.awt.Font("Times New Roman", 1, 36)); // NOI18N + jLabel3.setText("SUPPLIER LOGIN"); + + jButton1.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jButton1.setText("LOGIN"); + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); + + jTextField1.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jTextField1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jTextField1ActionPerformed(evt); + } + }); + + jTextField2.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + + jLabel4.setIcon(new javax.swing.ImageIcon("C:\\Users\\PRATAP KUMAR\\OneDrive\\Desktop\\one.jpg")); // NOI18N + + jButton5.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jButton5.setText("BACK"); + jButton5.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + jButton5.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + jButton5MouseClicked(evt); + } + }); + jButton5.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton5ActionPerformed(evt); + } + }); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap(23, Short.MAX_VALUE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel2) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 58, Short.MAX_VALUE) + .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(29, 29, 29)) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel3) + .addGroup(layout.createSequentialGroup() + .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(39, 39, 39) + .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) + .addComponent(jLabel4) + .addGap(37, 37, 37)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addGroup(layout.createSequentialGroup() + .addGap(74, 74, 74) + .addComponent(jLabel4)) + .addGroup(layout.createSequentialGroup() + .addGap(39, 39, 39) + .addComponent(jLabel3) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel1)) + .addGap(65, 65, 65) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabel2) + .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(60, 60, 60) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jButton5)) + .addGap(66, 66, 66))) + .addContainerGap(124, Short.MAX_VALUE)) + ); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + + + if(jTextField1.getText().length()==0 && jTextField2.getText().length()==0) + { + JOptionPane.showMessageDialog(null,"!!Enter the valid entries.."); + } + else + if(jTextField1.getText().equals("supplier") && jTextField2.getText().equals("123")) + { + this.setVisible(false); + supplierapprove ab1 = new supplierapprove(); + ab1.setVisible(true); + } + else + { + JOptionPane.showMessageDialog(null,"Invalid!! Try again.."); + jTextField1.setText(null); + jTextField2.setText(null); + + } + // TODO add your handling code here: + }//GEN-LAST:event_jButton1ActionPerformed + + private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField1ActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_jTextField1ActionPerformed + + private void jButton5MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton5MouseClicked + this.setVisible(false); + Login ab = new Login(this, rootPaneCheckingEnabled); + ab.setVisible(true); + }//GEN-LAST:event_jButton5MouseClicked + + private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_jButton5ActionPerformed + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + /* Set the Nimbus look and feel */ + //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> + /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. + * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html + */ + try { + for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { + if ("Nimbus".equals(info.getName())) { + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } catch (ClassNotFoundException ex) { + java.util.logging.Logger.getLogger(Slogin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(Slogin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(Slogin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(Slogin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + //</editor-fold> + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new Slogin().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jButton1; + private javax.swing.JButton jButton5; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JLabel jLabel4; + private javax.swing.JTextField jTextField1; + private javax.swing.JTextField jTextField2; + // End of variables declaration//GEN-END:variables +} diff --git a/StockManagementSystem/src/MainFiles/Track.form b/StockManagementSystem/src/MainFiles/Track.form new file mode 100644 index 0000000..35af24e --- /dev/null +++ b/StockManagementSystem/src/MainFiles/Track.form @@ -0,0 +1,196 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="3"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + <SyntheticProperty name="generateCenter" type="boolean" value="false"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="49" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jScrollPane1" min="-2" pref="797" max="-2" attributes="0"/> + <Group type="102" attributes="0"> + <Component id="jLabel2" min="-2" pref="195" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jButton1" min="-2" pref="117" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + <Component id="jButton2" min="-2" pref="95" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="bid" min="-2" pref="149" max="-2" attributes="0"/> + <EmptySpace min="0" pref="465" max="32767" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + </Group> + <EmptySpace pref="24" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="22" max="-2" attributes="0"/> + <Component id="jButton2" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="76" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="bid" alignment="3" min="-2" pref="28" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <EmptySpace min="-2" pref="30" max="-2" attributes="0"/> + <Component id="jButton1" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="26" max="-2" attributes="0"/> + <Component id="jScrollPane1" pref="281" max="32767" attributes="0"/> + <EmptySpace min="-2" pref="39" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Search Date"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="bid"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + </Properties> + </Component> + <Container class="javax.swing.JScrollPane" name="jScrollPane1"> + <AuxValues> + <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> + </AuxValues> + + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> + <SubComponents> + <Component class="javax.swing.JTable" name="table"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> + <Table columnCount="6" rowCount="0"> + <Column editable="false" title="billno" type="java.lang.Object"/> + <Column editable="false" title="item_id" type="java.lang.Object"/> + <Column editable="false" title="item_name" type="java.lang.Object"/> + <Column editable="false" title="quntatity" type="java.lang.Object"/> + <Column editable="false" title="price" type="java.lang.Object"/> + <Column editable="false" title="date" type="java.lang.Object"/> + </Table> + </Property> + <Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor"> + <TableColumnModel selectionModel="0"> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="150" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + </TableColumnModel> + </Property> + <Property name="rowHeight" type="int" value="25"/> + <Property name="rowMargin" type="int" value="2"/> + <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> + <TableHeader reorderingAllowed="true" resizingAllowed="true"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="tableMouseClicked"/> + </Events> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JButton" name="jButton1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor"> + <FontInfo relative="true"> + <Font bold="true" component="jButton1" property="font" relativeSize="true" size="11"/> + </FontInfo> + </Property> + <Property name="text" type="java.lang.String" value="Search"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jButton1MouseClicked"/> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="jButton2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor"> + <FontInfo relative="true"> + <Font bold="true" component="jButton2" property="font" relativeSize="true" size="11"/> + </FontInfo> + </Property> + <Property name="text" type="java.lang.String" value="Back"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jButton2MouseClicked"/> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/> + </Events> + </Component> + </SubComponents> +</Form> diff --git a/StockManagementSystem/src/MainFiles/Track.java b/StockManagementSystem/src/MainFiles/Track.java new file mode 100644 index 0000000..4f9ad80 --- /dev/null +++ b/StockManagementSystem/src/MainFiles/Track.java @@ -0,0 +1,256 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package MainFiles; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.Statement; +import javax.swing.JOptionPane; +import javax.swing.table.DefaultTableModel; + +/** + * + * @author pratap + */ +public class Track extends javax.swing.JFrame { + + /** + * Creates new form SearchBook + */ + public Track() { + initComponents(); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents + private void initComponents() { + + jLabel2 = new javax.swing.JLabel(); + bid = new javax.swing.JTextField(); + jScrollPane1 = new javax.swing.JScrollPane(); + table = new javax.swing.JTable(); + jButton1 = new javax.swing.JButton(); + jButton2 = new javax.swing.JButton(); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + + jLabel2.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel2.setText("Search Date"); + + bid.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + + table.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + table.setModel(new javax.swing.table.DefaultTableModel( + new Object [][] { + + }, + new String [] { + "billno", "item_id", "item_name", "quntatity", "price", "date" + } + ) { + boolean[] canEdit = new boolean [] { + false, false, false, false, false, false + }; + + public boolean isCellEditable(int rowIndex, int columnIndex) { + return canEdit [columnIndex]; + } + }); + table.setRowHeight(25); + table.setRowMargin(2); + table.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + tableMouseClicked(evt); + } + }); + jScrollPane1.setViewportView(table); + if (table.getColumnModel().getColumnCount() > 0) { + table.getColumnModel().getColumn(5).setMinWidth(150); + } + + jButton1.setFont(jButton1.getFont().deriveFont(jButton1.getFont().getStyle() | java.awt.Font.BOLD, jButton1.getFont().getSize()+11)); + jButton1.setText("Search"); + jButton1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + jButton1.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + jButton1MouseClicked(evt); + } + }); + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); + + jButton2.setFont(jButton2.getFont().deriveFont(jButton2.getFont().getStyle() | java.awt.Font.BOLD, jButton2.getFont().getSize()+11)); + jButton2.setText("Back"); + jButton2.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + jButton2.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + jButton2MouseClicked(evt); + } + }); + jButton2.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton2ActionPerformed(evt); + } + }); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(49, 49, 49) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 797, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 195, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(layout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addComponent(bid, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 465, Short.MAX_VALUE)))))) + .addContainerGap(24, Short.MAX_VALUE)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(22, 22, 22) + .addComponent(jButton2)) + .addGroup(layout.createSequentialGroup() + .addGap(76, 76, 76) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel2) + .addComponent(bid, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addGap(30, 30, 30) + .addComponent(jButton1) + .addGap(26, 26, 26) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 281, Short.MAX_VALUE) + .addGap(39, 39, 39)) + ); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked + String ii=bid.getText(); + DefaultTableModel model = (DefaultTableModel) table.getModel(); + try { + Class.forName("java.sql.DriverManager"); + Connection con = (Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/fs", "root", ""); + + Statement stmt = con.createStatement(); + String query = "select * from bill where date='"+ii+"' "; + ResultSet rs=stmt.executeQuery(query); + + while(rs.next()) { + String mfd = rs.getString("biilno"); + String id = rs.getString("item_id"); + String name = rs.getString("item_name"); + String qun = rs.getString("quantity"); + String price = rs.getString("price"); + + + String exp = rs.getString("date"); + // String batchno = rs.getString("batchno"); + + + + model.addRow(new Object[] {mfd,id,name,qun,price,exp}); + } + rs.close(); + //stmt.close(); + //con.close(); + } catch (Exception e) { + JOptionPane.showMessageDialog(this, e.getMessage()); + //e.printStackTrace(); + } + + }//GEN-LAST:event_jButton1MouseClicked + + private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton2MouseClicked + this.setVisible(false); + mainFrame mm=new mainFrame(); + mm.setVisible(true); + }//GEN-LAST:event_jButton2MouseClicked + + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + + + +// TODO add your handling code here: + }//GEN-LAST:event_jButton1ActionPerformed + + private void tableMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tableMouseClicked + + + }//GEN-LAST:event_tableMouseClicked + + private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_jButton2ActionPerformed + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + /* Set the Nimbus look and feel */ + //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> + /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. + * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html + */ + try { + for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { + if ("Nimbus".equals(info.getName())) { + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } catch (ClassNotFoundException ex) { + java.util.logging.Logger.getLogger(Track.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(Track.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(Track.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(Track.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new Track().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JTextField bid; + private javax.swing.JButton jButton1; + private javax.swing.JButton jButton2; + private javax.swing.JLabel jLabel2; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JTable table; + // End of variables declaration//GEN-END:variables +} diff --git a/StockManagementSystem/src/MainFiles/addproduct.form b/StockManagementSystem/src/MainFiles/addproduct.form new file mode 100644 index 0000000..52cef73 --- /dev/null +++ b/StockManagementSystem/src/MainFiles/addproduct.form @@ -0,0 +1,266 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="3"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + <SyntheticProperty name="generateCenter" type="boolean" value="false"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="-2" pref="281" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="103" alignment="1" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <Component id="jLabel7" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="47" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel8" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="97" max="-2" attributes="0"/> + </Group> + </Group> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel9" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="jLabel10" min="-2" max="-2" attributes="0"/> + <Component id="jLabel4" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="jLabel5" min="-2" max="-2" attributes="0"/> + <Component id="jLabel6" min="-2" max="-2" attributes="0"/> + <Component id="jButton1" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="TextBox5" min="-2" pref="173" max="-2" attributes="0"/> + <Component id="TextBox6" min="-2" pref="173" max="-2" attributes="0"/> + <Group type="103" alignment="0" groupAlignment="0" max="-2" attributes="0"> + <Component id="TextBox1" max="32767" attributes="0"/> + <Component id="TextBox2" max="32767" attributes="0"/> + <Component id="TextBox3" alignment="0" max="32767" attributes="0"/> + <Component id="TextBox4" alignment="0" min="-2" pref="173" max="-2" attributes="0"/> + </Group> + <Component id="TextBox7" alignment="0" min="-2" pref="173" max="-2" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="21" max="-2" attributes="0"/> + <Component id="jButton2" min="-2" pref="96" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <Group type="102" alignment="1" attributes="0"> + <Component id="jLabel3" min="-2" pref="222" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="43" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace pref="536" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="30" max="-2" attributes="0"/> + <Component id="jLabel3" min="-2" pref="46" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="45" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel4" alignment="3" min="-2" pref="27" max="-2" attributes="0"/> + <Component id="TextBox1" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="27" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="TextBox2" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="29" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="TextBox3" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="28" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="TextBox4" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel9" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="TextBox5" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="29" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel8" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="TextBox6" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="29" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="TextBox7" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel10" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="48" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jButton2" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace pref="67" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel3"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="36" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Add Product"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel4"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Item Id:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="TextBox1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel5"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Item Name:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="TextBox2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel6"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Quantity:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel7"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Price Per Unit:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="TextBox4"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="TextBox3"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="jButton1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Add Product"/> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jButton1MouseClicked"/> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="jButton2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Back"/> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jButton2MouseClicked"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel8"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="EXP:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel9"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="MFD:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="TextBox5"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="TextBox6"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="TextBox7"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel10"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Batchno:"/> + </Properties> + </Component> + </SubComponents> +</Form> diff --git a/StockManagementSystem/src/MainFiles/addproduct.java b/StockManagementSystem/src/MainFiles/addproduct.java new file mode 100644 index 0000000..3785d1f --- /dev/null +++ b/StockManagementSystem/src/MainFiles/addproduct.java @@ -0,0 +1,301 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package MainFiles; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.Statement; +import javax.swing.JOptionPane; + +/** + * + * @author pratap + */ +public class addproduct extends javax.swing.JFrame { + + /** + * Creates new form addBook + */ + public addproduct() { + initComponents(); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents + private void initComponents() { + + jLabel3 = new javax.swing.JLabel(); + jLabel4 = new javax.swing.JLabel(); + TextBox1 = new javax.swing.JTextField(); + jLabel5 = new javax.swing.JLabel(); + TextBox2 = new javax.swing.JTextField(); + jLabel6 = new javax.swing.JLabel(); + jLabel7 = new javax.swing.JLabel(); + TextBox4 = new javax.swing.JTextField(); + TextBox3 = new javax.swing.JTextField(); + jButton1 = new javax.swing.JButton(); + jButton2 = new javax.swing.JButton(); + jLabel8 = new javax.swing.JLabel(); + jLabel9 = new javax.swing.JLabel(); + TextBox5 = new javax.swing.JTextField(); + TextBox6 = new javax.swing.JTextField(); + TextBox7 = new javax.swing.JTextField(); + jLabel10 = new javax.swing.JLabel(); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + + jLabel3.setFont(new java.awt.Font("Times New Roman", 1, 36)); // NOI18N + jLabel3.setText("Add Product"); + + jLabel4.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel4.setText("Item Id:"); + + TextBox1.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + + jLabel5.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel5.setText("Item Name:"); + + TextBox2.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + + jLabel6.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel6.setText("Quantity:"); + + jLabel7.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel7.setText("Price Per Unit:"); + + TextBox4.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + + TextBox3.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + + jButton1.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jButton1.setText("Add Product"); + jButton1.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + jButton1MouseClicked(evt); + } + }); + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); + + jButton2.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jButton2.setText("Back"); + jButton2.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + jButton2MouseClicked(evt); + } + }); + + jLabel8.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel8.setText("EXP:"); + + jLabel9.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel9.setText("MFD:"); + + TextBox5.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + + TextBox6.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + + TextBox7.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + + jLabel10.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel10.setText("Batchno:"); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addGap(281, 281, 281) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addComponent(jLabel7) + .addGap(47, 47, 47)) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel8) + .addGap(97, 97, 97))) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel9) + .addComponent(jLabel10) + .addComponent(jLabel4) + .addComponent(jLabel5) + .addComponent(jLabel6) + .addComponent(jButton1)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(TextBox5, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(TextBox6, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(TextBox1) + .addComponent(TextBox2) + .addComponent(TextBox3) + .addComponent(TextBox4, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(TextBox7, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(layout.createSequentialGroup() + .addGap(21, 21, 21) + .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 222, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(43, 43, 43))) + .addContainerGap(536, Short.MAX_VALUE)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(30, 30, 30) + .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(45, 45, 45) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(TextBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(27, 27, 27) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel5) + .addComponent(TextBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(29, 29, 29) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel6) + .addComponent(TextBox3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(28, 28, 28) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel7) + .addComponent(TextBox4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel9) + .addComponent(TextBox5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(29, 29, 29) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel8) + .addComponent(TextBox6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(29, 29, 29) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(TextBox7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel10)) + .addGap(48, 48, 48) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jButton1) + .addComponent(jButton2)) + .addContainerGap(67, Short.MAX_VALUE)) + ); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked + String item_id=TextBox1.getText(); + String item_name=TextBox2.getText(); + String quantity=TextBox3.getText(); + String price=TextBox4.getText(); + String mfd = TextBox5.getText(); + String exp = TextBox6.getText(); + String batchno = TextBox7.getText(); + + try{ + Class.forName("com.mysql.jdbc.Driver"); + Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/fs","root",""); + String query = "insert into inventory(item_id,item_name,quantity,price,mfd,exp,batchno) values('"+item_id+"','"+item_name+"','"+quantity+"','"+price+"','"+mfd+"','"+exp+"','"+batchno+"')"; + Statement smt3=con.createStatement(); + //ResultSet rs=smt3.executeQueryUpdate(query); + + int success=smt3.executeUpdate(query); + if(success==1) + { + JOptionPane.showMessageDialog(this, "Product Successfully Added "); + //emp1.showMessageDialog(this, "Problem in Saving. Retry"); + } + else + { + + JOptionPane.showMessageDialog(this, "Problem in Saving. Retry"); + } + + + } + + catch(Exception e) + { + JOptionPane.showMessageDialog(this, e.getMessage()); + } + }//GEN-LAST:event_jButton1MouseClicked + + private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton2MouseClicked + this.setVisible(false); + mainFrame mm=new mainFrame(); + mm.setVisible(true); + }//GEN-LAST:event_jButton2MouseClicked + + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_jButton1ActionPerformed + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + /* Set the Nimbus look and feel */ + //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> + /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. + * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html + */ + try { + for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { + if ("Nimbus".equals(info.getName())) { + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } catch (ClassNotFoundException ex) { + java.util.logging.Logger.getLogger(addproduct.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(addproduct.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(addproduct.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(addproduct.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + //</editor-fold> + //</editor-fold> + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new addproduct().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JTextField TextBox1; + private javax.swing.JTextField TextBox2; + private javax.swing.JTextField TextBox3; + private javax.swing.JTextField TextBox4; + private javax.swing.JTextField TextBox5; + private javax.swing.JTextField TextBox6; + private javax.swing.JTextField TextBox7; + private javax.swing.JButton jButton1; + private javax.swing.JButton jButton2; + private javax.swing.JLabel jLabel10; + private javax.swing.JLabel jLabel3; + private javax.swing.JLabel jLabel4; + private javax.swing.JLabel jLabel5; + private javax.swing.JLabel jLabel6; + private javax.swing.JLabel jLabel7; + private javax.swing.JLabel jLabel8; + private javax.swing.JLabel jLabel9; + // End of variables declaration//GEN-END:variables +} diff --git a/StockManagementSystem/src/MainFiles/addtocart.form b/StockManagementSystem/src/MainFiles/addtocart.form new file mode 100644 index 0000000..2d619c2 --- /dev/null +++ b/StockManagementSystem/src/MainFiles/addtocart.form @@ -0,0 +1,191 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="3"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + <SyntheticProperty name="generateCenter" type="boolean" value="false"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="0" pref="46" max="32767" attributes="0"/> + <Group type="103" groupAlignment="1" max="-2" attributes="0"> + <Component id="jScrollPane1" min="-2" pref="1003" max="-2" attributes="0"/> + <Group type="102" attributes="0"> + <Component id="jButton2" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="jButton1" min="-2" pref="227" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="-2" pref="34" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="245" max="-2" attributes="0"/> + <Component id="jLabel1" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="42" max="-2" attributes="0"/> + <Component id="jLabel2" min="-2" pref="103" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="394" max="-2" attributes="0"/> + <Component id="jButton3" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="5" max="-2" attributes="0"/> + <Component id="jButton1" min="-2" pref="69" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="24" max="-2" attributes="0"/> + <Component id="jButton2" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="jScrollPane1" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="19" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel1" min="-2" max="-2" attributes="0"/> + <Component id="jLabel2" min="-2" pref="27" max="-2" attributes="0"/> + </Group> + <EmptySpace pref="43" max="32767" attributes="0"/> + <Component id="jButton3" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="28" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JScrollPane" name="jScrollPane1"> + <AuxValues> + <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> + </AuxValues> + + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> + <SubComponents> + <Component class="javax.swing.JTable" name="table2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> + <Table columnCount="5" rowCount="0"> + <Column editable="false" title="item_id" type="java.lang.Object"/> + <Column editable="false" title="item_name" type="java.lang.Object"/> + <Column editable="false" title="quantity" type="java.lang.Object"/> + <Column editable="false" title="unit price" type="java.lang.Object"/> + <Column editable="false" title="total price" type="java.lang.Object"/> + </Table> + </Property> + <Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor"> + <TableColumnModel selectionModel="0"> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="140" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + </TableColumnModel> + </Property> + <Property name="rowHeight" type="int" value="25"/> + <Property name="rowMargin" type="int" value="3"/> + <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> + <TableHeader reorderingAllowed="true" resizingAllowed="true"/> + </Property> + </Properties> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JButton" name="jButton1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="36" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="View Cart"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="jButton2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Back"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Total Amount"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="jButton3"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Proceed to bill"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton3ActionPerformed"/> + </Events> + </Component> + </SubComponents> +</Form> diff --git a/StockManagementSystem/src/MainFiles/addtocart.java b/StockManagementSystem/src/MainFiles/addtocart.java new file mode 100644 index 0000000..d471e08 --- /dev/null +++ b/StockManagementSystem/src/MainFiles/addtocart.java @@ -0,0 +1,374 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package MainFiles; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import javax.swing.JOptionPane; +import javax.swing.table.DefaultTableModel; + +/** + * + * @author pratap + */ +public class addtocart extends javax.swing.JFrame { + + /** + * Creates new form addtocart + */ + String roll; + public addtocart() { + initComponents(); + roll=""; + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents + private void initComponents() { + + jScrollPane1 = new javax.swing.JScrollPane(); + table2 = new javax.swing.JTable(); + jButton1 = new javax.swing.JButton(); + jButton2 = new javax.swing.JButton(); + jLabel1 = new javax.swing.JLabel(); + jLabel2 = new javax.swing.JLabel(); + jButton3 = new javax.swing.JButton(); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + + table2.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + table2.setModel(new javax.swing.table.DefaultTableModel( + new Object [][] { + + }, + new String [] { + "item_id", "item_name", "quantity", "unit price", "total price" + } + ) { + boolean[] canEdit = new boolean [] { + false, false, false, false, false + }; + + public boolean isCellEditable(int rowIndex, int columnIndex) { + return canEdit [columnIndex]; + } + }); + table2.setRowHeight(25); + table2.setRowMargin(3); + jScrollPane1.setViewportView(table2); + if (table2.getColumnModel().getColumnCount() > 0) { + table2.getColumnModel().getColumn(1).setMinWidth(140); + } + + jButton1.setFont(new java.awt.Font("Times New Roman", 1, 36)); // NOI18N + jButton1.setText("View Cart"); + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); + + jButton2.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jButton2.setText("Back"); + jButton2.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton2ActionPerformed(evt); + } + }); + + jLabel1.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel1.setText("Total Amount"); + + jLabel2.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + + jButton3.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jButton3.setText("Proceed to bill"); + jButton3.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton3ActionPerformed(evt); + } + }); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addGap(0, 46, Short.MAX_VALUE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 1003, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(layout.createSequentialGroup() + .addComponent(jButton2) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 227, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(34, 34, 34)) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(245, 245, 245) + .addComponent(jLabel1) + .addGap(42, 42, 42) + .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addGap(394, 394, 394) + .addComponent(jButton3))) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(5, 5, 5) + .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addGap(24, 24, 24) + .addComponent(jButton2))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(19, 19, 19) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel1) + .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 43, Short.MAX_VALUE) + .addComponent(jButton3) + .addGap(28, 28, 28)) + ); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + + + + DefaultTableModel model = (DefaultTableModel) table2.getModel(); + model.setRowCount(0); + int total = 0; + String tot = ""; + + // ProductInformation.categoryChooser = "electronics"; + try { + Class.forName("java.sql.DriverManager"); + Connection con = (Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/fs", "root", ""); + + Statement stmt = con.createStatement(); + String query = "select * from cart "; + ResultSet rs=stmt.executeQuery(query); + + while(rs.next()) { + String id = rs.getString("item_id"); + String name = rs.getString("item_name"); + String qun = rs.getString("quantity"); + String price1 = rs.getString("price"); + + String mfd = rs.getString("totprice"); + + + model.addRow(new Object[] {id,name,qun,price1,mfd}); + } + rs.close(); + + //stmt.close(); + //con.close(); + }catch (Exception e) { + JOptionPane.showMessageDialog(this, e.getMessage()); + //e.printStackTrace(); + } + int sum=0; + for(int i=0;i<table2.getRowCount();i++) + { + sum=sum+Integer.parseInt(table2.getValueAt(i,4).toString()); + } +jLabel2.setText(Integer.toString(sum)); +//String b=jLabel2.getText(); + + +// TODO add your handling code here: + }//GEN-LAST:event_jButton1ActionPerformed + + private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed +this.setVisible(false); + Searchproduct mm=new Searchproduct(); + mm.setVisible(true); // TODO add your handling code here: + }//GEN-LAST:event_jButton2ActionPerformed + + private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed + + workWithDatabase(); + + + + +try +{DefaultTableModel model=(DefaultTableModel)table2.getModel(); + int selectedRowIndex =table2.getSelectedRow(); + String a=model.getValueAt(selectedRowIndex,0).toString(); + String b=model.getValueAt(selectedRowIndex,1).toString(); + String c=model.getValueAt(selectedRowIndex,2).toString(); + String d=model.getValueAt(selectedRowIndex,3).toString(); + String e=model.getValueAt(selectedRowIndex,4).toString(); + Class.forName("com.mysql.jdbc.Driver"); + Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/fs","root",""); + String query = "insert into bill(item_id,item_name,quantity,price,totprice) values('"+a+"','"+b+"','"+c+"','"+d+"','"+e+"')"; + Statement smt3=con.createStatement(); + //ResultSet rs=smt3.executeQueryUpdate(query); + + int success=smt3.executeUpdate(query); + if(success==1) + { + JOptionPane.showMessageDialog(this, "Product Successfully Added to bill "); + //emp1.showMessageDialog(this, "Problem in Saving. Retry"); + } + else + { + + JOptionPane.showMessageDialog(this, "Problem in Saving. Retry"); + } + + + +} +catch(Exception e) + { + JOptionPane.showMessageDialog(null, e); + } + } + + + public void workWithDatabase() + { + Connection c=null; + Statement s=null; + ResultSet rs1=null; + int flag=0; + try{ + + Class.forName("com.mysql.jdbc.Driver"); + c=DriverManager.getConnection("jdbc:mysql://localhost/fs","root",""); + s=c.createStatement(); + + DefaultTableModel model = (DefaultTableModel) table2.getModel(); + int selectedRowIndex =table2.getSelectedRow(); + String a=model.getValueAt(selectedRowIndex,0).toString(); + + String c1=model.getValueAt(selectedRowIndex,2).toString(); + + + String s1=a; + + // rs1 = s.executeQuery ("select quantity from inventory where item_id="+"'"+s1+"'"); + + int id=Integer.parseInt(c1); + rs1 = s.executeQuery ("select quantity from inventory where item_id="+"'"+s1+"'"); + + + // jLabel6.setText(s1); + + while(rs1.next()) { + String id1=rs1.getString("quantity"); + int id2=Integer.parseInt(id1); + + int id3=id2-id; + s.executeUpdate("Update inventory set quantity="+id3+" where item_id="+"'"+s1+"'"); + + } + /* while(rs1.next()) + { + String quantity1=rs1.getString("quantity"); + String q3 = quantity1; + + + }*/ + rs1.close(); + + + + +} + catch(SQLException | ClassNotFoundException e1) + { + System.out.println(e1); + } + try { + Class.forName("java.sql.DriverManager"); + Connection con = (Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/fs", "root", ""); + + Statement stmt = con.createStatement(); + String query = "delete from cart "; + // ResultSet rs=smt3.executeQueryUpdate(query); + + + // Statement smt3=con.createStatement(); + // + + int success=stmt.executeUpdate(query); + + + //stmt.close(); + //con.close(); + }catch (Exception e) { + JOptionPane.showMessageDialog(this, e.getMessage()); + //e.printStackTrace(); + } +// String b=jLabel2.getText(); +this.setVisible(false); + bill mm=new bill(); + mm.setVisible(true); // TODO add your handling code here: + }//GEN-LAST:event_jButton3ActionPerformed + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + /* Set the Nimbus look and feel */ + //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> + /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. + * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html + */ + try { + for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { + if ("Nimbus".equals(info.getName())) { + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } catch (ClassNotFoundException ex) { + java.util.logging.Logger.getLogger(addtocart.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(addtocart.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(addtocart.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(addtocart.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + //</editor-fold> + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new addtocart().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jButton1; + private javax.swing.JButton jButton2; + private javax.swing.JButton jButton3; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JTable table2; + // End of variables declaration//GEN-END:variables +} diff --git a/StockManagementSystem/src/MainFiles/bill.form b/StockManagementSystem/src/MainFiles/bill.form new file mode 100644 index 0000000..46a61c9 --- /dev/null +++ b/StockManagementSystem/src/MainFiles/bill.form @@ -0,0 +1,229 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="3"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + <SyntheticProperty name="generateCenter" type="boolean" value="false"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jButton2" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="31" max="-2" attributes="0"/> + <Component id="jLabel1" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jLabel2" min="-2" pref="71" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="349" max="-2" attributes="0"/> + <Component id="jLabel3" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jLabel4" min="-2" pref="239" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="290" max="-2" attributes="0"/> + <Component id="jLabel5" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="51" max="-2" attributes="0"/> + <Component id="jLabel6" min="-2" pref="149" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="411" max="-2" attributes="0"/> + <Component id="jButton1" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="21" max="-2" attributes="0"/> + <Component id="jScrollPane1" min="-2" pref="981" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace pref="98" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="23" max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="jButton2" min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel2" alignment="0" min="-2" pref="28" max="-2" attributes="0"/> + <Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="32" max="-2" attributes="0"/> + <Component id="jLabel3" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="32" max="-2" attributes="0"/> + <Component id="jLabel4" min="-2" pref="37" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="-2" pref="42" max="-2" attributes="0"/> + <Component id="jScrollPane1" min="-2" pref="275" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="24" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Component id="jLabel5" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="42" max="32767" attributes="0"/> + <Component id="jButton1" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <Component id="jLabel6" min="-2" pref="39" max="-2" attributes="0"/> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + </Group> + </Group> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JScrollPane" name="jScrollPane1"> + <AuxValues> + <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> + </AuxValues> + + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> + <SubComponents> + <Component class="javax.swing.JTable" name="jTable1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> + <Table columnCount="5" rowCount="0"> + <Column editable="false" title="Item_id" type="java.lang.Object"/> + <Column editable="false" title="Item_name" type="java.lang.Object"/> + <Column editable="false" title="Quantity" type="java.lang.Object"/> + <Column editable="false" title="price" type="java.lang.Object"/> + <Column editable="false" title="total_price" type="java.lang.Object"/> + </Table> + </Property> + <Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor"> + <TableColumnModel selectionModel="0"> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="140" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + </TableColumnModel> + </Property> + <Property name="rowHeight" type="int" value="25"/> + <Property name="rowMargin" type="int" value="3"/> + <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> + <TableHeader reorderingAllowed="true" resizingAllowed="true"/> + </Property> + </Properties> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Bill No:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel3"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Date:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel4"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel5"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Total Amount:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel6"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="jButton1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Generate Invoice"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="jButton2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="HOME"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/> + </Events> + </Component> + </SubComponents> +</Form> diff --git a/StockManagementSystem/src/MainFiles/bill.java b/StockManagementSystem/src/MainFiles/bill.java new file mode 100644 index 0000000..146ded4 --- /dev/null +++ b/StockManagementSystem/src/MainFiles/bill.java @@ -0,0 +1,278 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package MainFiles; + +import java.awt.print.PrinterException; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import javax.swing.JOptionPane; +import javax.swing.table.DefaultTableModel; +import java.sql.*; +import java.sql.DriverManager; +import java.text.MessageFormat; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.JTable; + + +/** + * + * @author pratap + */ +public class bill extends javax.swing.JFrame { + + /** + * Creates new form bill + */ + public bill() { + initComponents(); + } + + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents + private void initComponents() { + + jScrollPane1 = new javax.swing.JScrollPane(); + jTable1 = new javax.swing.JTable(); + jLabel1 = new javax.swing.JLabel(); + jLabel2 = new javax.swing.JLabel(); + jLabel3 = new javax.swing.JLabel(); + jLabel4 = new javax.swing.JLabel(); + jLabel5 = new javax.swing.JLabel(); + jLabel6 = new javax.swing.JLabel(); + jButton1 = new javax.swing.JButton(); + jButton2 = new javax.swing.JButton(); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + + jTable1.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jTable1.setModel(new javax.swing.table.DefaultTableModel( + new Object [][] { + + }, + new String [] { + "Item_id", "Item_name", "Quantity", "price", "total_price" + } + ) { + boolean[] canEdit = new boolean [] { + false, false, false, false, false + }; + + public boolean isCellEditable(int rowIndex, int columnIndex) { + return canEdit [columnIndex]; + } + }); + jTable1.setRowHeight(25); + jTable1.setRowMargin(3); + jScrollPane1.setViewportView(jTable1); + if (jTable1.getColumnModel().getColumnCount() > 0) { + jTable1.getColumnModel().getColumn(1).setMinWidth(140); + } + + jLabel1.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel1.setText("Bill No:"); + + jLabel2.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + + jLabel3.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel3.setText("Date:"); + + jLabel4.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + + jLabel5.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel5.setText("Total Amount:"); + + jLabel6.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + + jButton1.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jButton1.setText("Generate Invoice"); + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); + + jButton2.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jButton2.setText("HOME"); + jButton2.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton2ActionPerformed(evt); + } + }); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jButton2) + .addGap(31, 31, 31) + .addComponent(jLabel1) + .addGap(18, 18, 18) + .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(349, 349, 349) + .addComponent(jLabel3) + .addGap(18, 18, 18) + .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 239, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addGap(290, 290, 290) + .addComponent(jLabel5) + .addGap(51, 51, 51) + .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addGap(411, 411, 411) + .addComponent(jButton1)) + .addGroup(layout.createSequentialGroup() + .addGap(21, 21, 21) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 981, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addContainerGap(98, Short.MAX_VALUE)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(23, 23, 23) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jButton2) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel1)))) + .addGroup(layout.createSequentialGroup() + .addGap(32, 32, 32) + .addComponent(jLabel3)) + .addGroup(layout.createSequentialGroup() + .addGap(32, 32, 32) + .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(42, 42, 42) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 275, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(24, 24, 24) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel5) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 42, Short.MAX_VALUE) + .addComponent(jButton1)) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 0, Short.MAX_VALUE))) + .addContainerGap()) + ); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + DefaultTableModel model = (DefaultTableModel) jTable1.getModel(); + try { + + Class.forName("java.sql.DriverManager"); + Connection con = (Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/fs", "root", ""); + Statement stmt = con.createStatement(); + String query = "select item_id,item_name,quantity,price,totprice,MAX(biilno),date from bill"; + ResultSet rs = stmt.executeQuery(query); + { + while (rs.next()) { + String id = rs.getString("item_id"); + String name = rs.getString("item_name"); + String qun = rs.getString("quantity"); + String price = rs.getString("price"); + + String mfd = rs.getString("totprice"); + + String bill = rs.getString("MAX(biilno)"); + String date = rs.getString("date"); + jLabel2.setText(bill); + jLabel4.setText(date); + model.addRow(new Object[] {id,name,qun,price,mfd}); + } + //stmt.close(); + //con.close(); + } + } catch (ClassNotFoundException | SQLException e) { + JOptionPane.showMessageDialog(this, e.getMessage()); + //e.printStackTrace(); + } + int sum=0; + for(int i=0;i<jTable1.getRowCount();i++) + { + sum=sum+Integer.parseInt(jTable1.getValueAt(i,4).toString()); + } +jLabel6.setText(Integer.toString(sum)); + MessageFormat header =new MessageFormat("Invoice Print"); + MessageFormat footer =new MessageFormat("Page"); + try { + jTable1.print(JTable.PrintMode.FIT_WIDTH, header, footer); + + + } catch (PrinterException ex) { + Logger.getLogger(bill.class.getName()).log(Level.SEVERE, null, ex); + } + + + }//GEN-LAST:event_jButton1ActionPerformed + + private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed +this.setVisible(false); + mainFrame mm=new mainFrame(); + mm.setVisible(true); // TODO add your handling code here: + }//GEN-LAST:event_jButton2ActionPerformed + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + /* Set the Nimbus look and feel */ + //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> + /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. + * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html + */ + try { + for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { + if ("Nimbus".equals(info.getName())) { + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(bill.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + //</editor-fold> + + //</editor-fold> + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new bill().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jButton1; + private javax.swing.JButton jButton2; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JLabel jLabel4; + private javax.swing.JLabel jLabel5; + private javax.swing.JLabel jLabel6; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JTable jTable1; + // End of variables declaration//GEN-END:variables +} diff --git a/StockManagementSystem/src/MainFiles/epaln.JPG b/StockManagementSystem/src/MainFiles/epaln.JPG new file mode 100644 index 0000000..2ce7af8 Binary files /dev/null and b/StockManagementSystem/src/MainFiles/epaln.JPG differ diff --git a/StockManagementSystem/src/MainFiles/four.png b/StockManagementSystem/src/MainFiles/four.png new file mode 100644 index 0000000..7fcf5d4 Binary files /dev/null and b/StockManagementSystem/src/MainFiles/four.png differ diff --git a/StockManagementSystem/src/MainFiles/mainFrame.form b/StockManagementSystem/src/MainFiles/mainFrame.form new file mode 100644 index 0000000..97050e8 --- /dev/null +++ b/StockManagementSystem/src/MainFiles/mainFrame.form @@ -0,0 +1,229 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="3"/> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="4a" green="4a" id="Control Dk Shadow" palette="2" red="4a" type="palette"/> + </Property> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + <SyntheticProperty name="generateCenter" type="boolean" value="false"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Component id="jPanel1" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="24" max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="32767" attributes="0"/> + <Component id="jLabel1" min="-2" pref="929" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="51" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace pref="44" max="32767" attributes="0"/> + <Component id="jLabel1" min="-2" pref="58" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jPanel1" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Ubuntu" size="36" style="3"/> + </Property> + <Property name="text" type="java.lang.String" value="Welcome to Stock Management System"/> + </Properties> + </Component> + <Container class="javax.swing.JPanel" name="jPanel1"> + <Properties> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="0" green="ff" red="0" type="rgb"/> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Component id="jButton1" min="-2" pref="166" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="jButton2" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jButton4" min="-2" pref="145" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jButton6" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jButton3" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jButton7" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jButton5" min="-2" pref="111" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <Component id="jLabel2" min="-2" pref="1202" max="-2" attributes="0"/> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace pref="37" max="32767" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jButton2" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jButton4" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jButton6" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jButton5" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jButton3" alignment="3" min="-2" pref="36" max="-2" attributes="0"/> + <Component id="jButton7" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jLabel2" min="-2" pref="581" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JButton" name="jButton1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Add Product"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jButton1MouseClicked"/> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="jButton2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Search Product"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <AccessibilityProperties> + <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" value=""/> + <Property name="AccessibleContext.accessibleParent" type="javax.accessibility.Accessible" editor="org.netbeans.modules.form.ComponentChooserEditor"> + <ComponentRef name="jButton1"/> + </Property> + </AccessibilityProperties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jButton2MouseClicked"/> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="jButton4"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Inventory"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jButton4MouseClicked"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="jButton6"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Return Product"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton6ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="jButton5"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Logout"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jButton5MouseClicked"/> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton5ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="jButton3"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Purchase"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton3ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="jButton7"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Track sales"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton7ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="2" name="C:\Users\PRATAP KUMAR\OneDrive\Desktop\two.jpg"/> + </Property> + </Properties> + </Component> + </SubComponents> + </Container> + </SubComponents> +</Form> diff --git a/StockManagementSystem/src/MainFiles/mainFrame.java b/StockManagementSystem/src/MainFiles/mainFrame.java new file mode 100644 index 0000000..e2d8b94 --- /dev/null +++ b/StockManagementSystem/src/MainFiles/mainFrame.java @@ -0,0 +1,298 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package MainFiles; + +/** + * + * @author pratap + */ +public class mainFrame extends javax.swing.JFrame { + + /** + * Creates new form mainFrame + */ + public mainFrame() { + initComponents(); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents + private void initComponents() { + + jLabel1 = new javax.swing.JLabel(); + jPanel1 = new javax.swing.JPanel(); + jButton1 = new javax.swing.JButton(); + jButton2 = new javax.swing.JButton(); + jButton4 = new javax.swing.JButton(); + jButton6 = new javax.swing.JButton(); + jButton5 = new javax.swing.JButton(); + jButton3 = new javax.swing.JButton(); + jButton7 = new javax.swing.JButton(); + jLabel2 = new javax.swing.JLabel(); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + setBackground(java.awt.SystemColor.controlDkShadow); + + jLabel1.setFont(new java.awt.Font("Ubuntu", 3, 36)); // NOI18N + jLabel1.setText("Welcome to Stock Management System"); + + jPanel1.setForeground(new java.awt.Color(0, 255, 0)); + + jButton1.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jButton1.setText("Add Product"); + jButton1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + jButton1.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + jButton1MouseClicked(evt); + } + }); + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); + + jButton2.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jButton2.setText("Search Product"); + jButton2.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + jButton2.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + jButton2MouseClicked(evt); + } + }); + jButton2.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton2ActionPerformed(evt); + } + }); + + jButton4.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jButton4.setText("Inventory"); + jButton4.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + jButton4.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + jButton4MouseClicked(evt); + } + }); + + jButton6.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jButton6.setText("Return Product"); + jButton6.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + jButton6.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton6ActionPerformed(evt); + } + }); + + jButton5.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jButton5.setText("Logout"); + jButton5.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + jButton5.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + jButton5MouseClicked(evt); + } + }); + jButton5.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton5ActionPerformed(evt); + } + }); + + jButton3.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jButton3.setText("Purchase"); + jButton3.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + jButton3.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton3ActionPerformed(evt); + } + }); + + jButton7.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jButton7.setText("Track sales"); + jButton7.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + jButton7.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton7ActionPerformed(evt); + } + }); + + jLabel2.setIcon(new javax.swing.ImageIcon("C:\\Users\\PRATAP KUMAR\\OneDrive\\Desktop\\two.jpg")); // NOI18N + + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jButton2) + .addGap(18, 18, 18) + .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addComponent(jButton6) + .addGap(18, 18, 18) + .addComponent(jButton3) + .addGap(18, 18, 18) + .addComponent(jButton7) + .addGap(18, 18, 18) + .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 1202, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 0, Short.MAX_VALUE)) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addContainerGap(37, Short.MAX_VALUE) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jButton1) + .addComponent(jButton2) + .addComponent(jButton4) + .addComponent(jButton6) + .addComponent(jButton5) + .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jButton7)) + .addGap(18, 18, 18) + .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 581, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap()) + ); + + jButton2.getAccessibleContext().setAccessibleDescription(""); + jButton2.getAccessibleContext().setAccessibleParent(jButton1); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(24, Short.MAX_VALUE)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 929, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(51, 51, 51)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap(44, Short.MAX_VALUE) + .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + ); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked + + this.setVisible(false); + addproduct ab = new addproduct(); + ab.setVisible(true); + + }//GEN-LAST:event_jButton1MouseClicked + + private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton2MouseClicked + this.setVisible(false); + Searchproduct ab = new Searchproduct(); + ab.setVisible(true); + }//GEN-LAST:event_jButton2MouseClicked + + private void jButton5MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton5MouseClicked + this.setVisible(false); + Login ab = new Login(this, rootPaneCheckingEnabled); + ab.setVisible(true); + }//GEN-LAST:event_jButton5MouseClicked + + private void jButton4MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton4MouseClicked + this.setVisible(false); + Inventory ab = new Inventory(); + ab.setVisible(true); + }//GEN-LAST:event_jButton4MouseClicked + + private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_jButton2ActionPerformed + + private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed + this.setVisible(false); + returnproduct ab1 = new returnproduct(); + ab1.setVisible(true); // TODO add your handling code here: + }//GEN-LAST:event_jButton6ActionPerformed + + private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed + this.setVisible(false); + Purchase ab1 = new Purchase(); + ab1.setVisible(true); // TODO add your handling code here: + }//GEN-LAST:event_jButton3ActionPerformed + + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_jButton1ActionPerformed + + private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_jButton5ActionPerformed + + private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed + this.setVisible(false); + Track ab1 = new Track(); + ab1.setVisible(true); // TODO add your handling code here: + }//GEN-LAST:event_jButton7ActionPerformed + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + /* Set the Nimbus look and feel */ + //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> + /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. + * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html + */ + try { + for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { + if ("Nimbus".equals(info.getName())) { + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } catch (ClassNotFoundException ex) { + java.util.logging.Logger.getLogger(mainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(mainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(mainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(mainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + //</editor-fold> + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new mainFrame().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jButton1; + private javax.swing.JButton jButton2; + private javax.swing.JButton jButton3; + private javax.swing.JButton jButton4; + private javax.swing.JButton jButton5; + private javax.swing.JButton jButton6; + private javax.swing.JButton jButton7; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JPanel jPanel1; + // End of variables declaration//GEN-END:variables +} diff --git a/StockManagementSystem/src/MainFiles/one.jpg b/StockManagementSystem/src/MainFiles/one.jpg new file mode 100644 index 0000000..72017af Binary files /dev/null and b/StockManagementSystem/src/MainFiles/one.jpg differ diff --git a/StockManagementSystem/src/MainFiles/returnproduct.form b/StockManagementSystem/src/MainFiles/returnproduct.form new file mode 100644 index 0000000..cff6c63 --- /dev/null +++ b/StockManagementSystem/src/MainFiles/returnproduct.form @@ -0,0 +1,363 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="3"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + <SyntheticProperty name="generateCenter" type="boolean" value="false"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="-2" pref="373" max="-2" attributes="0"/> + <Component id="jLabel1" min="-2" pref="346" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="jButton2" min="-2" pref="95" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="73" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="42" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel4" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="jLabel5" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="107" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Component id="jTextField1" min="-2" pref="118" max="-2" attributes="0"/> + <EmptySpace pref="386" max="32767" attributes="0"/> + <Component id="jButton1" min="-2" pref="117" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="281" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + <Component id="jLabel2" min="-2" pref="195" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="80" max="-2" attributes="0"/> + <Component id="bid" min="-2" pref="149" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="124" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="jTextField2" min="-2" pref="118" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="jScrollPane1" min="-2" pref="679" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="27" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel8" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="jLabel9" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="jLabel6" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="40" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jTextField5" min="-2" pref="121" max="-2" attributes="0"/> + <Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0"> + <Component id="jTextField4" alignment="0" pref="117" max="32767" attributes="0"/> + <Component id="jTextField3" alignment="0" max="32767" attributes="0"/> + </Group> + </Group> + <EmptySpace max="32767" attributes="0"/> + </Group> + </Group> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="153" max="-2" attributes="0"/> + <Component id="jButton3" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="21" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jButton2" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="bid" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jTextField1" alignment="1" min="-2" max="-2" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel4" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="7" max="-2" attributes="0"/> + </Group> + </Group> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="21" max="-2" attributes="0"/> + <Component id="jTextField2" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel5" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel8" min="-2" max="-2" attributes="0"/> + <Component id="jTextField3" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel9" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jTextField4" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="20" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jTextField5" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace pref="52" max="32767" attributes="0"/> + <Component id="jButton3" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="34" max="-2" attributes="0"/> + <Component id="jButton1" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jScrollPane1" pref="0" max="32767" attributes="0"/> + </Group> + </Group> + <EmptySpace min="-2" pref="81" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Search bill no"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="bid"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + </Properties> + </Component> + <Container class="javax.swing.JScrollPane" name="jScrollPane1"> + <AuxValues> + <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> + </AuxValues> + + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> + <SubComponents> + <Component class="javax.swing.JTable" name="table"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> + <Table columnCount="5" rowCount="0"> + <Column editable="false" title="item_id" type="java.lang.Object"/> + <Column editable="false" title="item_name" type="java.lang.Object"/> + <Column editable="false" title="quntatity" type="java.lang.Object"/> + <Column editable="false" title="price" type="java.lang.Object"/> + <Column editable="false" title="totalprice" type="java.lang.Object"/> + </Table> + </Property> + <Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor"> + <TableColumnModel selectionModel="0"> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + </TableColumnModel> + </Property> + <Property name="rowHeight" type="int" value="25"/> + <Property name="rowMargin" type="int" value="3"/> + <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> + <TableHeader reorderingAllowed="true" resizingAllowed="true"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="tableMouseClicked"/> + </Events> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JButton" name="jButton1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Search"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jButton1MouseClicked"/> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="jButton2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Back"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jButton2MouseClicked"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel4"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Item_Id"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel5"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Item_Name:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel6"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Total Price"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel8"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Qunatity (in lit/kg)"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel9"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Price Per Unit"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="jTextField1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jTextField1ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JTextField" name="jTextField2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="jTextField3"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jTextField3MouseClicked"/> + <EventHandler event="mouseEntered" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jTextField3MouseEntered"/> + <EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jTextField3MouseExited"/> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jTextField3ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JTextField" name="jTextField4"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="jTextField5"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="jButton3"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Return"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton3ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="48" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Return Product"/> + </Properties> + </Component> + </SubComponents> +</Form> diff --git a/StockManagementSystem/src/MainFiles/returnproduct.java b/StockManagementSystem/src/MainFiles/returnproduct.java new file mode 100644 index 0000000..4a638e0 --- /dev/null +++ b/StockManagementSystem/src/MainFiles/returnproduct.java @@ -0,0 +1,480 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package MainFiles; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import javax.swing.JOptionPane; +import javax.swing.table.DefaultTableModel; + +/** + * + * @author pratap + */ +public class returnproduct extends javax.swing.JFrame { + + /** + * Creates new form Searchproduct + */ + public returnproduct() { + initComponents(); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents + private void initComponents() { + + jLabel2 = new javax.swing.JLabel(); + bid = new javax.swing.JTextField(); + jScrollPane1 = new javax.swing.JScrollPane(); + table = new javax.swing.JTable(); + jButton1 = new javax.swing.JButton(); + jButton2 = new javax.swing.JButton(); + jLabel4 = new javax.swing.JLabel(); + jLabel5 = new javax.swing.JLabel(); + jLabel6 = new javax.swing.JLabel(); + jLabel8 = new javax.swing.JLabel(); + jLabel9 = new javax.swing.JLabel(); + jTextField1 = new javax.swing.JTextField(); + jTextField2 = new javax.swing.JTextField(); + jTextField3 = new javax.swing.JTextField(); + jTextField4 = new javax.swing.JTextField(); + jTextField5 = new javax.swing.JTextField(); + jButton3 = new javax.swing.JButton(); + jLabel1 = new javax.swing.JLabel(); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + + jLabel2.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel2.setText("Search bill no"); + + bid.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + + table.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + table.setModel(new javax.swing.table.DefaultTableModel( + new Object [][] { + + }, + new String [] { + "item_id", "item_name", "quntatity", "price", "totalprice" + } + ) { + boolean[] canEdit = new boolean [] { + false, false, false, false, false + }; + + public boolean isCellEditable(int rowIndex, int columnIndex) { + return canEdit [columnIndex]; + } + }); + table.setRowHeight(25); + table.setRowMargin(3); + table.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + tableMouseClicked(evt); + } + }); + jScrollPane1.setViewportView(table); + + jButton1.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jButton1.setText("Search"); + jButton1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + jButton1.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + jButton1MouseClicked(evt); + } + }); + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); + + jButton2.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jButton2.setText("Back"); + jButton2.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + jButton2.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + jButton2MouseClicked(evt); + } + }); + + jLabel4.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel4.setText("Item_Id"); + + jLabel5.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel5.setText("Item_Name:"); + + jLabel6.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel6.setText("Total Price"); + + jLabel8.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel8.setText("Qunatity (in lit/kg)"); + + jLabel9.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel9.setText("Price Per Unit"); + + jTextField1.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jTextField1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jTextField1ActionPerformed(evt); + } + }); + + jTextField2.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + + jTextField3.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jTextField3.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + jTextField3MouseClicked(evt); + } + public void mouseEntered(java.awt.event.MouseEvent evt) { + jTextField3MouseEntered(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + jTextField3MouseExited(evt); + } + }); + jTextField3.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jTextField3ActionPerformed(evt); + } + }); + + jTextField4.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + + jTextField5.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + + jButton3.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jButton3.setText("Return"); + jButton3.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton3ActionPerformed(evt); + } + }); + + jLabel1.setFont(new java.awt.Font("Times New Roman", 1, 48)); // NOI18N + jLabel1.setText("Return Product"); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addGap(373, 373, 373) + .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 346, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(73, 73, 73)) + .addGroup(layout.createSequentialGroup() + .addGap(42, 42, 42) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel4) + .addComponent(jLabel5)) + .addGap(107, 107, 107) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 386, Short.MAX_VALUE) + .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(281, 281, 281)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 195, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(80, 80, 80) + .addComponent(bid, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(124, 124, 124)) + .addGroup(layout.createSequentialGroup() + .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 679, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(27, 27, 27)))) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel8) + .addComponent(jLabel9) + .addComponent(jLabel6)) + .addGap(40, 40, 40) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addComponent(jTextField4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 117, Short.MAX_VALUE) + .addComponent(jTextField3, javax.swing.GroupLayout.Alignment.LEADING))) + .addContainerGap()))) + .addGroup(layout.createSequentialGroup() + .addGap(153, 153, 153) + .addComponent(jButton3) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(21, 21, 21) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jButton2) + .addComponent(jLabel1)) + .addGap(18, 18, 18) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel2) + .addComponent(bid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jTextField1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel4) + .addGap(7, 7, 7))) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(21, 21, 21) + .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel5))) + .addGap(18, 18, 18) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel8) + .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel9) + .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(20, 20, 20) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel6) + .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 52, Short.MAX_VALUE) + .addComponent(jButton3)) + .addGroup(layout.createSequentialGroup() + .addGap(34, 34, 34) + .addComponent(jButton1) + .addGap(18, 18, 18) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))) + .addGap(81, 81, 81)) + ); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked + String ii=bid.getText(); + DefaultTableModel model = (DefaultTableModel) table.getModel(); + try { + Class.forName("java.sql.DriverManager"); + Connection con = (Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/fs", "root", ""); + + Statement stmt = con.createStatement(); + String query = "select * from bill where biilno='"+ii+"' "; + ResultSet rs=stmt.executeQuery(query); + + while(rs.next()) { + String id = rs.getString("item_id"); + String name = rs.getString("item_name"); + String qun = rs.getString("quantity"); + String price = rs.getString("price"); + + String mfd = rs.getString("totprice"); + + + + + model.addRow(new Object[] {id,name,qun,price,mfd}); + } + rs.close(); + //stmt.close(); + //con.close(); + } catch (Exception e) { + JOptionPane.showMessageDialog(this, e.getMessage()); + //e.printStackTrace(); + } + + }//GEN-LAST:event_jButton1MouseClicked + + private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton2MouseClicked + this.setVisible(false); + mainFrame mm=new mainFrame(); + mm.setVisible(true); + }//GEN-LAST:event_jButton2MouseClicked + + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + jTextField1.setText(""); + jTextField2.setText(""); + jTextField3.setText(""); + jTextField4.setText(""); + jTextField5.setText(""); + + +// TODO add your handling code here: + }//GEN-LAST:event_jButton1ActionPerformed + + private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField1ActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_jTextField1ActionPerformed + + private void tableMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tableMouseClicked + DefaultTableModel model=(DefaultTableModel)table.getModel(); + int selectedRowIndex =table.getSelectedRow(); + jTextField1.setText(model.getValueAt(selectedRowIndex,0).toString()); + jTextField2.setText(model.getValueAt(selectedRowIndex,1).toString()); + jTextField3.setText(model.getValueAt(selectedRowIndex,2).toString()); + + jTextField4.setText(model.getValueAt(selectedRowIndex,3).toString()); + jTextField5.setText(model.getValueAt(selectedRowIndex,4).toString()); + + + }//GEN-LAST:event_tableMouseClicked + + private void jTextField3MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextField3MouseEntered + + + }//GEN-LAST:event_jTextField3MouseEntered + + private void jTextField3MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextField3MouseClicked + // TODO add your handling code here: + }//GEN-LAST:event_jTextField3MouseClicked + + private void jTextField3MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextField3MouseExited + String qun= jTextField3.getText(); + String pri=jTextField4.getText(); + int N3=Integer.parseInt(pri); + int N1=Integer.parseInt(qun); + int N2=N1; + int N4=N1*N3; + jTextField5.setText(String.valueOf(N4)); // TODO add your handling code here: + }//GEN-LAST:event_jTextField3MouseExited + + private void jTextField3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField3ActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_jTextField3ActionPerformed + + private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed + workWithDatabase(); +} + public void workWithDatabase() + { + Connection c=null; + Statement s=null; + ResultSet rs1=null; + int flag=0; + try{ + + Class.forName("com.mysql.jdbc.Driver"); + c=DriverManager.getConnection("jdbc:mysql://localhost/fs","root",""); + s=c.createStatement(); + + DefaultTableModel model = (DefaultTableModel) table.getModel(); + int selectedRowIndex =table.getSelectedRow(); + String a=model.getValueAt(selectedRowIndex,0).toString(); + + String c1=jTextField3.getText(); + + + String s1=a; + + // rs1 = s.executeQuery ("select quantity from inventory where item_id="+"'"+s1+"'"); + + int id=Integer.parseInt(c1); + rs1 = s.executeQuery ("select quantity from inventory where item_id="+"'"+s1+"'"); + + + // jLabel6.setText(s1); + + while(rs1.next()) { + String id1=rs1.getString("quantity"); + int id2=Integer.parseInt(id1); + + int id3=id2+id; + s.executeUpdate("Update inventory set quantity="+id3+" where item_id="+"'"+s1+"'"); + + } + /* while(rs1.next()) + { + String quantity1=rs1.getString("quantity"); + String q3 = quantity1; + + + }*/ + rs1.close(); + + + + + +} + catch(SQLException | ClassNotFoundException e1) + { + System.out.println(e1); + } + }//GEN-LAST:event_jButton3ActionPerformed + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + /* Set the Nimbus look and feel */ + //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> + /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. + * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html + */ + try { + for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { + if ("Nimbus".equals(info.getName())) { + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } catch (ClassNotFoundException ex) { + java.util.logging.Logger.getLogger(Searchproduct.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(Searchproduct.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(Searchproduct.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(Searchproduct.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + //</editor-fold> + //</editor-fold> + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new Searchproduct().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JTextField bid; + private javax.swing.JButton jButton1; + private javax.swing.JButton jButton2; + private javax.swing.JButton jButton3; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel4; + private javax.swing.JLabel jLabel5; + private javax.swing.JLabel jLabel6; + private javax.swing.JLabel jLabel8; + private javax.swing.JLabel jLabel9; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JTextField jTextField1; + private javax.swing.JTextField jTextField2; + private javax.swing.JTextField jTextField3; + private javax.swing.JTextField jTextField4; + private javax.swing.JTextField jTextField5; + private javax.swing.JTable table; + // End of variables declaration//GEN-END:variables +} diff --git a/StockManagementSystem/src/MainFiles/supplierapprove.form b/StockManagementSystem/src/MainFiles/supplierapprove.form new file mode 100644 index 0000000..c51ae2a --- /dev/null +++ b/StockManagementSystem/src/MainFiles/supplierapprove.form @@ -0,0 +1,179 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="3"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + <SyntheticProperty name="generateCenter" type="boolean" value="false"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="-2" pref="39" max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Group type="102" attributes="0"> + <Component id="jLabel1" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jLabel2" min="-2" pref="103" max="-2" attributes="0"/> + <EmptySpace pref="298" max="32767" attributes="0"/> + <Component id="jButton3" min="-2" max="-2" attributes="0"/> + </Group> + <Component id="jScrollPane1" alignment="0" max="32767" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <Component id="jButton2" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="jButton1" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="-2" pref="66" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="11" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jButton2" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Component id="jScrollPane1" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="jButton3" min="-2" max="-2" attributes="0"/> + <Group type="103" alignment="0" groupAlignment="1" attributes="0"> + <Component id="jLabel2" min="-2" pref="27" max="-2" attributes="0"/> + <Component id="jLabel1" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JScrollPane" name="jScrollPane1"> + <AuxValues> + <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> + </AuxValues> + + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> + <SubComponents> + <Component class="javax.swing.JTable" name="table2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> + <Table columnCount="5" rowCount="0"> + <Column editable="false" title="item_id" type="java.lang.Object"/> + <Column editable="false" title="item_name" type="java.lang.Object"/> + <Column editable="false" title="quantity" type="java.lang.Object"/> + <Column editable="false" title="unit price" type="java.lang.Object"/> + <Column editable="false" title="total price" type="java.lang.Object"/> + </Table> + </Property> + <Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor"> + <TableColumnModel selectionModel="0"> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + </TableColumnModel> + </Property> + <Property name="rowHeight" type="int" value="25"/> + <Property name="rowMargin" type="int" value="3"/> + <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> + <TableHeader reorderingAllowed="true" resizingAllowed="true"/> + </Property> + </Properties> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JButton" name="jButton1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="view orders"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="jButton2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Logout"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Total Amount"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="jButton3"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Times New Roman" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Approve order"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton3ActionPerformed"/> + </Events> + </Component> + </SubComponents> +</Form> diff --git a/StockManagementSystem/src/MainFiles/supplierapprove.java b/StockManagementSystem/src/MainFiles/supplierapprove.java new file mode 100644 index 0000000..ab55b74 --- /dev/null +++ b/StockManagementSystem/src/MainFiles/supplierapprove.java @@ -0,0 +1,316 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package MainFiles; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import javax.swing.JOptionPane; +import javax.swing.table.DefaultTableModel; + +/** + * + * @author pratap + */ +public class supplierapprove extends javax.swing.JFrame { + + /** + * Creates new form addtocart + */ + String roll; + public supplierapprove() { + initComponents(); + roll=""; + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents + private void initComponents() { + + jScrollPane1 = new javax.swing.JScrollPane(); + table2 = new javax.swing.JTable(); + jButton1 = new javax.swing.JButton(); + jButton2 = new javax.swing.JButton(); + jLabel1 = new javax.swing.JLabel(); + jLabel2 = new javax.swing.JLabel(); + jButton3 = new javax.swing.JButton(); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + + table2.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + table2.setModel(new javax.swing.table.DefaultTableModel( + new Object [][] { + + }, + new String [] { + "item_id", "item_name", "quantity", "unit price", "total price" + } + ) { + boolean[] canEdit = new boolean [] { + false, false, false, false, false + }; + + public boolean isCellEditable(int rowIndex, int columnIndex) { + return canEdit [columnIndex]; + } + }); + table2.setRowHeight(25); + table2.setRowMargin(3); + jScrollPane1.setViewportView(table2); + + jButton1.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jButton1.setText("view orders"); + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); + + jButton2.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jButton2.setText("Logout"); + jButton2.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton2ActionPerformed(evt); + } + }); + + jLabel1.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jLabel1.setText("Total Amount"); + + jLabel2.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + + jButton3.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N + jButton3.setText("Approve order"); + jButton3.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton3ActionPerformed(evt); + } + }); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addGap(39, 39, 39) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel1) + .addGap(18, 18, 18) + .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 298, Short.MAX_VALUE) + .addComponent(jButton3)) + .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() + .addComponent(jButton2) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jButton1))) + .addGap(66, 66, 66)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(11, 11, 11) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jButton1) + .addComponent(jButton2)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jButton3) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel1))) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + + + + DefaultTableModel model = (DefaultTableModel) table2.getModel(); + model.setRowCount(0); + int total = 0; + String tot = ""; + + // ProductInformation.categoryChooser = "electronics"; + try { + Class.forName("java.sql.DriverManager"); + Connection con = (Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/fs", "root", ""); + + Statement stmt = con.createStatement(); + String query = "select * from purchase "; + ResultSet rs=stmt.executeQuery(query); + + while(rs.next()) { + String id = rs.getString("item_id"); + String name = rs.getString("item_name"); + String qun = rs.getString("quantity"); + String price1 = rs.getString("price"); + + String mfd = rs.getString("totprice"); + + + model.addRow(new Object[] {id,name,qun,price1,mfd}); + } + rs.close(); + /* int success=stmt.executeUpdate(query); + if(success==1) + { + JOptionPane.showMessageDialog(this, "Product Successfully updated to inventory"); + //emp1.showMessageDialog(this, "Problem in Saving. Retry"); + } + else + { + + JOptionPane.showMessageDialog(this, "Problem in Saving. Retry"); + } + //stmt.close();*/ + //con.close(); + }catch (Exception e) { + JOptionPane.showMessageDialog(this, e.getMessage()); + //e.printStackTrace(); + } + int sum=0; + for(int i=0;i<table2.getRowCount();i++) + { + sum=sum+Integer.parseInt(table2.getValueAt(i,4).toString()); + } +jLabel2.setText(Integer.toString(sum)); +//String b=jLabel2.getText(); + + +// TODO add your handling code here: + }//GEN-LAST:event_jButton1ActionPerformed + + private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed +this.setVisible(false); + Slogin mm=new Slogin(); + mm.setVisible(true); // TODO add your handling code here: + }//GEN-LAST:event_jButton2ActionPerformed + + private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed + + workWithDatabase(); + + } + + + public void workWithDatabase() + { + Connection c=null; + Statement s=null; + ResultSet rs1=null; + int flag=0; + try{ + + Class.forName("com.mysql.jdbc.Driver"); + c=DriverManager.getConnection("jdbc:mysql://localhost/fs","root",""); + s=c.createStatement(); + + DefaultTableModel model = (DefaultTableModel) table2.getModel(); + int selectedRowIndex =table2.getSelectedRow(); + String a=model.getValueAt(selectedRowIndex,0).toString(); + + String c1=model.getValueAt(selectedRowIndex,2).toString(); + + + String s1=a; + + // rs1 = s.executeQuery ("select quantity from inventory where item_id="+"'"+s1+"'"); + + int id=Integer.parseInt(c1); + rs1 = s.executeQuery ("select quantity from inventory where item_id="+"'"+s1+"'"); + + + // jLabel6.setText(s1); + + while(rs1.next()) { + String id1=rs1.getString("quantity"); + int id2=Integer.parseInt(id1); + + int id3=id2+id; + s.executeUpdate("Update inventory set quantity="+id3+" where item_id="+"'"+s1+"'"); + + } + /* while(rs1.next()) + { + String quantity1=rs1.getString("quantity"); + String q3 = quantity1; + + + }*/ + + rs1.close(); + + + + +} + catch(SQLException | ClassNotFoundException e1) + { + System.out.println(e1); + } +// String b=jLabel2.getText(); + // TODO add your handling code here: + }//GEN-LAST:event_jButton3ActionPerformed + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + /* Set the Nimbus look and feel */ + //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> + /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. + * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html + */ + try { + for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { + if ("Nimbus".equals(info.getName())) { + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } catch (ClassNotFoundException ex) { + java.util.logging.Logger.getLogger(supplierapprove.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(supplierapprove.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(supplierapprove.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(supplierapprove.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + //</editor-fold> + //</editor-fold> + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new supplierapprove().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jButton1; + private javax.swing.JButton jButton2; + private javax.swing.JButton jButton3; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JTable table2; + // End of variables declaration//GEN-END:variables +} diff --git a/StockManagementSystem/src/MainFiles/three.png b/StockManagementSystem/src/MainFiles/three.png new file mode 100644 index 0000000..0a0b584 Binary files /dev/null and b/StockManagementSystem/src/MainFiles/three.png differ diff --git a/StockManagementSystem/src/MainFiles/two.jpg b/StockManagementSystem/src/MainFiles/two.jpg new file mode 100644 index 0000000..d8484ac Binary files /dev/null and b/StockManagementSystem/src/MainFiles/two.jpg differ diff --git a/fs.sql b/fs.sql new file mode 100644 index 0000000..6f8737b --- /dev/null +++ b/fs.sql @@ -0,0 +1,137 @@ +-- phpMyAdmin SQL Dump +-- version 3.3.9 +-- http://www.phpmyadmin.net +-- +-- Host: localhost +-- Generation Time: Mar 03, 2020 at 10:05 AM +-- Server version: 5.1.53 +-- PHP Version: 5.3.4 + +SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; + +-- +-- Database: `fs` +-- + +-- -------------------------------------------------------- + +-- +-- Table structure for table `bill` +-- + +CREATE TABLE IF NOT EXISTS `bill` ( + `item_id` varchar(10) NOT NULL, + `item_name` varchar(30) NOT NULL, + `quantity` int(20) NOT NULL, + `price` float NOT NULL, + `totprice` float NOT NULL, + `biilno` int(30) NOT NULL AUTO_INCREMENT, + `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`biilno`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=54 ; + +-- +-- Dumping data for table `bill` +-- + +INSERT INTO `bill` (`item_id`, `item_name`, `quantity`, `price`, `totprice`, `biilno`, `date`) VALUES +('ft4', 'ammonia', 7, 700, 4900, 41, '2018-10-28 21:54:53'), +('ft4', 'ammonia', 4, 700, 2800, 42, '2018-10-28 21:57:27'), +('sd2', 'rice ', 4, 500, 2000, 43, '2018-10-28 22:19:38'), +('ft6', 'groundnut', 6, 400, 2400, 44, '2018-10-29 00:08:16'), +('ft6', 'groundnut', 5, 400, 2000, 45, '2018-10-29 00:10:22'), +('ft2', 'ammonia', 5, 150, 750, 46, '2018-10-29 01:29:37'), +('ft3', 'NH4', 5, 700, 3500, 47, '2018-10-29 01:34:45'), +('ft3', 'NH4', 5, 700, 3500, 48, '2018-10-29 10:34:47'), +('ft1', 'urea', 2, 200, 400, 49, '2018-10-29 19:48:20'), +('ft1', 'urea', 2, 200, 400, 50, '2018-10-29 20:11:42'), +('ft5', 'sulphate', 2, 900, 1800, 51, '2020-02-27 15:18:26'), +('ft5', 'sulphate', 2, 900, 1800, 52, '2020-02-27 15:19:24'), +('ft1', 'urea', 2, 200, 400, 53, '2020-03-03 15:18:54'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `cart` +-- + +CREATE TABLE IF NOT EXISTS `cart` ( + `item_id` varchar(10) NOT NULL, + `item_name` varchar(30) NOT NULL, + `quantity` int(20) NOT NULL, + `price` float NOT NULL, + `totprice` double NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `cart` +-- + + +-- -------------------------------------------------------- + +-- +-- Table structure for table `inventory` +-- + +CREATE TABLE IF NOT EXISTS `inventory` ( + `item_id` varchar(10) NOT NULL, + `item_name` varchar(30) NOT NULL, + `quantity` int(20) NOT NULL, + `price` float NOT NULL, + `mfd` varchar(30) NOT NULL, + `exp` varchar(30) NOT NULL, + `batchno` varchar(30) NOT NULL, + PRIMARY KEY (`item_id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `inventory` +-- + +INSERT INTO `inventory` (`item_id`, `item_name`, `quantity`, `price`, `mfd`, `exp`, `batchno`) VALUES +('ft5', 'sulphate', 70, 900, '5/10/2017', '6/10/2018', 'h789'), +('ft4', 'ammonia', 39, 700, '03/10/2017', '03/10/2018', 't200'), +('ft3', 'NH4', 40, 700, '22/11/2017', '22/11/2018', 'b85'), +('ft2', 'ammonia', 85, 150, '20/08/2018', '11/12/2019', 'am123'), +('ft1', 'urea', 370, 200, '20/10/2018', '20/11/2019', 'asdc1'), +('sd1', 'Grounnuts', 400, 300, '4/5/2016', '4/3/2018', 'h78'), +('sd2', 'rice ', 66, 500, '4/6/2017', '3/8/2108', 'g77'), +('sd3', 'chilli', 80, 500, '3/5/2017', '5/7/2019', 'g67'), +('sd4', 'wheat', 90, 300, '7/2/2017', '5/5/2019', 'h67'), +('sd5', 'corn', 50, 900, '8/7/2017', '7/5/2019', 'hf6'), +('ft6', 'groundnut', 49, 400, '4/5/2017', '4/4/2019', 'h23'), +('12', 'one', 500, 5, '29-02-2019', '29-02-2020', '45'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `purchase` +-- + +CREATE TABLE IF NOT EXISTS `purchase` ( + `biilno` int(10) NOT NULL AUTO_INCREMENT, + `item_id` varchar(30) NOT NULL, + `item_name` varchar(20) NOT NULL, + `quantity` int(20) NOT NULL, + `price` double NOT NULL, + `totprice` double NOT NULL, + `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`biilno`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ; + +-- +-- Dumping data for table `purchase` +-- + +INSERT INTO `purchase` (`biilno`, `item_id`, `item_name`, `quantity`, `price`, `totprice`, `date`) VALUES +(9, 'ft5', 'sulphate', 5, 900, 4450, '2020-02-27 15:21:12'), +(8, 'ft1', 'urea', 20, 200, 3800, '2018-10-29 20:16:01'), +(7, 'ft1', 'urea', 10, 200, 1900, '2018-10-29 19:51:05'), +(10, 'ft1', 'urea', 6, 200, 1140, '2020-03-03 15:21:22'); diff --git a/mysql-connector-java-5.1.37-bin.jar b/mysql-connector-java-5.1.37-bin.jar new file mode 100644 index 0000000..465af67 Binary files /dev/null and b/mysql-connector-java-5.1.37-bin.jar differ diff --git a/rs2xml.jar b/rs2xml.jar new file mode 100644 index 0000000..75d9c62 Binary files /dev/null and b/rs2xml.jar differ