Package net.sf.esims.model.entity

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


        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);
   
    StudentDetails studentDetails = UtilsForTestCases.createStudentDetailsForTest();
    Date dateOfAdmission = new Date();
    Student student = new Student("123","345",standard,dateOfAdmission,studentDetails);
View Full Code Here


        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);
   
    StudentDetails studentDetails = UtilsForTestCases.createStudentDetailsForTest();
    Date dateOfAdmission = new Date();
    Student student = new Student("123","345",standard,dateOfAdmission,studentDetails);
View Full Code Here

  public Resolution createDivision() {
    String message = EsimsConstants._BLANK_STRING;

    Standard standardToBeLinkedWith = this.divisionService
    .getStandardById(this.standardId);
    Division division = new Division(this.divisionName,
        standardToBeLinkedWith, this.teacherInCharge,
        this.maxNoOfstudents, this.minNoOfstudents, this.createdOn);
    // setting the non mandatory fields

    division.setBuildingName(this.buildingName);
    division.setLeaderBoy(this.leaderBoy);
    division.setLeaderGirl(this.leaderGirl);
    division.setNoOfBenches(this.noOfBenches);
    division.setNoOfBlackBoards(this.noOfBlackBoards);
    division.setNoOfChairs(this.noOfChairs);
    division.setNoOfDesks(this.noOfDesks);
    division.setNoOfTables(this.noOfTables);
    division.setRoomNo(this.roomNo);

    // Check if the division already exists in the system.
    Division divInSystem = this.divisionService
    .checkIfDivisionExists(division);
    if (divInSystem != null) {
      message = EsimsUtils.createWarnMessage(this.getContext()
          .getContextPath(), "<strong>The division "
          + this.divisionName + " already exists !!</strong>");
View Full Code Here

  }

  // Method that prepopulates an object and makes it ready to be edited.
  @HandlesEvent("beginEditing")
  public Resolution beginEditing() {
    Division divisionToBeEdited = this.divisionService
    .getDivisionById(new Long(this.getContext().getRequest()
        .getParameter("divisionId")));

    // We will not allow changing the standard with which the current
    // division
    // is allotted
    List<Standard> listOfStandards = new ArrayList<Standard>();
    listOfStandards.add(this.divisionService
        .getStandardById(divisionToBeEdited.getStandard()
            .getStandardId()));
    this.getContext().setAttributeToSession("listOfStandards",
        listOfStandards);
    // We set the attirb to session to avoid one more query for the same
    // data.
View Full Code Here

  // Does the actual update to the DB
  @HandlesEvent("updateDivision")
  public Resolution updateDivision() {
    String message = EsimsConstants._BLANK_STRING;
    Division divisionToBeUpdated = (Division) this.getContext()
    .getAttributeFromSession("division");
    divisionToBeUpdated.setName(this.divisionName);
    divisionToBeUpdated.setBuildingName(this.buildingName);
    divisionToBeUpdated.setCreatedOn(this.createdOn);
    divisionToBeUpdated.setLeaderBoy(this.leaderBoy);
    divisionToBeUpdated.setLeaderGirl(this.leaderGirl);
    divisionToBeUpdated.setMaxNoOfstudents(this.maxNoOfstudents);
    divisionToBeUpdated.setMinNoOfstudents(this.minNoOfstudents);
    divisionToBeUpdated.setNoOfBenches(this.noOfBenches);
    divisionToBeUpdated.setNoOfBlackBoards(this.noOfBlackBoards);
    divisionToBeUpdated.setNoOfChairs(this.noOfChairs);
    divisionToBeUpdated.setNoOfDesks(this.noOfDesks);
    divisionToBeUpdated.setNoOfTables(this.noOfTables);
    divisionToBeUpdated.setRoomNo(this.roomNo);
    divisionToBeUpdated.setTeacherInCharge(this.teacherInCharge);
    this.divisionService.save(divisionToBeUpdated);
    message = EsimsUtils.createInfoMessage(this.getContext()
        .getContextPath(), "Division <strong> " + this.divisionName
        + "</strong> was updated succesfully");
View Full Code Here

  // Deletes a division from the system and updates the page with the new List
  // of Divisions.
  @HandlesEvent("deleteDivision")
  public Resolution deleteDivision() {

    Division divisionToBeDeleted = this.divisionService
    .getDivisionById(new Long(this.getContext().getRequest()
        .getParameter("divisionId")));

    this.divisionService.delete(divisionToBeDeleted);
View Full Code Here

    Standard standard = new Standard("1st standard", academicYear);
    standardDAO.save(standard);
   
    StudentDetails  details = UtilsForTestCases.createStudentDetailsForTest();
   
    Division division = new Division("A", standard,"paplubhai",new Integer(50),new Integer(20),new Date());
   
    this.divisionDAO.save(division);
    Date dateOfAdmission = new Date();
    Student student = new Student("123123","345345",standard,dateOfAdmission,details);
    student.setDivision(division);
View Full Code Here

    academicYearDAO.save(academicYear);

    Standard standard = new Standard("1st standard", academicYear);
    standardDAO.save(standard);

    Division division = new Division("A", standard,"paplubhai",new Integer(50),new Integer(20),new Date());

    divisionDAO.save(division);

    List<Division> listOfDivs = divisionDAO.getAll();
    assertNotNull(listOfDivs);
View Full Code Here

    academicYearDAO.save(academicYear);

    Standard standard = new Standard("1st standard", academicYear);
    standardDAO.save(standard);

    Division division = new Division("A", standard,"paplubhai",new Integer(50),new Integer(20),new Date());
    divisionDAO.save(division);

    Division div = divisionDAO.getDivisionById(division.getId());
    assertNotNull(div);

    List<Division> divList = divisionDAO.getDivisionsForStandard(standard);
    assertNotNull(divList);
   
View Full Code Here

    academicYearDAO.save(academicYear);

    Standard standard = new Standard("1st standard", academicYear);
    standardDAO.save(standard);

    Division division = new Division("A", standard,"paplubhai",new Integer(50),new Integer(20),new Date());

    divisionDAO.delete(division);

    List<Division> listOfDivs = divisionDAO.getAll();
    assertEquals(0, listOfDivs.size());
View Full Code Here

TOP

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

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.