Example #1
0
  @RequestMapping(value = "/srch", method = RequestMethod.GET)
  public @ResponseBody JqGridData<?> getCourseDetails(ScorecardPage sp, BindingResult result) {
    // logger.info("Comes inside with searlize object" + sp.getTeetype());
    // logger.info("Comes inside with searlize object" + p.getGender());
    // logger.info("Comes inside with searlize object" + p.getPlayer_id());

    //		    this.sv.validate(sp, result);
    //
    //		    if (result.hasErrors())
    //		    {
    //		    	logger.info("Scorecard has errors");
    //		    	List<ObjectError> obj;
    //			    obj = result.getAllErrors();
    //			    JqGridData<GolfCourseHolesMap> errorData = new
    // JqGridData<GolfCourseHolesMap>(numberOfRows, pageNumber, totalNumberOfRecords,null,obj );
    //		    	return errorData;
    //		    }

    List<GolfCourseHolesMap> courseDetails =
        this.playerManager.getcoursedetails(
            sp.getGolfcourse(), sp.getTeetype(), p.getGender(), p.getPlayer_id());
    numberOfRows = courseDetails.size();
    pageNumber = 1;
    totalNumberOfRecords = courseDetails.size();

    JqGridData<GolfCourseHolesMap> gridData =
        new JqGridData<GolfCourseHolesMap>(
            numberOfRows, pageNumber, totalNumberOfRecords, courseDetails);
    return gridData;
  }
Example #2
0
 @RequestMapping(
     value = "/teetype/{golfcourse}",
     method = RequestMethod.GET,
     produces = "application/json")
 public @ResponseBody List<GolfCourseDetails> getTeeTypes(@PathVariable int golfcourse) {
   logger.info("golfcourse selected is : " + golfcourse);
   List<GolfCourseDetails> gd = this.playerManager.getTeeTypes(golfcourse, p.getGender());
   logger.info("Done getting Tee Types for Golfcourse : " + golfcourse);
   return gd;
 }