Examples of Supplier


Examples of ModelLayer.Supplier

       return(rc);
    }

  public int updateSupplier(Supplier sup)
  {
    Supplier supObj  = sup;
    int rc=-1;

    String query="UPDATE supliers SET "+
         "Name='"+ supObj.getName()+"', "+
         "Address ='"+ supObj.getAddress() + "', " +
                          "Country ='"+ supObj.getCountry() + "', " +
                          "PhoneNumber ='"+ supObj.getPhoneNumber()+ "', " +
                          "Email ='"+ supObj.getEmail()+ "' " +
              " WHERE Name= '"+ supObj.getName()+"'";
                System.out.println("Update query:" + query);
      try{ // update employee
       Statement stmt = con.createStatement();
       stmt.setQueryTimeout(5);
        rc = stmt.executeUpdate(query);
View Full Code Here

Examples of com.emc.plants.persistence.Supplier

   * @param url
   */
  public void createSupplier(String supplierID, String name, String street, String city, String state, String zip, String phone, String url) {
    try {
      Util.debug("SuppliersBean.createSupplier() - Entered");
      Supplier supplier = null;
      /*
       try {
       // Create a new Supplier if there is NOT an existing Supplier.
        supplier = getSupplierLocalHome().findByPrimaryKey(new SupplierKey(supplierID));
        } catch (FinderException e) {
        */
      supplier = em.find(Supplier.class, supplierID);
      if (supplier == null) {
        Util.debug("SuppliersBean.createSupplier() - supplier doesn't exist.");
        Util.debug("SuppliersBean.createSupplier() - Creating Supplier for SupplierID: " + supplierID);
        //supplier = getSupplierLocalHome().create(supplierID, name, street, city, state, zip, phone, url);
        supplier = new Supplier(supplierID, name, street, city, state, zip, phone, url);
        em.persist(supplier);
      }
    } catch (Exception e) {
      Util.debug("SuppliersBean.createSupplier() - Exception: " + e);
    }
View Full Code Here

Examples of com.emc.plants.persistence.Supplier

  @Transactional
  public SupplierInfo updateSupplier(String supplierID, String name, String street, String city, String state, String zip, String phone, String url) {
    SupplierInfo supplierInfo = null;
    try {
      Util.debug("SuppliersBean.updateSupplier() - Entered");
      Supplier supplier = null;
      /*
       try { */
      supplier = em.find(Supplier.class, supplierID);
      if (supplier != null) {
        // Create a new Supplier if there is NOT an existing Supplier.
        // supplier = getSupplierLocalHome().findByPrimaryKey(new SupplierKey(supplierID));
        supplier.setName(name);
        supplier.setStreet(street);
        supplier.setCity(city);
        supplier.setUsstate(state);
        supplier.setZip(zip);
        supplier.setPhone(phone);
        supplier.setUrl(url);
        supplierInfo = new SupplierInfo(supplier);
        em.persist(supplier);
        em.flush();
      } else { // catch (FinderException e) {
        Util.debug("SuppliersBean.updateSupplier() - supplier doesn't exist.");
View Full Code Here

Examples of com.emc.plants.persistence.Supplier

  public String getSupplierURL(String supplierID) {
    String url = "";
    /*
     try { */
    Util.debug("SuppliersBean.getSupplierURL() - Entered");
    Supplier supplier = null;
    // Create a new Supplier if there is NOT an existing Supplier.
    // supplier = getSupplierLocalHome().findByPrimaryKey(new SupplierKey(supplierID));
    supplier = em.find(Supplier.class, supplierID);
    if (supplier != null) url = supplier.getUrl();
    /*
     } catch (Exception e) {
     Util.debug("SuppliersBean.getSupplierURL() - Exception: " + e);
     }
     */
 
View Full Code Here

Examples of com.emc.plants.persistence.Supplier

   * @return supplierItem
   */
  public SupplierInfo getSupplierInfo(String supplierID) {
    SupplierInfo supplierItem = null;
    Util.debug("SuppliersBean.getSupplierInfo() - Entered");
    Supplier supplier = null;
   
    // Return the supplier Info if the supplier exists.
    supplier = em.find(Supplier.class, supplierID);
    if (supplier != null)
      supplierItem = new SupplierInfo(supplier);
View Full Code Here

Examples of com.emc.plants.persistence.Supplier

    Query q = em.createNamedQuery("findAllSuppliers");
    List l=q.getResultList();
    if (l!=null){
      Iterator i=l.iterator();
      while (i.hasNext()) {
         Supplier supplier = (Supplier) i.next();
         suppliers.add(new SupplierInfo(supplier));
      }
    }
   
    return suppliers;
View Full Code Here

Examples of com.example.jinq.sample.jpa.entities.Supplier

      return lo;
   }
  
   private Supplier createSupplier(String name, String country, long revenue, boolean hasFreeShipping)
   {
      Supplier s = new Supplier();
      s.setName(name);
      s.setCountry(country);
      s.setRevenue(revenue);
      s.setHasFreeShipping(hasFreeShipping);
      s.setSignature(name.getBytes(Charset.forName("UTF-8")));
      return s;
   }
View Full Code Here

Examples of com.google.common.base.Supplier

        }

        @Override
        protected Object getFallback() {
            if (fallback.isPresent()) {
                Supplier supplier = fallback.get();
                return supplier.get();
            }
            Throwable e = getFailedExecutionException();
            LOG.debug("No fallback with exception", e);
            throw new UnsupportedOperationException("No fallback available for "+name, e);
        }
View Full Code Here

Examples of com.google.common.base.Supplier

                                        @Override
                                        public Object call() throws Exception {
                                            return getCreator(dep.getKey()).get();
                                        }
                                    });
                                    suppliers.add(new Supplier() {
                                        @Override
                                        public Object get() {
                                            try {
                                                return future.get();
                                            } catch (InterruptedException e) {
View Full Code Here

Examples of com.knowgate.crm.Supplier

  public boolean load (JDCConnection oConn, String sWorkArea, String sId) throws SQLException {
    ACLUser  oUser = new ACLUser();
    Fellow   oFellw = new Fellow();
    Contact  oCont = new Contact();
    Company  oComp = new Company();
    Supplier oSupl = new Supplier();
    boolean bFound;
   
  PreparedStatement oStmt = oConn.prepareStatement("SELECT "+DB.pg_lookup+" FROM "+DB.k_duties_lookup+" WHERE "+DB.gu_owner+"=? AND "+DB.id_section+"='nm_resource' AND "+DB.vl_lookup+"=?",
                                                   ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
  oStmt.setString(1, sWorkArea);
  oStmt.setString(2, sId);
  ResultSet oRSet = oStmt.executeQuery();
  bFound = oRSet.next();
  if (bFound) iPg = oRSet.getInt(1);
  oRSet.close();
  oStmt.close();

  if (bFound) {
      sVl = sId;

      if (oFellw.load(oConn, sId)) {
      sFullName = (oFellw.getStringNull(DB.tx_name,"")+" "+oFellw.getStringNull(DB.tx_surname,"")).trim();
      sEmail = oUser.getStringNull(DB.tx_email,"");
      sPhone = oUser.getStringNull(DB.work_phone,"");
      } else if (oUser.load(oConn, sId)) {
      sFullName = (oUser.getStringNull(DB.nm_user,"")+" "+oUser.getStringNull(DB.tx_surname1,"")+" "+oUser.getStringNull(DB.tx_surname2,"")).trim();
      sEmail = oUser.getStringNull(DB.tx_main_email,"");
      sPhone = "";
      } else if (oCont.load(oConn, sId)) {
      sFullName = (oCont.getStringNull(DB.tx_name,"")+" "+oCont.getStringNull(DB.tx_surname,"")).trim();
      sEmail = "";
      sPhone = "";
      } else if (oComp.load(oConn, sId)) {
      sFullName = oComp.getStringNull(DB.nm_commercial,oComp.getString(DB.nm_legal));
      sEmail = "";
      sPhone = "";
      } else if (oSupl.load(oConn, sId)) {
      sFullName = oSupl.getStringNull(DB.nm_commercial,oComp.getString(DB.nm_legal));
      sEmail = oSupl.getAddress().getStringNull(DB.tx_email,"");
      sPhone = oSupl.getAddress().getStringNull(DB.work_phone,"");
      } else {
       
      oStmt = oConn.prepareStatement("SELECT "+DBBind.Functions.ISNULL+"("+DB.tr_+"es,"+DB.tr_+"en) FROM "+DB.k_duties_lookup+" WHERE "+DB.gu_owner+"=? AND "+DB.id_section+"='nm_resource' AND "+DB.vl_lookup+"=?",
                                     ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
      oStmt.setString(1, sWorkArea);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.