Examples of Student


Examples of org.apache.click.examples.domain.Student

    /**
     * @see FormTablePage#onEditClick()
     */
    public boolean onEditClick() {
        Student student = getSelectedStudent();

        // If no student is selected, exist early
        if (student == null) {
            return true;
        }

        // Add each student course to the PickList
        List courses = student.getCourses();
        for (int i = 0; i < courses.size(); i++) {
            Course course = (Course) courses.get(i);
            pickList.addSelectedValue(course.getId().toString());
        }
        form.setDataObject(student);
View Full Code Here

Examples of org.apache.click.examples.domain.Student

     * Return the selected student or null if no student is selected.
     *
     * @return the selected student or null if no student is selected
     */
    private Student getSelectedStudent() {
        Student student = null;

        Integer id = editLink.getValueInteger();
        if (id != null) {
            student = (Student) getDataObject(id);
        }
View Full Code Here

Examples of org.apache.click.examples.domain.Student

        table.addColumn(new Column("id"));
        table.addColumn(new Column("name"));
        table.addColumn(new Column("studentHouse")).setDecorator(new Decorator() {

            public String render(Object object, Context context) {
                Student student = (Student) object;
                if (student.getStudentHouse() != null) {
                    return student.getStudentHouse().getName();
                } else {
                    return "";
                }
            }
        });
View Full Code Here

Examples of org.apache.geronimo.javaee6.jpa20.entities.Student

        response.setContentType("text/html;charset=8859_1");
        PrintWriter out = response.getWriter();
        try {
            String sid = request.getParameter("sid");
            int intsid = Integer.parseInt(sid);
            Student student = facade.findStudent(intsid);

            out.println("<html>");
            out.println("<head>");
            out.println("<title>Servlet viewAllCourse</title>")
            out.println("</head>");
            out.println("<body>");
            out.println("<a>Welcome!Student Name:"+student.getInfo().getName()+"</a>");
     
      List<Course> courses = facade.findAllCourse();
      if(courses==null){
        out.println("<p>error occur! can not findallcourse()! it is empty!</p>");
        out.println("</body>");
View Full Code Here

Examples of org.apache.geronimo.javaee6.jpa20.entities.Student

            String cid=request.getParameter("cid");
            String sid=request.getParameter("sid");
//            double score = 3.0;
          
            int intsid = Integer.parseInt(sid);
            Student student = facade.findStudent(intsid);
      out.println("<a>Get student name is:"+student.getInfo().getName()+"</a>\n");
      ///
            int intcid = Integer.parseInt(cid);
            Course course=facade.findCourse(intcid);
      out.println("<a>course name:"+course.getCname()+"</a>\n");
     
            facade.selectCourse(student, course);
      out.println("<a>after selectCourse op. </a>\n");
      out.println("</body>");
      out.println("</html>");
            RequestDispatcher dispatcher=request.getRequestDispatcher("viewSelect_CourseRelation?sid="+student.getId());
            dispatcher.forward(request, response);
        } finally {
            out.close();
        }
    }
View Full Code Here

Examples of org.apache.geronimo.javaee6.jpa20.entities.Student

        response.setContentType("text/html;charset=8859_1");
        PrintWriter out = response.getWriter();
        try {
            String sid = request.getParameter("sid");
            int intsid = Integer.parseInt(sid);
            Student student = facade.findStudent(intsid);

            out.println("<html>");
            out.println("<head>");
            out.println("<title>Servlet selectCourse</title>")
            out.println("</head>");
            out.println("<body>");
            out.println("<a>Welcome!Student Name:"+student.getInfo().getName()+"</a>");
     
      List<Course> courses = facade.findAllCourse();

      out.println("<h2>Want to Select Course?</h2>");
            List<Course> selectedCourses = new ArrayList<Course>();
      selectedCourses = student.getCourses();
      {
        out.println("</ol>");
        for (Course course : courses) {
          if (selectedCourses==null || !selectedCourses.contains(course)){
            out.println("<li>Course name:");
            out.println("Click Here to Select "+course.getCname()+" from selectCourse ");
            out.println("<a href=\"CourseSelect?cid="+course.getCid()+"&sid="+student.getId()+"\">Select This Course</a>");
            out.println("</li>");
            }
        }
        out.println("</ol>");
      }
     
            out.println("<h2>Want to Cancel selected Course?</h2>");
      if(student.getCourses()==null){
        out.println("<p>INFO:Student has no course selected.</p>");
      }
      else
      {
        selectedCourses = student.getCourses();
        out.println("<ol>");
        for (Course course : selectedCourses) {
          out.println("<li>Course name:");
          out.println("Click Here to Unselect "+course.getCname()+" from selectCourse");
          out.println("<a href=\"CourseUnselect?cid="+course.getCid()+"&sid="+student.getId()+"\">Unselect This Course</a>");
          out.println("</li>");
        }
        out.println("</ol>");
      }
View Full Code Here

Examples of org.apache.geronimo.javaee6.jpa20.entities.Student

            BasicInfo basicInfo=new BasicInfo();
            basicInfo.setAddress(address);
            basicInfo.setAge(Integer.parseInt(age));
            basicInfo.setName(sname);
            basicInfo.setTelephone(telephone);
            Student student=new Student();
            student.setId(Integer.parseInt(sid));
            student.setInfo(basicInfo);
            student.setRank("N/A");
            student.setTotalScore(sco+student.getTotalScore());
           
//            System.out.println("student info before em.persist:sname:"+sname+",Address.city"+address.getCity()+",BasicInfo.TEL:"+basicInfo.getTelephone());
            facade.createStudent(student);
            RequestDispatcher dispatcher=request.getRequestDispatcher("viewAllStudents");
            dispatcher.forward(request, response);
View Full Code Here

Examples of org.apache.geronimo.javaee6.jpa20.entities.Student

        try {
            String cid=request.getParameter("cid");
            String sid=request.getParameter("sid");
            int intsid = Integer.parseInt(sid);
            int intcid = Integer.parseInt(cid);
            Student student=facade.findStudent(intsid);
            Course course=facade.findCourse(intcid);
            facade.unselectCourse(student, course);
            RequestDispatcher dispatcher=request.getRequestDispatcher("viewSelect_CourseRelation?sid="+sid);
            dispatcher.forward(request, response);
        } finally {
View Full Code Here

Examples of org.apache.openjpa.persistence.common.apps.Student

            clist.add(curr);
            clist.add(acurr);
            dlist.add(durr);
        }

        Student stud = new Student("Jonathan", clist, dlist);
        Student stud2 = new Student("Stam", null, dlist);
        Student stud3 = new Student("John", clist, null);
        Student stud4 = new Student("Bill", null, null);

        em.persist(stud);
        em.persist(stud2);
        em.persist(stud3);
        em.persist(stud4);
View Full Code Here

Examples of org.bitbucket.andyrobr.clever.models.Student

        assertNotNull(studentsInDistrict);
        assertTrue(studentsInDistrict.size() == 1);

        assertEquals(studentsInDistrict.get(0), students.get(0));

        Student student = clever.getStudent(studentsInDistrict.get(0).getId());

        assertEquals(student, students.get(0));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.