Package com.knowgate.crm

Examples of com.knowgate.crm.Contact


  }

  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 = "";
View Full Code Here


  }// fi

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

    oBuffer.append(sIdent+"</Project>");
   
View Full Code Here

  public Contact[] getContacts(JDCConnection oConn)
    throws SQLException {
    Contact[] aContacts = null;
    DBSubset oBooks = new DBSubset(DB.k_x_course_bookings+" b,"+DB.k_contacts+" c",                 
                                   new Contact().getTable(oConn).getColumnsStr(),
                                   "b."+DB.gu_contact+"=c."+DB.gu_contact+" AND "+
                                   "b."+DB.gu_acourse+"=?",50);
    int nBooks = oBooks.load(oConn, new Object[]{get(DB.gu_acourse)});
    if (nBooks>0) {
      aContacts = new Contact[nBooks];
      for (int b=0; b<nBooks; b++) {
        aContacts[b] = new Contact();
        aContacts[b].putAll(oBooks.getRowAsMap(b));
      } // next
    } // fi

    return aContacts;
View Full Code Here

      throw new IllegalStateException("Invoice was already created for academic course booking");

    if (isNull(DB.gu_contact))
      throw new IllegalStateException("AcademicCourseBooking.getContact() gu_contact not set");

  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)) {
View Full Code Here

      throw new IllegalStateException("Invoice was already created for academic course booking");
   
    if (isNull(DB.gu_contact))
      throw new IllegalStateException("AcademicCourseBooking.getContact() gu_contact not set");

  Contact oCntc = new Contact(oConn, getString(DB.gu_contact));
  if (oCntc.isNull(DB.sn_passport))
    throw new SQLException("Legal document number not set for Contact "+getString(DB.gu_contact)+" at bookig for academic course "+getString(DB.gu_acourse));
   
  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 = oCntc.getAddresses(oConn);
  DBSubset oBanks = oCntc.getActiveBankAccounts(oConn);
 
  Invoice oInvc = new Invoice();
  oInvc.put(DB.gu_shop, sGuShop);
  oInvc.put(DB.id_currency, oProd.get(DB.id_currency));
  oInvc.put(DB.id_legal, oCntc.getString(DB.sn_passport));
  oInvc.put(DB.de_order, Gadgets.left(getStringNull(DB.nm_acourse,"")+"/"+oCntc.getStringNull(DB.tx_name,"")+" "+oCntc.getStringNull(DB.tx_surname,""),100))
  oInvc.put(DB.gu_contact, oCntc.getString(DB.gu_contact));
  oInvc.put(DB.nm_client, Gadgets.left(oCntc.getStringNull(DB.tx_name,"")+" "+oCntc.getStringNull(DB.tx_surname,""),200));
  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

  public Contact getContact(JDCConnection oConn)
    throws SQLException, IllegalStateException {
    if (isNull(DB.gu_contact))
      throw new IllegalStateException("AcademicCourseBooking.getContact() gu_contact not set");
    return new Contact(oConn, getString(DB.gu_contact));
  }
View Full Code Here

      try {
        File[] aDirs = oBase.listFiles();
        if (aDirs!=null) {
          DBBind oDbbd = new DBBind(argv[0]);
          Contact oCont = new Contact();
          JDCConnection oConn = oDbbd.getConnection("AttachmentUploader");
          PreparedStatement oStmt = oConn.prepareStatement("SELECT "+DB.gu_contact+","+DB.gu_workarea+" FROM "+DB.k_contacts+" WHERE "+DB.gu_contact+"=? OR "+DB.id_ref+"=? OR "+DB.sn_passport+"=?",
                                                           ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
          oConn.setAutoCommit(false);
          int nDirs = aDirs.length;
          for (int d=0; d<nDirs; d++) {
            if (aDirs[d].isDirectory()) {
              String sDirName = aDirs[d].getName();
              oStmt.setString(1, sDirName);
              oStmt.setString(2, sDirName);
              oStmt.setString(3, sDirName);
              ResultSet oRSet = oStmt.executeQuery();
              if (oRSet.next()) {
                oCont.replace(DB.gu_contact , oRSet.getString(1));
                oCont.replace(DB.gu_workarea, oRSet.getString(2));
                oRSet.close();
                oCont.addAttachments(oConn, argv[2], aDirs[d].getAbsolutePath(), true);
                oConn.commit();
                aDirs[d].delete();
              } else {
                DebugFile.writeln("AttachmentUploader.main() SQLException: No data found for Contact "+sDirName);
                oRSet.close();
View Full Code Here

  public Contact getContact(JDCConnection oConn)
    throws SQLException, IllegalStateException {
    if (isNull(DB.gu_alumni))
      throw new IllegalStateException("AcademicCourseAlumni.getContact() gu_alumni not set");
    return new Contact(oConn, getString(DB.gu_alumni));
  }
View Full Code Here

      if (!isNull(DB.gu_address)) {
        oAddr = new Address(oConn, getString(DB.gu_address));
        putAll(oAddr.getItemMap());
      }
      if (!isNull(DB.gu_contact)) {
        oCont = new Contact(oConn, getString(DB.gu_contact));
        putAll(oCont.getItemMap());
      }
    }
  return bRetVal;
  }
View Full Code Here

 
  if (bRetVal) {
    String sColunmName;
    ListIterator<DBColumn> oIter;

    if (oCont==null) oCont = new Contact();
    boolean bHasAnyContactValue = false;
    oIter = oCont.getTable(oConn).getColumns().listIterator();
    while (oIter.hasNext() && !bHasAnyContactValue) {
      sColunmName = oIter.next().getName();
      if (!sColunmName.equals(DB.gu_workarea) && !sColunmName.equals(DB.gu_contact) && !sColunmName.equals(DB.gu_writer))
View Full Code Here

TOP

Related Classes of com.knowgate.crm.Contact

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.