Package com.openbravo.data.loader

Examples of com.openbravo.data.loader.DataParams


                // Try to update
                if (new PreparedSentence(s,
                            "UPDATE CUSTOMERS SET ADDRESS = ?, ADDRESS2 = ?, POSTAL = ?, CITY = ?, REGION = ?, COUNTRY = ?, FIRSTNAME = ?, LASTNAME = ?, EMAIL = ?, PHONE = ?, PHONE2 = ?, NOTES = ?, MAXDEBT = ?, NAME = ? WHERE TAXID = ?",
                            SerializerWriteParams.INSTANCE
                            ).exec(new DataParams() { public void writeValues() throws BasicException {
                                setString(1, customer.getAddress());
                                setString(2, customer.getAddress2());
                                setString(3, customer.getPostal());
                                setString(4, customer.getCity());
                                setString(5, customer.getRegion());
                                setString(6, customer.getCountry());
                                setString(7, customer.getFirstname());
                                setString(8, customer.getLastname());
                                setString(9, customer.getEmail());
                                setString(10, customer.getPhone());
                                setString(11, customer.getPhone2());
                                setString(12, customer.getNotes());
                                setDouble(13, customer.getMaxdebt());
                                setString(14, customer.getName());
                                setString(15, customer.getTaxid());
                            }}) == 0) {

                     if (TicketInfo.getPayID()==2) {
                                           //ZAV CURDEBT 0,0001
                       new PreparedSentence(s,
                            "INSERT INTO CUSTOMERS(ID, SEARCHKEY, NAME, ADDRESS, ADDRESS2, POSTAL, CITY, REGION, COUNTRY, FIRSTNAME, LASTNAME, EMAIL, PHONE, PHONE2, NOTES, TAXID, MAXDEBT, VISIBLE, CURDEBT) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + s.DB.TRUE() + ",-0.0001)",
                            SerializerWriteParams.INSTANCE
                            ).exec(new DataParams() { public void writeValues() throws BasicException {
                                setString(1, customer.getId());
                                setString(2, customer.getSearchkey());
                                setString(3, customer.getName());
                                setString(4, customer.getAddress());
                                setString(5, customer.getAddress2());
                                setString(6, customer.getPostal());
                                setString(7, customer.getCity());
                                setString(8, customer.getRegion());
                                setString(9, customer.getCountry());
                                setString(10, customer.getFirstname());
                                setString(11, customer.getLastname());
                                setString(12, customer.getEmail());
                                setString(13, customer.getPhone());
                                setString(14, customer.getPhone2());
                                setString(15, customer.getNotes());
                                setString(16, customer.getTaxid());
                                setDouble(17, customer.getMaxdebt());
                            }});
                } else {
                   
                    // If not updated, try to insert
                    new PreparedSentence(s,
                            "INSERT INTO CUSTOMERS(ID, SEARCHKEY, NAME, ADDRESS, ADDRESS2, POSTAL, CITY, REGION, COUNTRY, FIRSTNAME, LASTNAME, EMAIL, PHONE, PHONE2, NOTES, TAXID, MAXDEBT, VISIBLE) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + s.DB.TRUE() + ")",
                            SerializerWriteParams.INSTANCE
                            ).exec(new DataParams() { public void writeValues() throws BasicException {
                                setString(1, customer.getId());
                                setString(2, customer.getSearchkey());
                                setString(3, customer.getName());
                                setString(4, customer.getAddress());
                                setString(5, customer.getAddress2());
View Full Code Here


               
                // Try to update               
                if (new PreparedSentence(s,
                            "UPDATE TAXCATEGORIES SET NAME = ?  WHERE ID = ?",
                            SerializerWriteParams.INSTANCE
                            ).exec(new DataParams() { public void writeValues() throws BasicException {
                                setString(1, taxcat.getName());
                                setString(2, taxcat.getID());                                   
                            }}) == 0) {
                      
                    // If not updated, try to insert
                    new PreparedSentence(s,
                            "INSERT INTO TAXCATEGORIES(ID, NAME) VALUES (?, ?)",
                            SerializerWriteParams.INSTANCE
                            ).exec(new DataParams() { public void writeValues() throws BasicException {
                                setString(1, taxcat.getID());
                                setString(2, taxcat.getName());
                            }});
                }
               
View Full Code Here

               
                // Try to update               
                if (new PreparedSentence(s,
                            "UPDATE TAXES SET NAME = ?, CATEGORY = ?, CUSTCATEGORY = ?, PARENTID = ?, RATE = ?, RATECASCADE = ? WHERE ID = ?",
                            SerializerWriteParams.INSTANCE
                            ).exec(new DataParams() { public void writeValues() throws BasicException {
                                setString(1, tax.getName());
                                setString(2, tax.getTaxCategoryID());
                                setString(3, tax.getTaxCustCategoryID());
                                setString(4, tax.getParentID());
                                setDouble(5, tax.getRate());
                                setBoolean(6, tax.isCascade());
                                setString(7, tax.getId());      
                            }}) == 0) {
                      
                    // If not updated, try to insert
                    new PreparedSentence(s,
                            "INSERT INTO TAXES(ID, NAME, CATEGORY, CUSTCATEGORY, PARENTID, RATE, RATECASCADE) VALUES (?, ?, ?, ?, ?, ?, ?)",
                            SerializerWriteParams.INSTANCE
                            ).exec(new DataParams() { public void writeValues() throws BasicException {
                                setString(1, tax.getId());
                                setString(2, tax.getName());
                                setString(3, tax.getTaxCategoryID());
                                setString(4, tax.getTaxCustCategoryID());
                                setString(5, tax.getParentID());                               
View Full Code Here

               
                // Try to update
                if (new PreparedSentence(s,
                            "UPDATE CATEGORIES SET NAME = ? WHERE NAME = ?",
                            SerializerWriteParams.INSTANCE
                            ).exec(new DataParams() { public void writeValues() throws BasicException {
                                setString(1, cat.getName());
                                setString(2, cat.getName());                                
                            }}) == 0) {
                      
                    // If not updated, try to insert
                    new PreparedSentence(s,
                        "INSERT INTO CATEGORIES(ID, NAME, IMAGE) VALUES (?, ?, ?)",
                        SerializerWriteParams.INSTANCE
                        ).exec(new DataParams() { public void writeValues() throws BasicException {
                            setString(1, cat.getID());
                            setString(2, cat.getName());
                            setBytes(3, ImageUtils.writeImage(cat.getImage()));
                        }});
                }
View Full Code Here

                // Sync the Product in a transaction
                // Try to update
                if (new PreparedSentence(s,
                            "UPDATE PRODUCTS SET REFERENCE = ?, NAME = ?, ISSCALE = ?, PRICEBUY = ?, PRICESELL = ?, CATEGORY = ?, TAXCAT = ?, IMAGE = ?, ATTRIBUTESET_ID = ? WHERE CODE = ?",
                            SerializerWriteParams.INSTANCE
                            ).exec(new DataParams() { public void writeValues() throws BasicException {
                                setString(1, prod.getReference());
                                setString(2, prod.getName());
                                // setBoolean(x, p.isCom());
                                setBoolean(3, prod.isScale());
                                setDouble(4, prod.getPriceBuy());
                                setDouble(5, prod.getPriceSell());
                                setString(6, prod.getCategoryID());
                                setString(7, prod.getTaxCategoryID());
                                setBytes(8, ImageUtils.writeImage(prod.getImage()));
                                // setDouble(x, 0.0);
                                // setDouble(x, 0.0);
                                setString(9, prod.getAttributeSetID());
                                setString(10, prod.getCode());  
                            }}) == 0) {
                           
                    // If not updated, try to insert
                    new PreparedSentence(s,
                            "INSERT INTO PRODUCTS (ID, REFERENCE, CODE, NAME, ISCOM, ISSCALE, PRICEBUY, PRICESELL, CATEGORY, TAXCAT, IMAGE, STOCKCOST, STOCKVOLUME, ATTRIBUTESET_ID) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
                            SerializerWriteParams.INSTANCE
                            ).exec(new DataParams() { public void writeValues() throws BasicException {
                                setString(1, prod.getID());
                                setString(2, prod.getReference());
                                setString(3, prod.getCode());
                                setString(4, prod.getName());
                                setBoolean(5, prod.isCom());
View Full Code Here

  public void execUpdateTicket(final String ticketid, final String orderID ) throws BasicException {
   
    new PreparedSentence(s, "UPDATE  TICKETS SET STATUS = ? WHERE STATUS = 0 AND TICKETID = ?",
                SerializerWriteParams.INSTANCE
                ).exec(new DataParams() {
                  public void writeValues() throws BasicException {
                    setString(1, orderID);
                    setString(2, ticketid);

                  }});
View Full Code Here

                final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                final String dateReturn = sdf.format(date);

    new PreparedSentence(s, "UPDATE  TICKETS SET DATERETURN = ? WHERE STATUS = ? AND TICKETTYPE = ? ",
                SerializerWriteParams.INSTANCE
                ).exec(new DataParams() {
                  public void writeValues() throws BasicException {
                    setString(1, dateReturn);
                    setString(2, orderID);
                    setString(3, tickettype);
View Full Code Here

    public int updateCustomerExt(final CustomerInfoExt customer) throws BasicException {
    
        return new PreparedSentence(s
                , "UPDATE CUSTOMERS SET NOTES = ? WHERE ID = ?"
                , SerializerWriteParams.INSTANCE     
                ).exec(new DataParams() { public void writeValues() throws BasicException {
                        setString(1, customer.getNotes());
                        setString(2, customer.getId());
                }});       
    }
View Full Code Here

                // Try to update
                if (new PreparedSentence(s,
                            "UPDATE CUSTOMERS SET ADDRESS = ?, ADDRESS2 = ?, POSTAL = ?, CITY = ?, REGION = ?, COUNTRY = ?, FIRSTNAME = ?, LASTNAME = ?, EMAIL = ?, PHONE = ?, PHONE2 = ?, NOTES = ?, MAXDEBT = ?, NAME = ? WHERE TAXID = ?",
                            SerializerWriteParams.INSTANCE
                            ).exec(new DataParams() { public void writeValues() throws BasicException {
                                setString(1, customer.getAddress());
                                setString(2, customer.getAddress2());
                                setString(3, customer.getPostal());
                                setString(4, customer.getCity());
                                setString(5, customer.getRegion());
                                setString(6, customer.getCountry());
                                setString(7, customer.getFirstname());
                                setString(8, customer.getLastname());
                                setString(9, customer.getEmail());
                                setString(10, customer.getPhone());
                                setString(11, customer.getPhone2());
                                setString(12, customer.getNotes());
                                setDouble(13, customer.getMaxdebt());
                                setString(14, customer.getName());
                                setString(15, customer.getTaxid());
                            }}) == 0) {
                   
                    // If not updated, try to insert
                    new PreparedSentence(s,
                            "INSERT INTO CUSTOMERS(ID, SEARCHKEY, NAME, ADDRESS, ADDRESS2, POSTAL, CITY, REGION, COUNTRY, FIRSTNAME, LASTNAME, EMAIL, PHONE, PHONE2, NOTES, TAXID, MAXDEBT, VISIBLE) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + s.DB.TRUE() + ")",
                            SerializerWriteParams.INSTANCE
                            ).exec(new DataParams() { public void writeValues() throws BasicException {
                                setString(1, customer.getId());
                                setString(2, customer.getSearchkey());
                                setString(3, customer.getName());
                                setString(4, customer.getAddress());
                                setString(5, customer.getAddress2());
View Full Code Here

               
                // Try to update               
                if (new PreparedSentence(s,
                            "UPDATE TAXCATEGORIES SET NAME = ?  WHERE ID = ?",
                            SerializerWriteParams.INSTANCE
                            ).exec(new DataParams() { public void writeValues() throws BasicException {
                                setString(1, taxcat.getName());
                                setString(2, taxcat.getID());                                   
                            }}) == 0) {
                      
                    // If not updated, try to insert
                    new PreparedSentence(s,
                            "INSERT INTO TAXCATEGORIES(ID, NAME) VALUES (?, ?)",
                            SerializerWriteParams.INSTANCE
                            ).exec(new DataParams() { public void writeValues() throws BasicException {
                                setString(1, taxcat.getID());
                                setString(2, taxcat.getName());
                            }});
                }
               
View Full Code Here

TOP

Related Classes of com.openbravo.data.loader.DataParams

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.