Package com.zesped.model

Examples of com.zesped.model.CustomerAccount


 
  @DefaultHandler
  public Resolution form() {   
    try {
        connect(getSessionAttribute("nickname"), getSessionAttribute("password"));
        CustomerAccount cacc = new CustomerAccount(getSession().getDms(), getSessionAttribute("customer_account_docid"));
        clients=cacc.clients(getSession()).list(getSession());
        disconnect();
      } catch (Exception xcpt) {
        Log.out.error(xcpt.getMessage(), xcpt);
      } finally {
        close();
View Full Code Here


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

        connect();
        if (sFormerId.length()>0) {
            oTxpr = new TaxPayer();
            oTxpr.load(getSession(), sFormerId);
        } else {
            CustomerAccount oCacc = new CustomerAccount(getSession().getDms(), getSessionAttribute("customer_account_docid"));
            oTxpr = TaxPayer.create(getSession(), oCacc, getParam("taxPayer.businessName"), getParam("taxPayer.contactPerson"), getParam("taxPayer.email"), DAO.getVolumesMountBase());
        }
        saveRequest(oTxpr);
        disconnect();
          addDataLine("id",oTxpr.id());
View Full Code Here

    } else if (sBusinessName.length()==0) {
      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);
View Full Code Here

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

    }
   
    public Collection<Order> getOrders() throws StorageException, InstantiationException, IllegalStateException, IllegalStateException, IllegalAccessException  {
            connect(getSessionAttribute("nickname"), getSessionAttribute("password"));
            Dms oDms = getSession().getDms();
            CustomerAccount oCacc = new CustomerAccount(oDms, getSessionAttribute("customer_account_docid"));
            return (Collection<Order>) oCacc.orders(getSession()).list(getSession());

    }
View Full Code Here

  private AccountingAccount account;

  public Collection<Client> getClients() throws ElementNotFoundException, NotEnoughRightsException, DmsException, InstantiationException, IllegalAccessException {
    AtrilSession oSes = DAO.getAdminSession("CaptureInvoice");
    CustomerAccount oAcc = new CustomerAccount(oSes.getDms().getDocument(getSessionAttribute("customer_account_docid")));
    Collection<Client> clients = oAcc.clients(oSes).list(oSes);
    oSes.disconnect();
    oSes.close();
    return clients;
  }
View Full Code Here

        if (!changepassw) {
          oUser.activate();
          oUser.save(getSession());
          DAO.log(User.class, "ACTIVATE USER", AtrilEvent.Level.INFO, email+";"+id+";"+uid);
        }
        CustomerAccount oCacc = new CustomerAccount(getSession(), oUser);
        Employee oEmpl = new Employee();
        String sEmpl = null;
        if (oEmpl.exists(getSession(), "employee_uuid", oUser.getNickName())!=null)
          sEmpl = oUser.getNickName();
        setSessionAttributes(oUser, oCacc, oCacc.taxpayers(getSession()).byDefault(getSession(),oUser),sEmpl);
        hasorders = (oCacc.orders(getSession()).count()>0);
        disconnect();       
        } catch (AuthenticationException acpt) {
          DAO.log(User.class, "ACTIVATE USER", AtrilEvent.Level.WARNING, email+";"+id+";"+uid);
          Log.out.warn("ActivateUser.form() "+acpt.getClass().getName()+" "+acpt.getMessage(), acpt);
          return new RedirectResolution("/error.jsp?e=systemsecurity");
View Full Code Here

      connect();
      if (txpr.length()>0) {
        taxpr = new TaxPayer(getSession().getDms(), txpr);
        employees = taxpr.employees(getSession()).list(getSession());
      } else {
        CustomerAccount cacc = new CustomerAccount(getSession().getDms(), getSessionAttribute("customer_account_docid"));
        employees = new ArrayList<Employee>();
        bnames = new HashMap<String,String>();
        for (TaxPayer t : cacc.taxpayers(getSession()).list(getSession())) {
          ArrayList<Employee> emps = t.employees(getSession()).list(getSession());
          employees.addAll(emps);
          for (Employee e : emps)
            bnames.put(e.id(), t.getBusinessName());
        }
View Full Code Here

    }
   
    try {
      connect(getSessionAttribute("nickname"), getSessionAttribute("password"));
      Dms oDms = getSession().getDms();
      cacc = new CustomerAccount(oDms, getSessionAttribute("customer_account_docid"));
      if (cnts==null) {
        cnts = cacc.clients(getSession()).list(getSession());
        try {
          Cache.putEntry(getSessionAttribute("customer_account_docid")+"clients", cnts);
        } catch (Exception e) { }
View Full Code Here

TOP

Related Classes of com.zesped.model.CustomerAccount

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.