Ejemplo n.º 1
0
  /*
   * (non-Javadoc)
   * @see
   * com.adibrata.smartdealer.service.danatunai.DanaTunaiTransactions#Save
   * (com.adibrata.smartdealer.model.Customer)
   */
  @Override
  public void Save(final String usrupd, final DanaTunai danaTunai) throws Exception {
    // TODO Auto-generated method stub
    final Partner partner = danaTunai.getPartner();
    final Office office = danaTunai.getOffice();

    this.session.getTransaction().begin();
    try {
      final String transno =
          TransactionNo(
              this.session, partner.getPartnerCode(), office.getId(), TransactionType.danatunai);
      danaTunai.setDanaTunaiNo(transno);
      danaTunai.setDtmCrt(this.dtmupd.getTime());
      danaTunai.setDtmUpd(this.dtmupd.getTime());
      this.session.save(danaTunai);
      this.session.getTransaction().commit();

    } catch (final Exception exp) {
      this.session.getTransaction().rollback();
      final ExceptionEntities lEntExp = new ExceptionEntities();
      lEntExp.setJavaClass(Thread.currentThread().getStackTrace()[1].getClassName());
      lEntExp.setMethodName(Thread.currentThread().getStackTrace()[1].getMethodName());
      ExceptionHelper.WriteException(lEntExp, exp);
    }
  }
Ejemplo n.º 2
0
  public static String GetDescription(Partner partner, String coaname) {
    String coadesc = "";
    Session session = HibernateHelper.getSessionFactory().openSession();
    Query qryGetID =
        session
            .createQuery(
                " Select coaDescription from  Coamaster  "
                    + " Where partnercode =:partnercode and Coaname = :coaname")
            .setParameter("coaname", coaname)
            .setParameter("partnercode", partner.getPartnerCode());

    coadesc = (String) qryGetID.uniqueResult();

    return coadesc;
  }