@RequestMapping("/list") @ResponseBody public QueryResult<MoayenehMoafiatKhedmat> list( String searchFilter, String order, int pageNumber, int pageSize) { return new QueryResult<MoayenehMoafiatKhedmat>( pageNumber, moayenehMoafiatKhedmatServ.count(), pageSize, moayenehMoafiatKhedmatServ.getAll(searchFilter, order, pageNumber, pageSize)); }
@RequestMapping(value = "/save", method = RequestMethod.POST) public @ResponseBody int save(@RequestBody MoayenehMoafiatKhedmat moayenehMoafiatKhedmat) { if (moayenehMoafiatKhedmat.getId() > 0) { moayenehMoafiatKhedmat.setUpdatedDate(new Date()); moayenehMoafiatKhedmatServ.update(moayenehMoafiatKhedmat); return moayenehMoafiatKhedmat.getId(); } else { moayenehMoafiatKhedmat.setCreatedDate(new Date()); moayenehMoafiatKhedmat.setUpdatedDate(new Date()); moayenehMoafiatKhedmatServ.add(moayenehMoafiatKhedmat); return moayenehMoafiatKhedmat.getId(); } }
@RequestMapping(value = "/delete/{Id}", method = RequestMethod.DELETE) @ResponseBody public Boolean delete(@PathVariable int Id) { moayenehMoafiatKhedmatServ.deleteByEntityId(Id); return true; }
@RequestMapping("/load/{Id}") @ResponseBody public MoayenehMoafiatKhedmat load(@PathVariable int Id) { return moayenehMoafiatKhedmatServ.loadByEntityId(Id); }