-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created JavaFX Fully Functional Application
- Loading branch information
0 parents
commit 1c8a1cd
Showing
41 changed files
with
2,994 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre1.8.0_171"/> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="src" path="asset"/> | ||
<classpathentry kind="lib" path="/MysqlConnector/lib/mysql-connector-java-8.0.11.jar"/> | ||
<classpathentry kind="lib" path="/Practice/lib/commons-collections4-4.0.jar"/> | ||
<classpathentry kind="lib" path="/Practice/lib/commons-collections4-4.2.jar"/> | ||
<classpathentry kind="lib" path="/Practice/lib/poi-3.17.jar"/> | ||
<classpathentry kind="lib" path="/Practice/lib/poi-ooxml-3.17.jar"/> | ||
<classpathentry kind="lib" path="/Practice/lib/poi-ooxml-schemas-3.17.jar"/> | ||
<classpathentry kind="lib" path="/Practice/lib/xmlbeans-2.3.0.jar"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>ProjectOOP</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
eclipse.preferences.version=1 | ||
encoding//src/gasAgencyManagement/ExcelFileReader.java=UTF-8 | ||
encoding//src/gasAgencyManagement/HomeWindow.java=UTF-8 | ||
encoding//src/gasAgencyManagement/LoginWindow.java=UTF-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled | ||
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore | ||
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull | ||
org.eclipse.jdt.core.compiler.annotation.nonnull.secondary= | ||
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault | ||
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary= | ||
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable | ||
org.eclipse.jdt.core.compiler.annotation.nullable.secondary= | ||
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled | ||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 | ||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve | ||
org.eclipse.jdt.core.compiler.compliance=1.8 | ||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate | ||
org.eclipse.jdt.core.compiler.debug.localVariable=generate | ||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate | ||
org.eclipse.jdt.core.compiler.problem.APILeak=warning | ||
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning | ||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | ||
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore | ||
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning | ||
org.eclipse.jdt.core.compiler.problem.deadCode=warning | ||
org.eclipse.jdt.core.compiler.problem.deprecation=warning | ||
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled | ||
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled | ||
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning | ||
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore | ||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | ||
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore | ||
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore | ||
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled | ||
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore | ||
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning | ||
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning | ||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error | ||
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning | ||
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled | ||
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning | ||
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning | ||
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore | ||
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore | ||
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning | ||
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore | ||
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore | ||
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled | ||
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore | ||
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore | ||
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled | ||
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning | ||
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore | ||
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning | ||
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning | ||
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore | ||
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning | ||
org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning | ||
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error | ||
org.eclipse.jdt.core.compiler.problem.nullReference=warning | ||
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error | ||
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning | ||
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning | ||
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore | ||
org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning | ||
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore | ||
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore | ||
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore | ||
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning | ||
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning | ||
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore | ||
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore | ||
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore | ||
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore | ||
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore | ||
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled | ||
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning | ||
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled | ||
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled | ||
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled | ||
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore | ||
org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning | ||
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning | ||
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled | ||
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning | ||
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning | ||
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore | ||
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning | ||
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning | ||
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled | ||
org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info | ||
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore | ||
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore | ||
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore | ||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore | ||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled | ||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled | ||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled | ||
org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore | ||
org.eclipse.jdt.core.compiler.problem.unusedImport=warning | ||
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning | ||
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning | ||
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore | ||
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore | ||
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled | ||
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled | ||
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled | ||
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning | ||
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore | ||
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning | ||
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning | ||
org.eclipse.jdt.core.compiler.source=1.8 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
package gasAgencyManagement; | ||
|
||
import java.sql.Connection; | ||
import java.sql.DriverManager; | ||
import java.sql.PreparedStatement; | ||
import java.sql.ResultSet; | ||
import java.sql.SQLException; | ||
import java.sql.Statement; | ||
public class Add { | ||
private Connection connect = null; | ||
private Statement statement = null; | ||
private PreparedStatement preparedStatement = null; | ||
private ResultSet resultSet = null; | ||
public void addCustomer(String meterNo, String name, String areaCode, String username,String status) throws ClassNotFoundException, SQLException { | ||
Class.forName("com.mysql.jdbc.Driver"); | ||
connect = DriverManager.getConnection("jdbc:mysql://localhost:3306/gas_agency?user=mohit&password=Mohit@2K"); | ||
|
||
String q = String.format("INSERT INTO customer_data(meter_no,name,area_code,admin_id,status)VALUES('%s','%s','%s','%s','%s');", meterNo,name,areaCode,username,status); | ||
preparedStatement = connect.prepareStatement(q); | ||
preparedStatement.executeUpdate(); | ||
preparedStatement.close(); | ||
connect.close(); | ||
|
||
} | ||
public int removeCustomer(String meterNo, String name, String areaCode,String status) throws ClassNotFoundException, SQLException { | ||
int checkExist = 0; | ||
String passQuery = String.format("SELECT * FROM customer_data WHERE meter_no = '%s' AND name = '%s' AND area_code = '%s' AND status = 'active';", meterNo,name,areaCode); | ||
Class.forName("com.mysql.jdbc.Driver"); | ||
connect = DriverManager.getConnection("jdbc:mysql://localhost:3306/gas_agency?user=mohit&password=Mohit@2K"); | ||
statement = connect.createStatement(); | ||
resultSet = statement.executeQuery(passQuery); | ||
while(resultSet.next()) { | ||
checkExist++; | ||
} | ||
resultSet.close(); | ||
statement.close(); | ||
connect.close(); | ||
if(checkExist == 0) | ||
return 0; | ||
Class.forName("com.mysql.jdbc.Driver"); | ||
connect = DriverManager.getConnection("jdbc:mysql://localhost:3306/gas_agency?user=mohit&password=Mohit@2K"); | ||
|
||
String q = String.format("UPDATE customer_data SET status = 'inactivated' WHERE meter_no = '%s' AND name = '%s' AND area_code = '%s';", meterNo,name,areaCode); | ||
preparedStatement = connect.prepareStatement(q); | ||
preparedStatement.executeUpdate(); | ||
preparedStatement.close(); | ||
connect.close(); | ||
return 1; | ||
} | ||
public int unregisterSelf(String meterNo,String status) throws ClassNotFoundException, SQLException { | ||
int checkExist = 0; | ||
String passQuery = String.format("SELECT * FROM customer_data WHERE meter_no = '%s' AND status = 'active';", meterNo); | ||
Class.forName("com.mysql.jdbc.Driver"); | ||
connect = DriverManager.getConnection("jdbc:mysql://localhost:3306/gas_agency?user=mohit&password=Mohit@2K"); | ||
statement = connect.createStatement(); | ||
resultSet = statement.executeQuery(passQuery); | ||
while(resultSet.next()) { | ||
checkExist++; | ||
} | ||
resultSet.close(); | ||
statement.close(); | ||
connect.close(); | ||
if(checkExist == 0) | ||
return 0; | ||
Class.forName("com.mysql.jdbc.Driver"); | ||
connect = DriverManager.getConnection("jdbc:mysql://localhost:3306/gas_agency?user=mohit&password=Mohit@2K"); | ||
|
||
String q = String.format("UPDATE customer_data SET status = 'unregistered' WHERE meter_no = '%s';", meterNo); | ||
preparedStatement = connect.prepareStatement(q); | ||
preparedStatement.executeUpdate(); | ||
preparedStatement.close(); | ||
connect.close(); | ||
return 1; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package gasAgencyManagement; | ||
|
||
import java.sql.Connection; | ||
import java.sql.DriverManager; | ||
import java.sql.ResultSet; | ||
import java.sql.SQLException; | ||
import java.sql.Statement; | ||
|
||
public class BillCalculator { | ||
private Connection connect = null; | ||
private Statement statement = null; | ||
private ResultSet resultSet = null; | ||
private static float slab1,slab2,slab3,gst; | ||
|
||
public void setRates() throws SQLException, Exception { | ||
Class.forName("com.mysql.jdbc.Driver"); | ||
connect = DriverManager.getConnection("jdbc:mysql://localhost:3306/gas_agency?user=mohit&password=Mohit@2K"); | ||
statement = connect.createStatement(); | ||
resultSet = statement.executeQuery("SELECT * FROM rate_data;"); | ||
while(resultSet.next()) { | ||
slab1 = resultSet.getFloat("slab1"); | ||
slab2 = resultSet.getFloat("slab2"); | ||
slab3 = resultSet.getFloat("slab3"); | ||
gst = resultSet.getFloat("gst"); | ||
System.out.println(slab1 +" "+ slab2 +" "+ slab3 +" "+ gst ); | ||
|
||
} | ||
resultSet.close(); | ||
statement.close(); | ||
connect.close(); | ||
} | ||
public float billCal(String readingStr1,String readingStr2) throws SQLException, Exception { | ||
float totalAmt = 0; | ||
float floatReading1 = Float.parseFloat(readingStr1); | ||
float floatReading2 = Float.parseFloat(readingStr2); | ||
if(floatReading2<=floatReading1) { | ||
return 0; | ||
} | ||
float floatReading = floatReading2-floatReading1; | ||
float dailyConsumption = floatReading/61; | ||
BillCalculator obj = new BillCalculator(); | ||
obj.setRates(); | ||
System.out.println(slab1 +" "+ slab2 +" "+ slab3 +" "+ gst ); | ||
if(dailyConsumption<=0.6) { | ||
totalAmt = (float) (dailyConsumption*61*slab1); | ||
} | ||
else if(dailyConsumption>=0.61 && dailyConsumption<=1.5) { | ||
totalAmt = (float) (0.6*61*slab1); | ||
totalAmt += (1.5-dailyConsumption)*61*slab2; | ||
} | ||
else if(dailyConsumption>=1.51) { | ||
totalAmt = (float) (0.6*61*slab1); | ||
totalAmt += 0.9*61*slab2; | ||
totalAmt += (float)(dailyConsumption-1.5)*61*slab3; | ||
} | ||
totalAmt = totalAmt + totalAmt*gst/100; | ||
System.out.println("Bill Amount : " + totalAmt); | ||
return totalAmt; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package gasAgencyManagement; | ||
|
||
public class DateConvertor { | ||
|
||
public static void main(String args[]) { | ||
|
||
// contains both date and time information | ||
java.util.Date utilDate = new java.util.Date(); | ||
System.out.println("Util date in Java : " + utilDate); | ||
|
||
// contains only date information without time | ||
java.sql.Date sqlDate = new java.sql.Date(utilDate.getTime()); | ||
System.out.println("SQL date in Java : " + sqlDate); | ||
|
||
|
||
|
||
} | ||
|
||
} | ||
|
||
|
Oops, something went wrong.