Package net.sf.esims.model.entity

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


    school.setSchoolName("testSchool");
    this.schoolService.save(school);
    AcademicYear academicYear = new AcademicYear("2006-2007", school, d1,
        d2, "active");
    academicYearService.saveAcademicYear(academicYear);
    Standard standard = new Standard("5th standard", academicYear);
    this.standardService.save(standard);

    // must not allow to save
    try {
      this.standardService.save(null);
View Full Code Here


    School school = schoolEssence.createSchool();
    this.schoolService.save(school);
    AcademicYear academicYear = new AcademicYear("2006-2007", school, d1,
        d2, "active");
    this.academicYearService.saveAcademicYear(academicYear);
    Standard standard = new Standard("6th standard", academicYear);
    this.standardService.save(standard);

    // testing delete
    this.standardService.delete(standard);
View Full Code Here

    School school = schoolEssence.createSchool();
    this.schoolService.save(school);
    AcademicYear academicYear = new AcademicYear("2006-2007", school, d1,
        d2, "active");
    this.academicYearService.saveAcademicYear(academicYear);
    Standard standard = new Standard("6th standard", academicYear);
    this.standardService.save(standard);
    // testing of various types of gets begin
    List<Standard> listOfStds = this.standardService.getAll();
    assertTrue((listOfStds.size() > 0));

    listOfStds = this.standardService.getByName("%th%");
    assertTrue((listOfStds.size() > 0));
    Long id = listOfStds.get(0).getStandardId();
    Standard standard2 = this.standardService.getById(id);
    assertEquals("6th standard", standard2.getName());
    // clean up
    this.standardService.delete(standard);
    this.academicYearService.deleteAcademicYear(academicYear);
    this.schoolService.delete(school);
View Full Code Here

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

    Standard standardOfAdmission = this.standardService
        .getById(this.standardId);
    List<ReceivedApplicationForm> applicationForms = this.receivedApplicationFormService
        .getByFormNumber(this.applicationFormNumber);
    if ((applicationForms == null || applicationForms.size() == 0)) {
      message = EsimsUtils
          .createWarnMessage(this.getContext().getContextPath(),
              "No details were found for the given Form #, please recheck");
      return new StreamingResolution("text/html", new StringReader(
          message.toString()));
    } else {
      StudentDetails studentDetails = EsimsUtils
          .createStudentDetailsFromApplicationForm(applicationForms
              .get(0));

      Date dateOfAdmission = new Date();

      Student studentToBeAdmitted = new Student(this.admissionNumber,
          this.applicationFormNumber, standardOfAdmission,
          dateOfAdmission, studentDetails);
      if (this.studentService
          .checkIfDuplicate(this.applicationFormNumber)) {
        message = EsimsUtils.createInfoMessage(this.getContext()
            .getContextPath(), "Form # "
            + studentToBeAdmitted.getApplicationFormNumber()
            + " already exists for another student");
      } else {
        this.studentService.save(studentToBeAdmitted);
        message = EsimsUtils.createInfoMessage(this.getContext()
            .getContextPath(), (studentToBeAdmitted
            .getStudentDetails().getFirstName()
            + " has been admitted to " + standardOfAdmission
            .getName()));
      }
    }
    this.getContext().removeAttributeFromSession("listOfStandards");
    FlashScope.getCurrent(this.getContext().getRequest(), true).put(
View Full Code Here

    School school = schoolEssence.createSchool();
    this.schoolService.save(school);
    AcademicYear academicYear = new AcademicYear("2006-2007", school, d1,
        d2, "active");
    academicYearService.saveAcademicYear(academicYear);
    Standard standard = new Standard("5th standard", academicYear);
    this.standardService.save(standard);
   
    Division division = new Division("A",standard,"paplubhai",new Integer(50),new Integer(20),new Date());
    this.divisionService.save(division);
   
View Full Code Here

    School school = schoolEssence.createSchool();
    this.schoolService.save(school);
    AcademicYear academicYear = new AcademicYear("2006-2007", school, d1,
        d2, "active");
    academicYearService.saveAcademicYear(academicYear);
    Standard standard = new Standard("5th standard", academicYear);
    this.standardService.save(standard);
   
    Division division = new Division("A",standard,"paplubhai",new Integer(50),new Integer(20),new Date());
    this.divisionService.save(division);
   
    Long id = division.getId();
   
    assertTrue(this.divisionService.getStandardsForActiveAcademicYear().size()>0);
   
    assertTrue(this.divisionService.getAllStandards(academicYear).size()>0);
   
    assertNotNull(this.divisionService.getDivisionById(id));
   
    assertTrue(this.divisionService.getDivisionsForStandard(standard).size()>0);
   
    this.divisionService.getStandardById(standard.getStandardId());
   
    //cleaning up
    this.divisionService.delete(division);
    this.standardService.delete(standard);
    this.academicYearService.deleteAcademicYear(academicYear);
View Full Code Here

    AcademicYear academicYear =new AcademicYear("2006-2007", school,
        startDate, endDate, "active");
    this.academicYearService.saveAcademicYear(academicYear);
    startDate = EsimsUtils.createDate(1, Calendar.JUNE, 2007);
    endDate = EsimsUtils.createDate(31, Calendar.MAY, 2008);
    Standard standard = new Standard("5th standard",academicYear);
    standardService.save(standard);
   
    List<IndividualExam> listOfIndExams = new ArrayList<IndividualExam>();
    listOfIndExams.add(UtilsForTestCases.createValidIndExam());
    Exam exam = new Exam(academicYear,standard,"1st Termly exam",startDate,endDate,listOfIndExams);
View Full Code Here

  /**
   *
   * @return valid instance of standard , NO ID is assigned
   */
  public static Standard createValidStandard(){
    return  new Standard("5th standard",createValidAcademicYearWithId());
  }
View Full Code Here

   * DO_NOT USE for Integration tests
   * @return valid instance of standard , Fictious ID is assigned
   * must be used only for unit tests.
   */
  public static Standard createValidStandardWithId(){
    Standard standard = createValidStandard();
    standard.setStandardId(new Long(13));
    return standard;
  }
View Full Code Here

   *
   */
  @HandlesEvent("getSubjectsTaughtInStandard")
  @SuppressWarnings("unchecked")
  public Resolution getSubjectsTaughtInStandard() {
    Standard standard = this.examService
        .getStandardByStdId(this.standardId);

    // Get all the subjects that are taught in the std.
    List<Subject> subjectsTaughtInStd = this.examService
        .getSubjectsTaughtInStandard(standard);
View Full Code Here

TOP

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

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.