Compare commits
13 Commits
deab83024d
...
testing
Author | SHA1 | Date | |
---|---|---|---|
8650177d86 | |||
2a59156b0b | |||
786586c382 | |||
1c640de416 | |||
5f1b0d9ae1 | |||
105c168157 | |||
606b879fb9 | |||
748f08abfd | |||
a24023ac66 | |||
a79a90a678 | |||
830f1576a6 | |||
e130401126 | |||
281c51fe22 |
Binary file not shown.
@ -75,9 +75,42 @@ class DBController
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// table Position section
|
||||
|
||||
public String getCategoryNameFromPositionen(int pID)
|
||||
{
|
||||
// System.out.println("getCategoryName: " + pID);
|
||||
|
||||
int catInPos = 0;
|
||||
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
ResultSet rs = stmt.executeQuery("SELECT posid, cat FROM positionen "
|
||||
+ "WHERE posid = " + pID + ";");
|
||||
catInPos = rs.getInt("cat");
|
||||
} catch (SQLException e) {
|
||||
System.err.println("Couldn't handle DB-Query");
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
|
||||
if (catInPos == 6) {
|
||||
return "Standard";
|
||||
}
|
||||
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
ResultSet rs = stmt.executeQuery("SELECT catid, catname FROM category "
|
||||
+ "WHERE catid = " + catInPos + ";");
|
||||
return rs.getString("catname");
|
||||
} catch (SQLException e) {
|
||||
System.err.println("Couldn't handle DB-Query");
|
||||
e.printStackTrace();
|
||||
return "keine Kategorie";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// table Position section //
|
||||
public void createTablePositionen()
|
||||
{ // create table position
|
||||
System.out.println("Erstelle Tabelle Positionen");
|
||||
@ -85,7 +118,7 @@ class DBController
|
||||
Statement stmt = connection.createStatement();
|
||||
stmt.executeUpdate("DROP TABLE IF EXISTS positionen;");
|
||||
stmt.executeUpdate(
|
||||
"CREATE TABLE positionen (id, name, value, color);");
|
||||
"CREATE TABLE positionen (posid, name, value, cat, color);");
|
||||
} catch (SQLException e) {
|
||||
System.err.println("Couldn't handle DB-Query");
|
||||
e.printStackTrace();
|
||||
@ -93,21 +126,23 @@ class DBController
|
||||
|
||||
// create 25 demo/default data entries
|
||||
for (int i = 0; i < 25; i++) {
|
||||
fillPositionen(i + 1, "Noch frei", (float) 0.00, "#ad0000");
|
||||
fillPositionen_Positionen(i + 1, "Noch frei", (float) 0.00, 6,
|
||||
"#ad0000");
|
||||
}
|
||||
}
|
||||
|
||||
public void fillPositionen(int pID, String pName, float pValue,
|
||||
String pColor)
|
||||
public void fillPositionen_Positionen(int pID, String pName, float pValue,
|
||||
int pCat, String pColor)
|
||||
{ // create new data in table
|
||||
System.out.println("Erstelle neuen positionen eintrag");
|
||||
try {
|
||||
PreparedStatement ps = connection
|
||||
.prepareStatement("INSERT INTO positionen VALUES (?, ?, ?, ?);");
|
||||
PreparedStatement ps = connection.prepareStatement(
|
||||
"INSERT INTO positionen VALUES (?, ?, ?, ?, ?);");
|
||||
ps.setInt(1, pID); // primary
|
||||
ps.setString(2, pName);
|
||||
ps.setFloat(3, pValue);
|
||||
ps.setString(4, pColor);
|
||||
ps.setInt(4, pCat);
|
||||
ps.setString(5, pColor);
|
||||
|
||||
ps.addBatch();
|
||||
connection.setAutoCommit(false);
|
||||
@ -119,12 +154,12 @@ class DBController
|
||||
}
|
||||
}
|
||||
|
||||
public String getName(int pID)
|
||||
public String getName_Positionen(int pID)
|
||||
{ // Gibt das Datum zurück
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(
|
||||
"SELECT id, name FROM positionen WHERE id = " + pID + ";");
|
||||
"SELECT posid, name FROM positionen WHERE posid = " + pID + ";");
|
||||
return rs.getString("name");
|
||||
} catch (SQLException e) {
|
||||
System.err.println("Couldn't handle DB-Query");
|
||||
@ -133,12 +168,13 @@ class DBController
|
||||
}
|
||||
}
|
||||
|
||||
public String getValue(int pID)
|
||||
public String getValue_Positionen(int pID)
|
||||
{ // Gibt das Konto zurück
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(
|
||||
"SELECT id, value FROM positionen WHERE id = " + pID + ";");
|
||||
"SELECT posid, value FROM positionen WHERE posid = " + pID
|
||||
+ ";");
|
||||
return rs.getString("value");
|
||||
} catch (SQLException e) {
|
||||
System.err.println("Couldn't handle DB-Query");
|
||||
@ -147,12 +183,28 @@ class DBController
|
||||
}
|
||||
}
|
||||
|
||||
public String getColor(int pID)
|
||||
public int getCat_Positionen(int pID)
|
||||
{ // Gibt den Nutzernamen zurück
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(
|
||||
"SELECT id, color FROM positionen WHERE id = " + pID + ";");
|
||||
"SELECT catid, cat FROM positionen WHERE catid = " + pID + ";");
|
||||
System.out.println("getCarTet: " + rs.getInt("cat"));
|
||||
return rs.getInt("cat");
|
||||
} catch (SQLException e) {
|
||||
System.err.println("Couldn't handle DB-Query");
|
||||
e.printStackTrace();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public String getColor_Positionen(int pID)
|
||||
{ // Gibt den Nutzernamen zurück
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(
|
||||
"SELECT posid, color FROM positionen WHERE posid = " + pID
|
||||
+ ";");
|
||||
return rs.getString("color");
|
||||
} catch (SQLException e) {
|
||||
System.err.println("Couldn't handle DB-Query");
|
||||
@ -161,36 +213,48 @@ class DBController
|
||||
}
|
||||
}
|
||||
|
||||
public void setName(int pID, String pName)
|
||||
public void setName_Positionen(int pID, String pName)
|
||||
{ // Setzt das Datum
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
stmt.executeUpdate("UPDATE positionen SET name = '" + pName
|
||||
+ "'WHERE id =" + pID + ";");
|
||||
+ "'WHERE posid =" + pID + ";");
|
||||
} catch (SQLException e) {
|
||||
System.err.println("Couldn't handle DB-Query");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void setValue(int pID, String pValue)
|
||||
public void setValue_Positionen(int pID, String pValue)
|
||||
{ // Setzt das Konto
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
stmt.executeUpdate("UPDATE positionen SET value = '" + pValue
|
||||
+ "'WHERE id =" + pID + ";");
|
||||
+ "'WHERE posid =" + pID + ";");
|
||||
} catch (SQLException e) {
|
||||
System.err.println("Couldn't handle DB-Query");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void setColor(int pID, String pColor)
|
||||
public void setCat_Positionen(int pID, int pCat)
|
||||
{ // Setzt den Nutzername
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
stmt.executeUpdate("UPDATE positionen SET cat = '" + pCat
|
||||
+ "'WHERE posid =" + pID + ";");
|
||||
} catch (SQLException e) {
|
||||
System.err.println("Couldn't handle DB-Query");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void setColor_Positionen(int pID, String pColor)
|
||||
{ // Setzt den Nutzername
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
stmt.executeUpdate("UPDATE positionen SET color = '" + pColor
|
||||
+ "'WHERE id =" + pID + ";");
|
||||
+ "'WHERE posid =" + pID + ";");
|
||||
} catch (SQLException e) {
|
||||
System.err.println("Couldn't handle DB-Query");
|
||||
e.printStackTrace();
|
||||
@ -206,9 +270,9 @@ class DBController
|
||||
while (rs.next()) {
|
||||
try {
|
||||
// Entschlüsselte Daten werden als Datenobjekt gespeichert
|
||||
daten.add(new tableDataPositionen(rs.getInt("id"),
|
||||
daten.add(new tableDataPositionen(rs.getInt("posid"),
|
||||
rs.getString("name"), rs.getString("value"),
|
||||
rs.getString("color")));
|
||||
rs.getString("cat"), rs.getString("color")));
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
@ -220,7 +284,7 @@ class DBController
|
||||
}
|
||||
return daten;
|
||||
}
|
||||
|
||||
|
||||
public void ausgebenSysoPositionen()
|
||||
{ // Debugging Ausgabe der kompletten Tabelle
|
||||
System.out.println("Print positionen");
|
||||
@ -228,7 +292,7 @@ class DBController
|
||||
Statement stmt = connection.createStatement();
|
||||
ResultSet rs = stmt.executeQuery("SELECT * FROM positionen;");
|
||||
while (rs.next()) {
|
||||
System.out.println("id = " + rs.getString("id"));
|
||||
System.out.println("posid = " + rs.getString("posid"));
|
||||
System.out.println("name = " + rs.getString("name"));
|
||||
System.out.println("vale = " + rs.getString("value"));
|
||||
System.out.println("color = " + rs.getString("color"));
|
||||
@ -241,8 +305,75 @@ class DBController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// table Jobs section
|
||||
// table Category section //
|
||||
public void createTableCategory()
|
||||
{ // create table position
|
||||
System.out.println("Erstelle Tabelle Kategorie");
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
stmt.executeUpdate("DROP TABLE IF EXISTS category;");
|
||||
stmt.executeUpdate("CREATE TABLE category (catid, catname);");
|
||||
} catch (SQLException e) {
|
||||
System.err.println("Couldn't handle DB-Query");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
fillCategory_Category(1, "Essen");
|
||||
fillCategory_Category(2, "alkoholische Getränke");
|
||||
fillCategory_Category(3, "alkoholfreie Getränke");
|
||||
fillCategory_Category(4, "Kuchen");
|
||||
fillCategory_Category(5, "Standard");
|
||||
|
||||
}
|
||||
|
||||
public void setName_Category(int pID, String pName)
|
||||
{ // Setzte den Namen
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
stmt.executeUpdate("UPDATE category SET catname = '" + pName
|
||||
+ "'WHERE catid =" + pID + ";");
|
||||
} catch (SQLException e) {
|
||||
System.err.println("Couldn't handle DB-Query");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void fillCategory_Category(int pID, String pName)
|
||||
{
|
||||
|
||||
System.out.println("Erstelle neuen Kategorie Eintrag");
|
||||
try {
|
||||
PreparedStatement ps = connection
|
||||
.prepareStatement("INSERT INTO category VALUES (?, ?);");
|
||||
ps.setInt(1, pID); // primary
|
||||
ps.setString(2, pName);
|
||||
ps.addBatch();
|
||||
connection.setAutoCommit(false);
|
||||
ps.executeBatch(); // SQL execution
|
||||
connection.setAutoCommit(true);
|
||||
} catch (SQLException e) {
|
||||
System.err.println("Couldn't handle DB-Query");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public String getName_Category(int pID)
|
||||
{ // Gibt das Datum zurück
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(
|
||||
"SELECT catid, catname FROM category WHERE catid = " + pID
|
||||
+ ";");
|
||||
return rs.getString("catname");
|
||||
} catch (SQLException e) {
|
||||
System.err.println("Couldn't handle DB-Query");
|
||||
e.printStackTrace();
|
||||
return "Error 404";
|
||||
}
|
||||
}
|
||||
|
||||
// table Jobs section //
|
||||
public void erstelleTabelleJobs()
|
||||
{ // Erstelle Tabelle mit Reihen
|
||||
System.out.println("Erstelle Tabelle Jobs");
|
||||
@ -250,14 +381,217 @@ class DBController
|
||||
Statement stmt = connection.createStatement();
|
||||
stmt.executeUpdate("DROP TABLE IF EXISTS jobs;");
|
||||
stmt.executeUpdate(
|
||||
"CREATE TABLE jobs (id, time, positionen, state, value);");
|
||||
"CREATE TABLE jobs (jobid, time, positionen_quantity, positionen_name, positionen_value, positionen_cat, state, jobvalue);");
|
||||
} catch (SQLException e) {
|
||||
System.err.println("Couldn't handle DB-Query");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public int getLatestJobNumber_Job()
|
||||
{
|
||||
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(
|
||||
"SELECT jobid from jobs ORDER BY jobid DESC LIMIT 1;");
|
||||
return rs.getInt("jobid");
|
||||
} catch (SQLException e) {
|
||||
// System.err.println("Couldn't handle DB-Query");
|
||||
// e.printStackTrace();
|
||||
|
||||
}
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
public String getTime_Job(int pID)
|
||||
{ // Gibt den Nutzernamen zurück
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(
|
||||
"SELECT jobid, time FROM jobs WHERE jobid = " + pID + ";");
|
||||
return rs.getString("time");
|
||||
} catch (SQLException e) {
|
||||
System.err.println("Couldn't handle DB-Query");
|
||||
e.printStackTrace();
|
||||
return "404";
|
||||
}
|
||||
}
|
||||
|
||||
public String getQuantity_Job(int pID)
|
||||
{ // Gibt den Nutzernamen zurück
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(
|
||||
"SELECT jobid, positionen_quantity FROM jobs WHERE jobid = "
|
||||
+ pID + ";");
|
||||
return rs.getString("positionen_quantity");
|
||||
} catch (SQLException e) {
|
||||
System.err.println("Couldn't handle DB-Query");
|
||||
e.printStackTrace();
|
||||
return "404";
|
||||
}
|
||||
}
|
||||
|
||||
public String getName_Job(int pID)
|
||||
{ // Gibt den Nutzernamen zurück
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(
|
||||
"SELECT jobid, positionen_name FROM jobs WHERE jobid = " + pID
|
||||
+ ";");
|
||||
return rs.getString("positionen_name");
|
||||
} catch (SQLException e) {
|
||||
System.err.println("Couldn't handle DB-Query");
|
||||
e.printStackTrace();
|
||||
return "404";
|
||||
}
|
||||
}
|
||||
|
||||
public String getValue_Job(int pID)
|
||||
{ // Gibt den Nutzernamen zurück
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(
|
||||
"SELECT jobid, positionen_value FROM jobs WHERE jobid = " + pID
|
||||
+ ";");
|
||||
return rs.getString("positionen_value");
|
||||
} catch (SQLException e) {
|
||||
System.err.println("Couldn't handle DB-Query");
|
||||
e.printStackTrace();
|
||||
return "404";
|
||||
}
|
||||
}
|
||||
|
||||
public String getCategory_Job(int pID)
|
||||
{ // Gibt den Nutzernamen zurück
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(
|
||||
"SELECT jobid, positionen_cat FROM jobs WHERE jobid = " + pID
|
||||
+ ";");
|
||||
return rs.getString("positionen_cat");
|
||||
} catch (SQLException e) {
|
||||
System.err.println("Couldn't handle DB-Query");
|
||||
e.printStackTrace();
|
||||
return "404";
|
||||
}
|
||||
}
|
||||
|
||||
public String getState_Job(int pID)
|
||||
{ // Gibt den Nutzernamen zurück
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(
|
||||
"SELECT jobid, state FROM jobs WHERE jobid = " + pID + ";");
|
||||
return rs.getString("state");
|
||||
} catch (SQLException e) {
|
||||
System.err.println("Couldn't handle DB-Query");
|
||||
e.printStackTrace();
|
||||
return "404";
|
||||
}
|
||||
}
|
||||
|
||||
public String getJobValue_Job(int pID)
|
||||
{ // Gibt den Nutzernamen zurück
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(
|
||||
"SELECT jobid, jobvalue FROM jobs WHERE jobid = " + pID + ";");
|
||||
return rs.getString("jobvalue");
|
||||
} catch (SQLException e) {
|
||||
System.err.println("Couldn't handle DB-Query");
|
||||
e.printStackTrace();
|
||||
return "404";
|
||||
}
|
||||
}
|
||||
|
||||
public String getAllJobValue_Job()
|
||||
{ // Gibt den Nutzernamen zurück
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(
|
||||
"SELECT state, jobvalue, SUM(jobvalue) AS ALLVALUE FROM jobs WHERE state = "
|
||||
+ '"' + "verbucht" + '"' + ";");
|
||||
return rs.getString("ALLVALUE");
|
||||
} catch (SQLException e) {
|
||||
System.err.println("Couldn't handle DB-Query");
|
||||
e.printStackTrace();
|
||||
return "0";
|
||||
}
|
||||
}
|
||||
|
||||
public void setStatus_Jobs(int pID, String pStatus)
|
||||
{ // Setzt das Konto
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
stmt.executeUpdate("UPDATE jobs SET state = '" + pStatus
|
||||
+ "'WHERE jobid =" + pID + ";");
|
||||
} catch (SQLException e) {
|
||||
System.err.println("Couldn't handle DB-Query");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public ArrayList<tableDataJob> loadTableJobs_Job()
|
||||
{ // Gibt den Nutzernamen zurück
|
||||
|
||||
ArrayList<tableDataJob> tmp = new ArrayList<tableDataJob>();
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(
|
||||
"SELECT jobid, time, positionen_quantity, positionen_name, positionen_value, positionen_cat, state, jobvalue FROM jobs;");
|
||||
while (rs.next()) {
|
||||
try {
|
||||
|
||||
// return rs.getString("jobvalue");
|
||||
|
||||
String tablePosition = rs.getString("positionen_name");
|
||||
|
||||
tableDataJob data = new tableDataJob(rs.getInt("jobid"),
|
||||
rs.getString("time"), tablePosition, rs.getString("state"),
|
||||
rs.getString("jobvalue"));
|
||||
|
||||
tmp.add(data);
|
||||
} catch (SQLException e) {
|
||||
System.err.println("Couldn't handle DB-Query");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
System.err.println("Couldn't handle DB-Query");
|
||||
e.printStackTrace();
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
|
||||
public void fillJobs_Jobs(int pID, String pTime, String pPositionen_quantity,
|
||||
String pPositionen_name, String pPositionen_value,
|
||||
String pPositionen_cat, String pState, String pJobvalue)
|
||||
{
|
||||
|
||||
System.out.println("Create new Job Entry");
|
||||
try {
|
||||
PreparedStatement ps = connection.prepareStatement(
|
||||
"INSERT INTO jobs VALUES (?, ?, ?, ?, ?, ?, ?, ?);");
|
||||
ps.setInt(1, pID); // primary
|
||||
ps.setString(2, pTime);
|
||||
ps.setString(3, pPositionen_quantity);
|
||||
ps.setString(4, pPositionen_name);
|
||||
ps.setString(5, pPositionen_value);
|
||||
ps.setString(6, pPositionen_cat);
|
||||
ps.setString(7, pState);
|
||||
ps.setString(8, pJobvalue);
|
||||
ps.addBatch();
|
||||
connection.setAutoCommit(false);
|
||||
ps.executeBatch(); // SQL execution
|
||||
connection.setAutoCommit(true);
|
||||
} catch (SQLException e) {
|
||||
System.err.println("Couldn't handle DB-Query");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
208
src/application/Job.java
Normal file
208
src/application/Job.java
Normal file
@ -0,0 +1,208 @@
|
||||
package application;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Job
|
||||
{
|
||||
|
||||
private int jobnumber;
|
||||
|
||||
private float jobvalue;
|
||||
|
||||
private String jobtime;
|
||||
|
||||
private ArrayList<Integer> positionenQuantity;
|
||||
|
||||
private ArrayList<String> positionenName;
|
||||
|
||||
private ArrayList<Float> positionenValue;
|
||||
|
||||
private ArrayList<String> positionenCat;
|
||||
|
||||
public Job(int pJobnumber, String pTime)
|
||||
{
|
||||
this.jobnumber = pJobnumber;
|
||||
this.jobtime = pTime;
|
||||
|
||||
positionenQuantity = new ArrayList<Integer>();
|
||||
positionenName = new ArrayList<String>();
|
||||
positionenValue = new ArrayList<Float>();
|
||||
positionenCat = new ArrayList<String>();
|
||||
|
||||
// System.out.println("Größe: " + positionenName.size());
|
||||
|
||||
}
|
||||
|
||||
public int getJobnumber()
|
||||
{
|
||||
return this.jobnumber;
|
||||
}
|
||||
|
||||
public String getJobtime()
|
||||
{
|
||||
return this.jobtime;
|
||||
}
|
||||
|
||||
public float getJobValue()
|
||||
{
|
||||
|
||||
calcJobValue();
|
||||
|
||||
return this.jobvalue;
|
||||
}
|
||||
|
||||
public void addPosition(String pPositionenName, float pPositionenValue,
|
||||
String pPositionenCat)
|
||||
{
|
||||
// System.out.println("addName");
|
||||
|
||||
for (int i = 0; i < positionenName.size(); i++) {
|
||||
if (positionenName.get(i).equals(pPositionenName)) {
|
||||
// Item is already in list, increase quantity
|
||||
positionenQuantity.set(i, positionenQuantity.get(i) + 1);
|
||||
// System.out.println("Item exists, increasing quantity");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
positionenName.add(pPositionenName);
|
||||
positionenValue.add(pPositionenValue);
|
||||
positionenCat.add(pPositionenCat);
|
||||
positionenQuantity.add(1);
|
||||
|
||||
calcJobValue();
|
||||
}
|
||||
|
||||
public void printJobOnConsole()
|
||||
{
|
||||
|
||||
System.out.println("---------------------------------------------");
|
||||
System.out.println("JobNummer: " + jobnumber);
|
||||
System.out.println("---------------------------------------------");
|
||||
|
||||
// System.out.println("Größe: " + positionenName.size());
|
||||
|
||||
for (int i = 0; i < positionenName.size(); i++) {
|
||||
|
||||
System.out.println(
|
||||
positionenQuantity.get(i) + " " + positionenName.get(i) + " "
|
||||
+ positionenValue.get(i) + " " + positionenCat.get(i));
|
||||
/*
|
||||
* System.out.println("i is: " + i);
|
||||
* System.out.println(positionenName.get(i));
|
||||
* System.out.println(positionenQuantity.get(i));
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
System.out.println("---------------------------------------------");
|
||||
|
||||
}
|
||||
|
||||
public ArrayList<tableDataCurrentOrder> getCurrentJobPositionen()
|
||||
{
|
||||
|
||||
ArrayList<tableDataCurrentOrder> jobitems = new ArrayList<tableDataCurrentOrder>();
|
||||
|
||||
for (int i = 0; i < positionenName.size(); i++) {
|
||||
|
||||
tableDataCurrentOrder tmp = new tableDataCurrentOrder(
|
||||
positionenName.get(i), positionenQuantity.get(i));
|
||||
|
||||
jobitems.add(tmp);
|
||||
|
||||
}
|
||||
|
||||
return jobitems;
|
||||
}
|
||||
|
||||
private void calcJobValue()
|
||||
{
|
||||
|
||||
jobvalue = 0;
|
||||
|
||||
for (int i = 0; i < positionenValue.size(); i++) {
|
||||
|
||||
jobvalue = jobvalue
|
||||
+ (positionenQuantity.get(i) * positionenValue.get(i));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public String createPosQuantityDBString()
|
||||
{
|
||||
String tmp = String.valueOf(positionenQuantity.get(0));
|
||||
for (int i = 1; i < positionenName.size(); i++) {
|
||||
|
||||
tmp = tmp + ";" + positionenQuantity.get(i);
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
|
||||
public String createPosNameDBString()
|
||||
{
|
||||
String tmp = positionenName.get(0);
|
||||
for (int i = 1; i < positionenName.size(); i++) {
|
||||
|
||||
tmp = tmp + ";" + positionenName.get(i);
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
|
||||
public String createPosValueDBString()
|
||||
{
|
||||
String tmp = String.valueOf(positionenValue.get(0));
|
||||
for (int i = 1; i < positionenName.size(); i++) {
|
||||
|
||||
tmp = tmp + ";" + positionenValue.get(i);
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
|
||||
public String createPosCatDBString()
|
||||
{
|
||||
String tmp = positionenCat.get(0);
|
||||
for (int i = 1; i < positionenName.size(); i++) {
|
||||
|
||||
tmp = tmp + ";" + positionenCat.get(i);
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
|
||||
public void deletePosName(String pPosName)
|
||||
{
|
||||
|
||||
for (int i = 0; i < positionenName.size(); i++) {
|
||||
|
||||
if (positionenName.get(i).equals(pPosName)) {
|
||||
|
||||
if (positionenQuantity.get(i) > 1) {
|
||||
positionenQuantity.set(i, positionenQuantity.get(i) - 1);
|
||||
} else {
|
||||
|
||||
positionenQuantity.remove(i);
|
||||
positionenName.remove(i);
|
||||
positionenValue.remove(i);
|
||||
positionenCat.remove(i);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public boolean existsPosName(String pPosName)
|
||||
{
|
||||
for (int i = 0; i < positionenName.size(); i++) {
|
||||
if (positionenName.get(i).equals(pPosName)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
@ -33,7 +33,7 @@ public class Main extends Application
|
||||
FXMLLoader loader = new FXMLLoader(
|
||||
getClass().getResource("MainWindow.fxml"));
|
||||
AnchorPane pane = loader.load();
|
||||
primaryStage.setTitle("jFxKasse - dev"); // Title of window
|
||||
primaryStage.setTitle("jFxKasse"); // Title of window
|
||||
|
||||
mwc = loader.getController();
|
||||
mwc.setMain(this, dbc);
|
||||
@ -76,11 +76,16 @@ public class Main extends Application
|
||||
dbc.dbname = mwc.getDatabaseName(); // handover database name
|
||||
dbc.connectDatabase(); // estabishing DB conection
|
||||
mwc.fillTablePositionen(); // fill TreeTable 'Positionen'
|
||||
mwc.fillCategory();
|
||||
mwc.fillTableJobs();
|
||||
mwc.loadGridButtons();
|
||||
mwc.getSelectedCat(); //Load DB entries in Chois Box
|
||||
mwc.createNewJob();
|
||||
} else {
|
||||
// config.xml NOT found, first start of app
|
||||
System.out.println("keine XML gefunden!");
|
||||
mwc.blockUI(true); // disable UI elements that need DB
|
||||
mwc.blockUnlock();
|
||||
File dir = new File(System.getProperty("user.home") + "/bin/jFxKasse");
|
||||
dir.mkdir(); // Create new Subfolder
|
||||
}
|
||||
|
@ -25,104 +25,163 @@
|
||||
<content>
|
||||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
|
||||
<children>
|
||||
<Button fx:id="ueberbtn" layoutX="664.0" layoutY="325.0" mnemonicParsing="false" onAction="#ueberbtnAction" text="Über" />
|
||||
<TitledPane alignment="CENTER" animated="false" collapsible="false" contentDisplay="CENTER" layoutX="790.0" layoutY="10.0" prefHeight="163.0" prefWidth="566.0" text="Datenbank">
|
||||
<content>
|
||||
<AnchorPane fx:id="paneDB" minHeight="0.0" minWidth="0.0" prefHeight="135.0" prefWidth="547.0">
|
||||
<children>
|
||||
<Label fx:id="labelDBName" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="329.0" layoutY="10.0" prefHeight="34.0" prefWidth="229.0" text="Datenbankname:">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<JFXTextField fx:id="tftNewDBName" alignment="CENTER" layoutX="25.0" layoutY="10.0" prefHeight="25.0" prefWidth="376.0" />
|
||||
<Label fx:id="labelDBStatus" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="7.0" layoutY="50.0" prefHeight="34.0" prefWidth="551.0" text="Keine Datenbank gefunden!">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Button fx:id="btnCreateNewDatabase" layoutX="297.0" layoutY="90.0" mnemonicParsing="false" onAction="#btnCreateNewDatabaseAction" text="Neue Datenbank anlegen">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="13.0" />
|
||||
</font>
|
||||
</Button>
|
||||
<Button fx:id="btnOpenFolder" layoutX="39.0" layoutY="90.0" mnemonicParsing="false" onAction="#btnOpenFolderAction" text="Speicherort öffnen">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="13.0" />
|
||||
</font>
|
||||
</Button>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</content>
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="13.0" />
|
||||
</font>
|
||||
</TitledPane>
|
||||
<Button fx:id="ueberbtn" layoutX="84.0" layoutY="79.0" mnemonicParsing="false" onAction="#ueberbtnAction" prefHeight="0.0" prefWidth="46.0" text="Über" />
|
||||
<TitledPane alignment="CENTER" animated="false" collapsible="false" contentDisplay="CENTER" layoutX="790.0" layoutY="10.0" prefHeight="270.0" prefWidth="566.0" text="Datenbank Einstellungen">
|
||||
<content>
|
||||
<AnchorPane fx:id="paneDB" minHeight="0.0" minWidth="0.0" prefHeight="238.0" prefWidth="564.0">
|
||||
<children>
|
||||
<Label fx:id="labelDBName" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="329.0" layoutY="10.0" prefHeight="34.0" prefWidth="229.0" text="Datenbankname:">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<JFXTextField fx:id="tftNewDBName" alignment="CENTER" layoutX="25.0" layoutY="10.0" prefHeight="25.0" prefWidth="376.0" />
|
||||
<Label fx:id="labelDBStatus" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="1.0" layoutY="75.0" prefHeight="34.0" prefWidth="551.0" text="Keine Datenbank gefunden!">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Button fx:id="btnCreateNewDatabase" layoutX="317.0" layoutY="126.0" mnemonicParsing="false" onAction="#btnCreateNewDatabaseAction" text="Neue Datenbank anlegen">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="13.0" />
|
||||
</font>
|
||||
</Button>
|
||||
<Button fx:id="btnOpenFolder" layoutX="99.0" layoutY="126.0" mnemonicParsing="false" onAction="#btnOpenFolderAction" text="Speicherort öffnen">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="13.0" />
|
||||
</font>
|
||||
</Button>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</content>
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="13.0" />
|
||||
</font>
|
||||
</TitledPane>
|
||||
<TitledPane fx:id="titlePaneCat" alignment="CENTER" animated="false" collapsible="false" contentDisplay="CENTER" layoutX="170.0" layoutY="10.0" prefHeight="270.0" prefWidth="566.0" text="Kategorien (z.B. Getränke, Essen oder Kuchen)" textAlignment="CENTER">
|
||||
<content>
|
||||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="260.0" prefWidth="564.0">
|
||||
<children>
|
||||
<Label fx:id="labelCat01" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="434.0" layoutY="10.0" prefHeight="34.0" prefWidth="124.0" text="Kategorie 1:">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Label fx:id="labelCat02" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="442.0" layoutY="50.0" prefHeight="34.0" prefWidth="116.0" text="Kategorie 2:">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Label fx:id="labelCat05" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="448.0" layoutY="170.0" prefHeight="34.0" prefWidth="110.0" text="Kategorie 5:">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Label fx:id="labelCat04" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="454.0" layoutY="130.0" prefHeight="34.0" prefWidth="104.0" text="Kategorie 4:">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Label fx:id="labelCat03" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="451.0" layoutY="90.0" prefHeight="34.0" prefWidth="107.0" text="Kategorie 3:">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<JFXTextField fx:id="tftKat01" alignment="CENTER" layoutX="50.0" layoutY="5.0" prefHeight="25.0" prefWidth="376.0" />
|
||||
<JFXTextField fx:id="tftKat02" alignment="CENTER" layoutX="50.0" layoutY="45.0" prefHeight="25.0" prefWidth="376.0" />
|
||||
<JFXTextField fx:id="tftKat03" alignment="CENTER" layoutX="50.0" layoutY="85.0" prefHeight="25.0" prefWidth="376.0" />
|
||||
<JFXTextField fx:id="tftKat04" alignment="CENTER" layoutX="50.0" layoutY="125.0" prefHeight="25.0" prefWidth="376.0" />
|
||||
<JFXTextField fx:id="tftKat05" alignment="CENTER" layoutX="50.0" layoutY="165.0" prefHeight="25.0" prefWidth="376.0" />
|
||||
<Button fx:id="btnSaveCat" layoutX="200.0" layoutY="204.0" mnemonicParsing="false" onAction="#btnSaveCatAction" text="Kategorien speichern">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="13.0" />
|
||||
</font>
|
||||
</Button>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</content>
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="13.0" />
|
||||
</font>
|
||||
</TitledPane>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</content>
|
||||
</Tab>
|
||||
<Tab text="Positionen bearbeiten">
|
||||
<Tab fx:id="tapPosEdit" text="Positionen bearbeiten">
|
||||
<content>
|
||||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
|
||||
<children>
|
||||
<TreeTableView fx:id="entryTreeTable" layoutX="11.0" layoutY="10.0" prefHeight="502.0" prefWidth="1346.0">
|
||||
<columns>
|
||||
<TreeTableColumn fx:id="columnColor" editable="false" maxWidth="200.0" minWidth="200.0" prefWidth="200.0" resizable="false" sortable="false" text="Farbe" />
|
||||
<TreeTableColumn fx:id="columnPrize" editable="false" maxWidth="200.0" minWidth="200.0" prefWidth="200.0" resizable="false" sortable="false" text="Preis" />
|
||||
<TreeTableColumn fx:id="columnPositionsEdit" editable="false" maxWidth="800.0" minWidth="800.0" prefWidth="800.0" resizable="false" sortable="false" text="Positionen" />
|
||||
<TreeTableColumn fx:id="columnPosnumber" editable="false" maxWidth="120.0" minWidth="120.0" prefWidth="120.0" resizable="false" sortable="false" text="Nummer" />
|
||||
</columns>
|
||||
<columnResizePolicy>
|
||||
<TreeTableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
|
||||
</columnResizePolicy>
|
||||
</TreeTableView>
|
||||
<Button fx:id="btnSaveEntry" layoutX="494.0" layoutY="631.0" mnemonicParsing="false" onAction="#btnSaveEntryAction" text="Ausgewählten Eintrag speichern">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="17.0" />
|
||||
</font>
|
||||
</Button>
|
||||
<Button fx:id="btnClearEntry" layoutX="462.0" layoutY="525.0" mnemonicParsing="false" onAction="#btnClearEntryAction" text="Ausgewählten Eintrag zurücksetzten">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="17.0" />
|
||||
</font>
|
||||
</Button>
|
||||
<TitledPane alignment="CENTER" animated="false" collapsible="false" contentDisplay="CENTER" layoutX="792.0" layoutY="525.0" prefHeight="163.0" prefWidth="565.0" text="Eintrag editieren">
|
||||
<content>
|
||||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
|
||||
<children>
|
||||
<Label fx:id="lableNewPosition" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="455.0" layoutY="10.0" prefHeight="34.0" prefWidth="105.0" text="Position:">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<JFXTextField fx:id="tftNewPosition" alignment="CENTER" layoutX="160.0" layoutY="10.0" prefHeight="25.0" prefWidth="279.0">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="13.0" />
|
||||
</font></JFXTextField>
|
||||
<Label fx:id="labelNewValue" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="442.0" layoutY="50.0" prefHeight="34.0" prefWidth="118.0" text="Preis in Euro:">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<JFXTextField fx:id="tftNewValue" alignment="CENTER" layoutX="380.0" layoutY="50.0" prefHeight="25.0" prefWidth="58.0">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="13.0" />
|
||||
</font></JFXTextField>
|
||||
<Label fx:id="lableNewColor" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="455.0" layoutY="90.0" prefHeight="34.0" prefWidth="105.0" text="Farbe:">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<ChoiceBox fx:id="colorChoise" layoutX="292.0" layoutY="95.0" prefWidth="150.0" />
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</content>
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="13.0" />
|
||||
</font>
|
||||
</TitledPane>
|
||||
</children></AnchorPane>
|
||||
<children>
|
||||
<TreeTableView fx:id="entryTreeTable" layoutX="11.0" layoutY="10.0" prefHeight="502.0" prefWidth="1346.0">
|
||||
<placeholder>
|
||||
<Label text="" />
|
||||
</placeholder>
|
||||
<columns>
|
||||
<TreeTableColumn fx:id="columnColor" editable="false" maxWidth="428.0" minWidth="119.333251953125" prefWidth="119.333251953125" resizable="false" sortable="false" text="Farbe" />
|
||||
<TreeTableColumn fx:id="columnCat" editable="false" maxWidth="800.0" minWidth="94.0" prefWidth="300.0" resizable="false" sortable="false" text="Kategorie" />
|
||||
<TreeTableColumn fx:id="columnPrize" editable="false" maxWidth="693.3333129882812" minWidth="44.33331298828125" prefWidth="140.33331298828125" resizable="false" sortable="false" text="Preis" />
|
||||
<TreeTableColumn fx:id="columnPositionsEdit" editable="false" maxWidth="1581.6666870117188" minWidth="38.0" prefWidth="596.333251953125" resizable="false" sortable="false" text="Positionen" />
|
||||
<TreeTableColumn fx:id="columnPosnumber" editable="false" maxWidth="1218.0" minWidth="59.0" prefWidth="181.6666259765625" resizable="false" sortable="false" text="Nummer" />
|
||||
</columns>
|
||||
<columnResizePolicy>
|
||||
<TreeTableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
|
||||
</columnResizePolicy>
|
||||
</TreeTableView>
|
||||
<Button fx:id="btnSaveEntry" layoutX="494.0" layoutY="631.0" mnemonicParsing="false" onAction="#btnSaveEntryAction" text="Ausgewählten Eintrag speichern">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="17.0" />
|
||||
</font>
|
||||
</Button>
|
||||
<Button fx:id="btnClearEntry" layoutX="462.0" layoutY="525.0" mnemonicParsing="false" onAction="#btnClearEntryAction" text="Ausgewählten Eintrag zurücksetzten">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="17.0" />
|
||||
</font>
|
||||
</Button>
|
||||
<TitledPane fx:id="titledPaneEntry" alignment="CENTER" animated="false" collapsible="false" contentDisplay="CENTER" layoutX="792.0" layoutY="525.0" prefHeight="163.0" prefWidth="565.0" text="Eintrag editieren">
|
||||
<content>
|
||||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
|
||||
<children>
|
||||
<Label fx:id="labelNewPosition" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="455.0" layoutY="10.0" prefHeight="34.0" prefWidth="105.0" text="Position:">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<JFXTextField fx:id="tftNewPosition" alignment="CENTER" layoutX="160.0" layoutY="10.0" prefHeight="25.0" prefWidth="279.0">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="13.0" />
|
||||
</font>
|
||||
</JFXTextField>
|
||||
<Label fx:id="labelNewValue" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="442.0" layoutY="50.0" prefHeight="34.0" prefWidth="118.0" text="Preis in Euro:">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<JFXTextField fx:id="tftNewValue" alignment="CENTER" labelFloat="true" layoutX="380.0" layoutY="50.0" prefHeight="25.0" prefWidth="58.0">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="13.0" />
|
||||
</font>
|
||||
</JFXTextField>
|
||||
<Label fx:id="labelNewColor" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="455.0" layoutY="90.0" prefHeight="34.0" prefWidth="105.0" text="Farbe:">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<ChoiceBox fx:id="colorChoise" layoutX="346.0" layoutY="90.0" prefHeight="25.0" prefWidth="96.0" />
|
||||
<Label fx:id="labelSelectCat" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="204.0" layoutY="90.0" prefHeight="34.0" prefWidth="105.0" text="Kategorie:">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<ChoiceBox fx:id="catChoise" layoutX="25.0" layoutY="90.0" prefHeight="25.0" prefWidth="180.0" />
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</content>
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="13.0" />
|
||||
</font>
|
||||
</TitledPane>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</content>
|
||||
</Tab>
|
||||
<Tab text="Aufträge">
|
||||
@ -130,12 +189,15 @@
|
||||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="850.0" prefWidth="1536.0">
|
||||
<children>
|
||||
<TreeTableView fx:id="jobsTreeTable" layoutX="11.0" layoutY="10.0" prefHeight="541.0" prefWidth="1346.0">
|
||||
<placeholder>
|
||||
<Label text="" />
|
||||
</placeholder>
|
||||
<columns>
|
||||
<TreeTableColumn fx:id="columnJobValue" editable="false" prefWidth="90.6666259765625" resizable="false" text="Betrag" />
|
||||
<TreeTableColumn fx:id="columnState" editable="false" prefWidth="91.0" resizable="false" text="Zustand" />
|
||||
<TreeTableColumn fx:id="columnPositions" editable="false" prefWidth="981.333251953125" resizable="false" sortable="false" text="Positionen" />
|
||||
<TreeTableColumn fx:id="columnTime" editable="false" prefWidth="99.666748046875" resizable="false" text="Zeit" />
|
||||
<TreeTableColumn fx:id="columnJobNumber" editable="false" maxWidth="3000.0" prefWidth="83.6666259765625" resizable="false" text="Nummer" />
|
||||
<TreeTableColumn fx:id="columnJobValue" editable="false" prefWidth="111.0" resizable="false" text="Betrag" />
|
||||
<TreeTableColumn fx:id="columnState" editable="false" prefWidth="101.0" resizable="false" text="Zustand" />
|
||||
<TreeTableColumn fx:id="columnPositions" editable="false" prefWidth="861.0" resizable="false" sortable="false" text="Positionen" />
|
||||
<TreeTableColumn fx:id="columnTime" editable="false" prefWidth="159.0" resizable="false" text="Zeit" />
|
||||
<TreeTableColumn fx:id="columnJobNumber" editable="false" maxWidth="3000.0" prefWidth="110.666748046875" resizable="false" text="Nummer" />
|
||||
</columns>
|
||||
</TreeTableView>
|
||||
<Button fx:id="btnReprintJob" layoutX="378.0" layoutY="603.0" mnemonicParsing="false" onAction="#btnReprintJobAction" text="Ausgewählter Auftrag drucken">
|
||||
@ -143,21 +205,21 @@
|
||||
<Font name="Cantarell Regular" size="17.0" />
|
||||
</font>
|
||||
</Button>
|
||||
<TitledPane fx:id="titlePaneStats" alignment="CENTER" collapsible="false" contentDisplay="CENTER" layoutX="992.0" layoutY="561.0" prefHeight="118.0" prefWidth="365.0" text="Statistik - 30.03.2018 15:15 Uhr">
|
||||
<TitledPane fx:id="titlePaneStats" alignment="CENTER" collapsible="false" contentDisplay="CENTER" layoutX="957.0" layoutY="561.0" prefHeight="118.0" prefWidth="400.0" text="Statistik - 30.03.2018 15:15 Uhr">
|
||||
<content>
|
||||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="59.0" prefWidth="483.0">
|
||||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="92.0" prefWidth="414.0">
|
||||
<children>
|
||||
<Label fx:id="lableJobCount" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="17.0" layoutY="2.0" prefHeight="34.0" prefWidth="340.0" text="Anzahl Aufträge: 2781">
|
||||
<Label fx:id="labelJobCount" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="41.0" layoutY="2.0" prefHeight="34.0" prefWidth="340.0" text="Anzahl Aufträge: 2781">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Label fx:id="labelAvgJob" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="17.0" layoutY="30.0" prefHeight="34.0" prefWidth="340.0" text="Durchschnittlicher Auftragswert: 12,90€">
|
||||
<Label fx:id="labelAvgJob" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="41.0" layoutY="30.0" prefHeight="34.0" prefWidth="340.0" text="Durchschnittlicher Auftragswert: 12,90€">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Label fx:id="lableAllValue" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="17.0" layoutY="60.0" prefHeight="34.0" prefWidth="340.0" text="Gesamt: 1088,48€">
|
||||
<Label fx:id="labelAllValue" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="41.0" layoutY="60.0" prefHeight="34.0" prefWidth="340.0" text="Gesamt: 1088,48€">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font>
|
||||
@ -185,10 +247,16 @@
|
||||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="850.0" prefWidth="1536.0">
|
||||
<children>
|
||||
<TreeTableView fx:id="tableCurrentOrder" layoutX="15.0" layoutY="85.0" prefHeight="379.0" prefWidth="382.0">
|
||||
<placeholder>
|
||||
<Label text="" />
|
||||
</placeholder>
|
||||
<columns>
|
||||
<TreeTableColumn fx:id="columnPosition" editable="false" prefWidth="304.3333740234375" resizable="false" sortable="false" text="Position" />
|
||||
<TreeTableColumn fx:id="columnQuantity" editable="false" prefWidth="80.6666259765625" resizable="false" sortable="false" text="Anzahl" />
|
||||
<TreeTableColumn fx:id="columnPosition" editable="false" prefWidth="320.0" resizable="false" sortable="false" text="Position" />
|
||||
<TreeTableColumn fx:id="columnQuantity" editable="false" prefWidth="60.0" resizable="false" sortable="false" text="Anzahl" />
|
||||
</columns>
|
||||
<columnResizePolicy>
|
||||
<TreeTableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
|
||||
</columnResizePolicy>
|
||||
</TreeTableView>
|
||||
<GridPane gridLinesVisible="true" layoutX="430.0" layoutY="15.0" prefHeight="670.0" prefWidth="920.0">
|
||||
<columnConstraints>
|
||||
@ -333,7 +401,7 @@
|
||||
</JFXButton>
|
||||
</children>
|
||||
</GridPane>
|
||||
<Button fx:id="btnPrintBill" contentDisplay="CENTER" defaultButton="true" graphicTextGap="1.0" layoutX="75.0" layoutY="599.0" maxHeight="88.0" minHeight="75.0" mnemonicParsing="false" onAction="#btnPrintBillAction" prefHeight="88.0" prefWidth="258.0" text="Drucken" wrapText="true">
|
||||
<Button fx:id="btnPrintBill" contentDisplay="CENTER" defaultButton="true" graphicTextGap="1.0" layoutX="75.0" layoutY="599.0" maxHeight="88.0" minHeight="75.0" mnemonicParsing="false" onAction="#btnPrintBillAction" prefHeight="88.0" prefWidth="258.0" text="Drucken" textAlignment="CENTER" wrapText="true">
|
||||
<font>
|
||||
<Font name="Cantarell Bold" size="48.0" />
|
||||
</font>
|
||||
@ -343,9 +411,9 @@
|
||||
<Font name="Cantarell Regular" size="20.0" />
|
||||
</font>
|
||||
</Button>
|
||||
<Label fx:id="labelAllPrize" alignment="CENTER" contentDisplay="CENTER" layoutX="10.0" layoutY="505.0" prefHeight="15.0" prefWidth="386.0" text="0,00 €" textAlignment="CENTER">
|
||||
<Label fx:id="labelAllPrize" alignment="CENTER" contentDisplay="CENTER" layoutX="10.0" layoutY="511.0" prefHeight="15.0" prefWidth="386.0" text="0,00 €" textAlignment="CENTER">
|
||||
<font>
|
||||
<Font name="Open Sans" size="70.0" />
|
||||
<Font name="Cantarell Regular" size="70.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Label fx:id="labelJobCounter" alignment="TOP_RIGHT" contentDisplay="CENTER" layoutX="5.0" layoutY="45.0" prefHeight="34.0" prefWidth="392.0" text="Auftragsnummer: 0" textAlignment="CENTER">
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,68 +0,0 @@
|
||||
package application;
|
||||
|
||||
import javafx.beans.property.IntegerProperty;
|
||||
import javafx.beans.property.SimpleIntegerProperty;
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
import javafx.beans.property.StringProperty;
|
||||
|
||||
public class tableData
|
||||
{ // Datenobjekt mit der ID, Datum und Konto
|
||||
|
||||
private final IntegerProperty id = new SimpleIntegerProperty();
|
||||
|
||||
private final StringProperty datum = new SimpleStringProperty();
|
||||
|
||||
private final StringProperty konto = new SimpleStringProperty();
|
||||
|
||||
public tableData(final int id, final String datum, final String konto)
|
||||
{
|
||||
this.id.set(id);
|
||||
this.datum.set(datum);
|
||||
this.konto.set(konto);
|
||||
}
|
||||
|
||||
public IntegerProperty idProperty()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public StringProperty datumProperty()
|
||||
{
|
||||
return datum;
|
||||
}
|
||||
|
||||
public StringProperty kontoProperty()
|
||||
{
|
||||
return konto;
|
||||
}
|
||||
|
||||
public int getID()
|
||||
{
|
||||
return idProperty().get();
|
||||
}
|
||||
|
||||
public String getDatum()
|
||||
{
|
||||
return datumProperty().get();
|
||||
}
|
||||
|
||||
public String getKonto()
|
||||
{
|
||||
return kontoProperty().get();
|
||||
}
|
||||
|
||||
public final void setID(int id)
|
||||
{
|
||||
idProperty().set(id);
|
||||
}
|
||||
|
||||
public final void setdatum(String datum)
|
||||
{
|
||||
datumProperty().set(datum);
|
||||
}
|
||||
|
||||
public final void setkonto(String konto)
|
||||
{
|
||||
kontoProperty().set(konto);
|
||||
}
|
||||
}
|
51
src/application/tableDataCurrentOrder.java
Normal file
51
src/application/tableDataCurrentOrder.java
Normal file
@ -0,0 +1,51 @@
|
||||
package application;
|
||||
|
||||
import javafx.beans.property.IntegerProperty;
|
||||
import javafx.beans.property.SimpleIntegerProperty;
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
import javafx.beans.property.StringProperty;
|
||||
|
||||
public class tableDataCurrentOrder
|
||||
{
|
||||
|
||||
private final StringProperty position = new SimpleStringProperty();
|
||||
|
||||
private final IntegerProperty quantity = new SimpleIntegerProperty();
|
||||
|
||||
public tableDataCurrentOrder(final String pPosition, final Integer pQuantity)
|
||||
{
|
||||
this.position.set(pPosition);
|
||||
this.quantity.set(pQuantity);
|
||||
|
||||
}
|
||||
|
||||
public StringProperty positionProperty()
|
||||
{
|
||||
return position;
|
||||
}
|
||||
|
||||
public IntegerProperty quantityProperty()
|
||||
{
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public String getPosition()
|
||||
{
|
||||
return positionProperty().get();
|
||||
}
|
||||
|
||||
public Integer getQuantity()
|
||||
{
|
||||
return quantityProperty().get();
|
||||
}
|
||||
|
||||
public final void setPosition(String pPosition)
|
||||
{
|
||||
positionProperty().set(pPosition);
|
||||
}
|
||||
|
||||
public final void setQuantity(int pQuantity)
|
||||
{
|
||||
quantityProperty().set(pQuantity);
|
||||
}
|
||||
}
|
107
src/application/tableDataJob.java
Normal file
107
src/application/tableDataJob.java
Normal file
@ -0,0 +1,107 @@
|
||||
package application;
|
||||
|
||||
import javafx.beans.property.IntegerProperty;
|
||||
import javafx.beans.property.SimpleIntegerProperty;
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
import javafx.beans.property.StringProperty;
|
||||
|
||||
public class tableDataJob
|
||||
{
|
||||
|
||||
private final IntegerProperty number = new SimpleIntegerProperty();
|
||||
|
||||
private final StringProperty time = new SimpleStringProperty();
|
||||
|
||||
private final StringProperty positionen = new SimpleStringProperty();
|
||||
|
||||
private final StringProperty status = new SimpleStringProperty();
|
||||
|
||||
private final StringProperty value = new SimpleStringProperty();
|
||||
|
||||
public tableDataJob(final Integer pNumber, final String pTime,
|
||||
final String pPositionen, final String pStatus, final String pValue)
|
||||
{
|
||||
this.number.set(pNumber);
|
||||
this.time.set(pTime);
|
||||
this.positionen.set(pPositionen);
|
||||
this.status.set(pStatus);
|
||||
this.value.set(pValue);
|
||||
|
||||
}
|
||||
|
||||
public IntegerProperty numberProperty()
|
||||
{
|
||||
return number;
|
||||
}
|
||||
|
||||
public StringProperty timeProperty()
|
||||
{
|
||||
return time;
|
||||
}
|
||||
|
||||
public StringProperty positionProperty()
|
||||
{
|
||||
return positionen;
|
||||
}
|
||||
|
||||
public StringProperty statusProperty()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public StringProperty valueProperty()
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
public Integer getNumber()
|
||||
{
|
||||
return numberProperty().get();
|
||||
}
|
||||
|
||||
public String getTime()
|
||||
{
|
||||
return timeProperty().get();
|
||||
}
|
||||
|
||||
public String getPosition()
|
||||
{
|
||||
return positionProperty().get();
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return statusProperty().get();
|
||||
}
|
||||
|
||||
public String getValue()
|
||||
{
|
||||
return valueProperty().get();
|
||||
}
|
||||
|
||||
public final void setNumber(int pNumber)
|
||||
{
|
||||
numberProperty().set(pNumber);
|
||||
}
|
||||
|
||||
public final void setTime(String pTime)
|
||||
{
|
||||
timeProperty().set(pTime);
|
||||
}
|
||||
|
||||
public final void setPosition(String pPosition)
|
||||
{
|
||||
positionProperty().set(pPosition);
|
||||
}
|
||||
|
||||
public final void setStatus(String pStatus)
|
||||
{
|
||||
statusProperty().set(pStatus);
|
||||
}
|
||||
|
||||
public final void setValue(String pValue)
|
||||
{
|
||||
valueProperty().set(pValue);
|
||||
}
|
||||
|
||||
}
|
@ -14,13 +14,16 @@ public class tableDataPositionen
|
||||
|
||||
private final StringProperty value = new SimpleStringProperty();
|
||||
|
||||
private final StringProperty cat = new SimpleStringProperty();
|
||||
|
||||
private final StringProperty color = new SimpleStringProperty();
|
||||
|
||||
public tableDataPositionen(final int id, final String name, final String value, final String color)
|
||||
public tableDataPositionen(final int id, final String name, final String value, final String cat, final String color)
|
||||
{
|
||||
this.id.set(id);
|
||||
this.name.set(name);
|
||||
this.value.set(value);
|
||||
this.cat.set(cat);
|
||||
this.color.set(color);
|
||||
}
|
||||
|
||||
@ -39,6 +42,10 @@ public class tableDataPositionen
|
||||
return value;
|
||||
}
|
||||
|
||||
public StringProperty catProperty() {
|
||||
return cat;
|
||||
}
|
||||
|
||||
public StringProperty colorProperty()
|
||||
{
|
||||
return color;
|
||||
@ -59,6 +66,10 @@ public class tableDataPositionen
|
||||
return valueProperty().get();
|
||||
}
|
||||
|
||||
public String getCat() {
|
||||
return catProperty().get();
|
||||
}
|
||||
|
||||
public String getColor()
|
||||
{
|
||||
return colorProperty().get();
|
||||
@ -79,6 +90,10 @@ public class tableDataPositionen
|
||||
valueProperty().set(value);
|
||||
}
|
||||
|
||||
public final void setCat(String cat) {
|
||||
catProperty().set(cat);
|
||||
}
|
||||
|
||||
public final void setColor(String color)
|
||||
{
|
||||
colorProperty().set(color);
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 577 B |
Reference in New Issue
Block a user