Package com.zesped.model

Examples of com.zesped.model.Client


  private void filterClientsBySubstr(String sFind) {
    int nCount = clients.size();
    if (sFind==null) sFind="";
    for (int u=0; u<nCount; u++) {
      Client oClt = clients.get(u);
      if (oClt.getBusinessName().toUpperCase().indexOf(sFind.toUpperCase())<0 &&
        !sFind.equalsIgnoreCase(oClt.getTaxId())) {
        clients.remove(u--);
        nCount--;
      }
    } //next
  }
View Full Code Here


  }

  @DefaultHandler
  public Resolution form() {
    if (getParam("client.id")==null) {
      client = new Client();
      client.setTaxPayer(getSessionAttribute("taxpayer_docid"));
      client.setCountry("es");
    } else {
      try {
            connect(getSessionAttribute("nickname"), getSessionAttribute("password"));
            setClient(new Client(getSession().getDms(), getParam("client.id")));
            disconnect();
          } catch (Exception xcpt) {
            Log.out.error("EditClient.form() "+xcpt.getClass().getName()+" "+xcpt.getMessage(), xcpt);
          } finally {
            close();
View Full Code Here

      addError(new LocalizableError("com.zesped.action.SaveClient.businessName.valueNotPresent"));
    } else {
      try {
        connect();
        CustomerAccount oAcc = new CustomerAccount(getSession().getDms(), getSessionAttribute("customer_account_docid"));
        Client oFoundClient = oAcc.clients(getSession()).seek(getSession(), sBusinessName);
        if (!oFoundClient.id().equals(sFormerId))
          addError(new LocalizableError("com.zesped.action.SaveClient.businessNameAlreadyExists"));
        oFoundClient = oAcc.clients(getSession()).seek(getSession(), sTaxId);
        if (!oFoundClient.id().equals(sFormerId))
          addError(new LocalizableError("com.zesped.action.SaveClient.taxIdAlreadyExists"));
      } catch (ElementNotFoundException clientnotfound) {
      } catch (Exception e) {
        Log.out.error("SaveClient.validateBusinessName("+sBusinessName+") "+e.getClass().getName()+" "+e.getMessage(), e);
      } finally {
View Full Code Here

  @DefaultHandler
  public Resolution save() {
    final String sFormerId = getParam("client.id");
    if (getErrorsCount()==0) {
      try {
        Client oClnt;
        connect(getSessionAttribute("nickname"), getSessionAttribute("password"));
        if (sFormerId.length()>0) {
            oClnt = new Client();
            oClnt.load(getSession(), sFormerId);
        } else {
            CustomerAccount oCacc = new CustomerAccount(getSession().getDms(), getSessionAttribute("customer_account_docid"));
            oClnt = new Client(getSession(), oCacc.clients(getSession()));
        }
        saveRequest(oClnt);
        disconnect();
          addDataLine("id",oClnt.id());
      } catch (Exception xcpt) {
        Log.out.error(xcpt.getMessage(), xcpt);
        addError(new SimpleError(xcpt.getMessage()));
      } finally {
        close();
View Full Code Here

    final String id = getParam("id","");

    try {
          connect(getSessionAttribute("nickname"), getSessionAttribute("password"));
          Dms oDms = getSession().getDms();
      Client clnt = new Client(oDms, id);
      if (clnt.invoicesCount(oDms)>0)
        addError(new LocalizableError("com.zesped.action.CheckCanDeleteClient.hasInvoices",clnt.getBusinessName()));
      else if (clnt.ticketsCount(oDms)>0)
        addError(new LocalizableError("com.zesped.action.CheckCanDeleteClient.hasTickets",clnt.getBusinessName()));
      disconnect();
      } catch (Exception xcpt) {
        Log.out.error("CheckCanDeleteClient.form() "+xcpt.getClass().getName()+" "+xcpt.getMessage(), xcpt);
      } finally {
        close();
View Full Code Here

        Log.out.debug("Reading ticket "+oTck.id());
        ticketIds.add(oTck.id());
        thumbnails.add(oTck.thumbnail(getSession()).id());
        if (oTck.isNull("biller_taxpayer")) {
          Log.out.debug("Ticket "+oTck.id()+" has no biller");
          billers.add(new Client());
          billersids.add("");
        } else {
          Client oClt = new Client(oDms, oTck.getBillerTaxPayer());
          billers.add(oClt);
          billersids.add(oClt.id());
          Log.out.debug("Ticket "+oTck.id()+" has biller "+oTck.getBillerTaxPayer());
        }
        ticketNumbers.add(oTck.getTicketNumber());
        if (oTck.isNull("ticket_date"))
          ticketDates.add("");
View Full Code Here

TOP

Related Classes of com.zesped.model.Client

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.