Package net.sf.esims.model.entity

Examples of net.sf.esims.model.entity.IssuedApplicationForm


      errors.add("applicantDateOfBirth", new LocalizableError("/office/issuedApplicationForm/LowAge"));
      getContext().setValidationErrors(errors);
      return getContext().getSourcePageResolution();
    }

    IssuedApplicationForm issuedApplicationForm = new IssuedApplicationForm(
        this.formNumber, this.dateOfSale, this.buyerFirstName,
        this.buyerLastName, this.applicantFirstName,
        this.applicantLastName, this.applicantDateOfBirth);

    // Check if the form number exists in the system
View Full Code Here


  }

  @HandlesEvent("beginEditing")
  public Resolution beginEditing() {
    IssuedApplicationForm issuedApplicationForm = this.applicationFormService
        .getById(new Long(this.getContext().getRequest().getParameter(
            "formId")));
    this.getContext().setAttributeToSession("issuedForm",
        issuedApplicationForm);
    String buttonName = "updateIssuedForm";
View Full Code Here

  @HandlesEvent("updateIssuedForm")
  public Resolution updateIssuedForm() {
    String message = EsimsConstants._BLANK_STRING;

    IssuedApplicationForm issuedApplicationForm = (IssuedApplicationForm) this
        .getContext().getAttributeFromSession("issuedForm");
    issuedApplicationForm
        .setApplicantDateOfBirth(this.applicantDateOfBirth);
    issuedApplicationForm.setApplicantFirstName(this.applicantFirstName);
    issuedApplicationForm.setApplicantLastName(this.applicantLastName);
    issuedApplicationForm.setBuyerFirstName(this.buyerFirstName);
    issuedApplicationForm.setBuyerLastName(this.buyerLastName);
    issuedApplicationForm.setDateOfSale(this.dateOfSale);
    this.applicationFormService.save(issuedApplicationForm);
    message = EsimsUtils.createInfoMessage(this.getContext()
        .getContextPath(), "Form # <strong> " + this.formNumber
        + "</strong> was updated succesfully");
View Full Code Here

  }

  @HandlesEvent("deleteIssuedForm")
  public Resolution deleteIssuedForm() {

    IssuedApplicationForm issuedApplicationForm = this.applicationFormService
        .getById(new Long(this.getContext().getRequest().getParameter(
            "formId")));
    this.applicationFormService.delete(issuedApplicationForm);

    // refreshing the list.
View Full Code Here

  public void testSave() throws Exception {
    DatabaseOperation.DELETE_ALL.execute(this.connection,
        this.issuedFormDataSet);
    Date date = EsimsUtils.createDate(2, Calendar.MARCH, 1980);
    IssuedApplicationForm applicationForm = new IssuedApplicationForm(
        "form123", new Date(), "buyerfn", "buyerln", "appfn", "appln",
        date);
    issuedApplicationFormDAO.save(applicationForm);
    // till now we are performing valid operations.
View Full Code Here

  public void testDelete() throws Exception {
    DatabaseOperation.DELETE_ALL.execute(this.connection,
        this.issuedFormDataSet);
    Date date = EsimsUtils.createDate(2, Calendar.MARCH, 1980);
    IssuedApplicationForm applicationForm = new IssuedApplicationForm(
        "100", new Date(), "buyerfn", "buyerln", "appfn", "appln", date);
    issuedApplicationFormDAO.save(applicationForm);
    issuedApplicationFormDAO.delete(applicationForm);

    // Null should fail
View Full Code Here

  @SuppressWarnings("unused")
  public void testGetAll() throws Exception {
    DatabaseOperation.DELETE_ALL.execute(this.connection,
        this.issuedFormDataSet);
    Date date = EsimsUtils.createDate(2, Calendar.MARCH, 1980);
    IssuedApplicationForm applicationForm1 = new IssuedApplicationForm(
        "form2", new Date(), "buyerfn", "buyerln", "appfn", "appln",
        date);
    issuedApplicationFormDAO.save(applicationForm1);

    IssuedApplicationForm applicationForm2 = new IssuedApplicationForm(
        "form1", new Date(), "buyerfn", "buyerln", "appfn", "appln",
        date);
    issuedApplicationFormDAO.save(applicationForm2);

    List<IssuedApplicationForm> listOfIssuedForms = issuedApplicationFormDAO
        .getAll();
    assertEquals(2, listOfIssuedForms.size());

    List<IssuedApplicationForm> listOfIssuedForms2 = issuedApplicationFormDAO
        .getAll("formNumber");
    assertEquals(2, listOfIssuedForms.size());

    IssuedApplicationForm applicationForm3 = new IssuedApplicationForm(
        "newform1", new Date(), "buyerfn", "buyerln", "appfn", "appln",
        date);
    issuedApplicationFormDAO.save(applicationForm3);
    List<IssuedApplicationForm> listOfIssuedForms3 = issuedApplicationFormDAO
        .getByFormNumber("newform1");
    assertEquals(1, listOfIssuedForms3.size());
    assertEquals("newform1", listOfIssuedForms3.get(0).getFormNumber());

    Long tempId = listOfIssuedForms3.get(0).getId();
    IssuedApplicationForm form = issuedApplicationFormDAO.get(tempId);
    assertNotNull(form);
    assertEquals("newform1", form.getFormNumber());

    // this should return null
    IssuedApplicationForm form1 = issuedApplicationFormDAO.get(new Long(
        234442222));
    assertNull(form1);

    DatabaseOperation.DELETE_ALL.execute(this.connection,
        this.issuedFormDataSet);
View Full Code Here

TOP

Related Classes of net.sf.esims.model.entity.IssuedApplicationForm

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.