示例#1
0
 public String View() throws Exception {
   try {
     if (this.getId() != null) {
       this.customer = new Customer();
       this.customer = this.service.ViewCustomer(this.getId());
     } else {
       this.Paging();
       this.mode = INPUT;
       this.setMessage(BaseAction.SelectFirst());
     }
   } catch (final Exception exp) {
     this.setMessage(BaseAction.ErrorMessage());
     final ExceptionEntities lEntExp = new ExceptionEntities();
     lEntExp.setJavaClass(Thread.currentThread().getStackTrace()[1].getClassName());
     lEntExp.setMethodName(Thread.currentThread().getStackTrace()[1].getMethodName());
     ExceptionHelper.WriteException(lEntExp, exp);
   }
   return this.mode;
 }
示例#2
0
  public CustomerAction() throws Exception {
    // TODO Auto-generated constructor stub
    this.partner = new Partner();
    this.partner.setPartnerCode(BaseAction.sesPartnerCode());

    this.Initialisasi();

    if (this.pagenumber == 0) {
      this.pagenumber = 1;
    }
  }
示例#3
0
  private String WhereCond() {
    final StringBuilder wherecond = new StringBuilder();
    wherecond.append(" partnercode = '" + BaseAction.sesPartnerCode() + "'");
    if ((this.getSearchvalue() != null)
        && !this.getSearchcriteria().equals("")
        && !this.getSearchcriteria().equals("0")) {
      wherecond.append(" and ");

      if (this.getSearchvalue().contains("%")) {

        wherecond.append(this.getSearchcriteria() + " like '" + this.getSearchvalue() + "' ");
      } else {
        wherecond.append(this.getSearchcriteria() + " = '" + this.getSearchvalue() + "' ");
      }
    }
    return wherecond.toString();
  }
  @SuppressWarnings("unchecked")
  public void Del() throws Exception {
    try {
      this.lstshareinfo = (List<CoyCustShareInfo>) this.session.get("lstShareInfoSession");
      this.seqno = this.seqno - 1;
      this.lstshareinfo.remove(this.seqno);

      this.session.put("lstShareInfoSession", this.lstshareinfo);
      this.lstshareinfo = (List<CoyCustShareInfo>) this.session.get("lstShareInfoSession");
    } catch (final Exception exp) {

      this.setMessage(BaseAction.ErrorMessage());
      final ExceptionEntities lEntExp = new ExceptionEntities();
      lEntExp.setJavaClass(Thread.currentThread().getStackTrace()[1].getClassName());
      lEntExp.setMethodName(Thread.currentThread().getStackTrace()[1].getMethodName());
      ExceptionHelper.WriteException(lEntExp, exp);
    }
  }
  public void Save() throws Exception {
    try {
      for (final CoyCustShareInfo shareinfo : this.lstshareinfo) {
        shareinfo.setCustomer(this.getCustomer());
        shareinfo.setName(this.getName());
        shareinfo.setIdnumber(this.getIdnumber());
        shareinfo.setJobPositionId(this.getJobpositionid());
        shareinfo.setAddress(this.getAddress());
        shareinfo.setPhone(this.getPhone());
        shareinfo.setSharePercentage(this.getSharepercentage());
      }

      this.customermaintservice.SaveCompanyCustomerShare(sesLoginName(), this.lstshareinfo);
    } catch (final Exception exp) {

      this.setMessage(BaseAction.ErrorMessage());
      final ExceptionEntities lEntExp = new ExceptionEntities();
      lEntExp.setJavaClass(Thread.currentThread().getStackTrace()[1].getClassName());
      lEntExp.setMethodName(Thread.currentThread().getStackTrace()[1].getMethodName());
      ExceptionHelper.WriteException(lEntExp, exp);
    }
  }
  public void Add() throws Exception {
    try {
      final CoyCustShareInfo shareinfo = new CoyCustShareInfo();

      shareinfo.setName(this.getName());
      shareinfo.setIdnumber(this.getIdnumber());
      shareinfo.setJobPositionId(this.getJobpositionid());
      shareinfo.setAddress(this.getAddress());
      shareinfo.setPhone(this.getPhone());
      shareinfo.setSharePercentage(this.getSharepercentage());

      this.lstshareinfo.add(shareinfo);
      this.session.put("lstShareInfoSession", this.lstshareinfo);
    } catch (final Exception exp) {

      this.setMessage(BaseAction.ErrorMessage());
      final ExceptionEntities lEntExp = new ExceptionEntities();
      lEntExp.setJavaClass(Thread.currentThread().getStackTrace()[1].getClassName());
      lEntExp.setMethodName(Thread.currentThread().getStackTrace()[1].getMethodName());
      ExceptionHelper.WriteException(lEntExp, exp);
    }
  }