Package com.knowgate.crm

Examples of com.knowgate.crm.Company


  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+"=?",
View Full Code Here


    oBuffer.append(sIdent+sIdent+"<nm_project><![CDATA["+getStringNull(DB.de_project,"")+"]]></nm_project>"+sDelim);

  if (isNull(DB.gu_company)) {
    oBuffer.append(sIdent+sIdent+"<Company/>"+sDelim)
  } else {
    Company oComp = new Company(oConn, getString(DB.gu_company));
    oBuffer.append(oComp.toXML(oConn, sIdent+" ", sDelim));
    oBuffer.append(sDelim);
  }// fi

  if (isNull(DB.gu_contact)) {
    oBuffer.append(sIdent+sIdent+"<Contact/>"+sDelim)
View Full Code Here

  Contact oCntc = new Contact(oConn, getString(DB.gu_contact));

  if (oCntc.isNull(DB.gu_company))
    throw new SQLException("Company not set for given Contact");
   
  Company oComp = new Company(oConn, getString(DB.gu_contact));
  if (oComp.isNull(DB.id_legal))
    throw new SQLException("Legal document number not set for given Company");
   
  Product oProd = new Product();

  if (!oProd.load(oConn, new Object[]{getString(DB.gu_acourse)})) {
    throw new SQLException("No product found for given academic course");
  } else {
    if (oProd.isNull(DB.id_currency)) {
      throw new SQLException("Currency for product is not set");
    }
    if (oProd.isNull(DB.pr_list)) {
      throw new SQLException("List price for product is not set");
    }
  }

  DBSubset oAddrs = oComp.getAddresses(oConn);
  DBSubset oBanks = oComp.getActiveBankAccounts(oConn);
 
  Invoice oInvc = new Invoice();
  oInvc.put(DB.bo_active, (short) 1);
  oInvc.put(DB.gu_shop, sGuShop);
  oInvc.put(DB.id_currency, oProd.get(DB.id_currency));
  oInvc.put(DB.id_legal, oComp.getString(DB.id_legal));
  oInvc.put(DB.de_order, Gadgets.left(getStringNull(DB.nm_course,"")+"/"+oCntc.getStringNull(DB.tx_name,"")+" "+oCntc.getStringNull(DB.tx_surname,""),100))
  oInvc.put(DB.gu_company, oComp.getString(DB.gu_company));
  oInvc.put(DB.nm_client, oComp.getString(DB.nm_legal));
  if (oAddrs.getRowCount()>0) {
    oInvc.put(DB.gu_bill_addr, oAddrs.getString(DB.gu_address,0));
    if (!oAddrs.isNull(DB.tx_email,0)) {
      oInvc.put(DB.tx_email_to, oAddrs.getString(DB.tx_email,0));     
    }
View Full Code Here

TOP

Related Classes of com.knowgate.crm.Company

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.