⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sentencecontainer.java

📁 是一个专门设计用于触摸屏的POS(point of sales)应用软件
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
                // Y borramos el ticket definitivamente                new StaticSentence(s                    , "DELETE FROM PAYMENTS WHERE TICKETID = ?"                    , SerializerWriteInteger.INSTANCE).exec(new Integer(ticket.getId()));                new StaticSentence(s                    , "DELETE FROM PRODUCTSOUT WHERE TICKETID = ?"                    , SerializerWriteInteger.INSTANCE).exec(new Integer(ticket.getId()));                new StaticSentence(s                    , "DELETE FROM TICKETS WHERE TICKETID = ?"                    , SerializerWriteInteger.INSTANCE).exec(new Integer(ticket.getId()));                  return null;            }        };        t.execute();    }        public abstract Integer getNextTicketIndex() throws BasicException;    public abstract Integer getNextReservation() throws BasicException;        public abstract Integer getNextStockDiary() throws BasicException ;        public abstract Integer getNextPayment() throws BasicException;         public abstract SentenceList getProductCatQBF();              public final SentenceExec getProductCatInsert() {        return new SentenceExecTransaction(s) {            public int execInTransaction(Object params) throws BasicException {                Object[] values = (Object[]) params;                            int i = new PreparedSentence(s                    , "INSERT INTO PRODUCTS (REFERENCE, CODE, NAME, ISCOM, ISSCALE, PRICEBUY, PRICESELL, CATEGORY, TAX, IMAGE, STOCKCOST, STOCKVOLUME) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"                    , new SerializerWriteBasicExt(productcatDatas, new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11})).exec(params);                if (i > 0 && ((Boolean)values[12]).booleanValue()) {                    return new PreparedSentence(s                        , "INSERT INTO PRODUCTS_CAT (REFERENCE, CATORDER) VALUES (?, ?)"                        , new SerializerWriteBasicExt(productcatDatas, new int[] {0, 13})).exec(params);                } else {                    return i;                }            }        };    }        public final SentenceExec getProductCatUpdate() {        return new SentenceExecTransaction(s) {            public int execInTransaction(Object params) throws BasicException {                Object[] values = (Object[]) params;                            int i = new PreparedSentence(s                    , "UPDATE PRODUCTS SET REFERENCE = ?, CODE = ?, NAME = ?, ISCOM = ?, ISSCALE = ?, PRICEBUY = ?, PRICESELL = ?, CATEGORY = ?, TAX = ?, IMAGE = ?, STOCKCOST = ?, STOCKVOLUME = ? WHERE REFERENCE = ?"                    , new SerializerWriteBasicExt(productcatDatas, new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0})).exec(params);                if (i > 0) {                    if (((Boolean)values[12]).booleanValue()) {                        if (new PreparedSentence(s                                , "UPDATE PRODUCTS_CAT SET CATORDER = ? WHERE REFERENCE = ?"                                , new SerializerWriteBasicExt(productcatDatas, new int[] {13, 0})).exec(params) == 0) {                            new PreparedSentence(s                                , "INSERT INTO PRODUCTS_CAT (REFERENCE, CATORDER) VALUES (?, ?)"                                , new SerializerWriteBasicExt(productcatDatas, new int[] {0, 13})).exec(params);                        }                    } else {                        new PreparedSentence(s                            , "DELETE FROM PRODUCTS_CAT WHERE REFERENCE = ?"                            , new SerializerWriteBasicExt(productcatDatas, new int[] {0})).exec(params);                    }                }                return i;            }                };    }       public final SentenceExec getProductCatDelete() {        return new SentenceExecTransaction(s) {            public int execInTransaction(Object params) throws BasicException {                new PreparedSentence(s                    , "DELETE FROM PRODUCTS_CAT WHERE REFERENCE = ?"                    , new SerializerWriteBasicExt(productcatDatas, new int[] {0})).exec(params);                return new PreparedSentence(s                    , "DELETE FROM PRODUCTS WHERE REFERENCE = ?"                    , new SerializerWriteBasicExt(productcatDatas, new int[] {0})).exec(params);            }         };    }        public final SentenceExec getStockDiaryInsert() {        return new SentenceExecTransaction(s) {            public int execInTransaction(Object params) throws BasicException {                if (new PreparedSentence(s                        , "UPDATE STOCKCURRENT SET UNITS = (UNITS + ?) WHERE LOCATION = ? AND PRODUCT = ?"                        , new SerializerWriteBasicExt(stockdiaryDatas, new int[] {5, 3, 4})).exec(params) == 0) {                    new PreparedSentence(s                        , "INSERT INTO STOCKCURRENT (LOCATION, PRODUCT, UNITS) VALUES (?, ?, ?)"                        , new SerializerWriteBasicExt(stockdiaryDatas, new int[] {3, 4, 5})).exec(params);                }                return new PreparedSentence(s                    , "INSERT INTO STOCKDIARY (ID, DATENEW, REASON, LOCATION, PRODUCT, UNITS, PRICE) VALUES (?, ?, ?, ?, ?, ?, ?)"                    , new SerializerWriteBasicExt(stockdiaryDatas, new int[] {0, 1, 2, 3, 4, 5, 6})).exec(params);            }        };    }        public final SentenceExec getStockDiaryDelete() {        return new SentenceExecTransaction(s) {            public int execInTransaction(Object params) throws BasicException {                if (new PreparedSentence(s                        , "UPDATE STOCKCURRENT SET UNITS = (UNITS - ?) WHERE LOCATION = ? AND PRODUCT = ?"                        , new SerializerWriteBasicExt(stockdiaryDatas, new int[] {5, 3, 4})).exec(params) == 0) {                    new PreparedSentence(s                        , "INSERT INTO STOCKCURRENT (LOCATION, PRODUCT, UNITS) VALUES (?, ?, -(?))"                        , new SerializerWriteBasicExt(stockdiaryDatas, new int[] {3, 4, 5})).exec(params);                }                return new PreparedSentence(s                    , "DELETE FROM STOCKDIARY WHERE ID = ?"                    , new SerializerWriteBasicExt(stockdiaryDatas, new int[] {0})).exec(params);            }        };    }        public final SentenceExec getPaymentMovementInsert() {        return new SentenceExecTransaction(s) {            public int execInTransaction(Object params) throws BasicException {                new PreparedSentence(s                    , "INSERT INTO TICKETS (TICKETID, DATENEW, MONEY, PERSON) VALUES (?, ?, ?, ?)"                    , new SerializerWriteBasicExt(paymenttabledatas, new int[] {0, 1, 2, 3})).exec(params);                return new PreparedSentence(s                    , "INSERT INTO PAYMENTS (ID, TICKETID, PAYMENT, TOTAL) VALUES (?, ?, ?, ?)"                    , new SerializerWriteBasicExt(paymenttabledatas, new int[] {4, 0, 5, 6})).exec(params);            }        };    }        public final SentenceExec getPaymentMovementDelete() {        return new SentenceExecTransaction(s) {            public int execInTransaction(Object params) throws BasicException {                new PreparedSentence(s                    , "DELETE FROM PAYMENTS WHERE ID = ?"                    , new SerializerWriteBasicExt(paymenttabledatas, new int[] {4})).exec(params);                return new PreparedSentence(s                    , "DELETE FROM TICKETS WHERE TICKETID = ?"                    , new SerializerWriteBasicExt(paymenttabledatas, new int[] {0})).exec(params);            }        };    }        public final SentenceList getProductStock() {        return new PreparedSentence (s                , "SELECT L.ID, L.NAME, ?, COALESCE(S.UNITS, 0.0), S.STOCKSECURITY, S.STOCKMAXIMUM " +                "FROM LOCATIONS L LEFT OUTER JOIN (" +                "SELECT PRODUCT, LOCATION, STOCKSECURITY, STOCKMAXIMUM, UNITS FROM STOCKCURRENT WHERE PRODUCT = ?) S " +                "ON L.ID = S.LOCATION"                , new SerializerWriteBasicExt(productcatDatas, new int[]{0, 0})                , new SerializerReadBasic(stockdatas));    }             public final SentenceExec getStockUpdate() {        return new SentenceExecTransaction(s) {            public int execInTransaction(Object params) throws BasicException {                if (new PreparedSentence(s                        , "UPDATE STOCKCURRENT SET STOCKSECURITY = ?, STOCKMAXIMUM = ? WHERE LOCATION = ? AND PRODUCT = ?"                        , new SerializerWriteBasicExt(stockdatas, new int[] {4, 5, 0, 2})).exec(params) == 0) {                    return new PreparedSentence(s                        , "INSERT INTO STOCKCURRENT(LOCATION, PRODUCT, UNITS, STOCKSECURITY, STOCKMAXIMUM) VALUES (?, ?, 0.0, ?, ?)"                        , new SerializerWriteBasicExt(stockdatas, new int[] {0, 2, 4, 5})).exec(params);                } else {                    return 1;                }                 }        };    }        public final SentenceExec getCatalogCategoryAdd() {        return new StaticSentence(s                , "INSERT INTO PRODUCTS_CAT(REFERENCE, CATORDER) SELECT REFERENCE, NULL FROM PRODUCTS WHERE CATEGORY=?"                , SerializerWriteInteger.INSTANCE);    }    public final SentenceExec getCatalogCategoryDel() {        return new StaticSentence(s                , "DELETE FROM PRODUCTS_CAT WHERE REFERENCE = ANY (SELECT REFERENCE FROM PRODUCTS WHERE CATEGORY=?)"                , SerializerWriteInteger.INSTANCE);    }           public final TableDefinition getTableCategories() {        return new TableDefinition(s,            "CATEGORIES"            , new int[] {0}            , new String[] {"ID", "NAME", "IMAGE"}            , new Datas[] {Datas.INT, Datas.STRING, Datas.IMAGE}            , new Formats[] {Formats.INT, Formats.STRING}            , new Formats[] {Formats.INT, Formats.STRING}            , new int[] {0, 1}        );    }         public final TableDefinition getTableTaxes() {        return new TableDefinition(s,            "TAXES"            , new int[] {0}            , new String[] {"ID", "NAME", "RATE"}            , new Datas[] {Datas.INT, Datas.STRING, Datas.DOUBLE}            , new Formats[] {Formats.INT, Formats.STRING, Formats.PERCENT}            , new Formats[] {Formats.INT, Formats.STRING}            , new int[] {0, 1, 2}        );    }           public final TableDefinition getTableLocations() {        return new TableDefinition(s,            "LOCATIONS"            , new int[] {0}            , new String[] {"ID", "NAME", "ADDRESS"}            , new Datas[] {Datas.INT, Datas.STRING, Datas.STRING}            , new Formats[] {Formats.INT, Formats.STRING, Formats.STRING}            , new Formats[] {Formats.INT, Formats.STRING}            , new int[] {0, 1, 2}        );    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -