System_menuController.groovy
上传用户:steveyhw
上传日期:2019-05-13
资源大小:307k
文件大小:3k
源码类别:
PlugIns编程
开发平台:
Java
- import java.text.SimpleDateFormat
- import java.sql.Connection;
- import java.sql.PreparedStatement;
- import java.sql.ResultSet;
- import java.sql.SQLException;
- import java.util.ArrayList;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- class System_menuController {
- def index = { redirect(action:list,params:params) }
- // the delete, save and update actions only accept POST requests
- def allowedMethods = [delete:'POST', save:'POST', update:'POST']
- def list = {
- if(!params.max) params.max = 10
- [ system_menuList: System_menu.list( params ) ]
- }
- def show = {
- println 'fffffff'+params.id
- def system_menu = System_menu.get( params.id )
- if(!system_menu) {
- flash.message = "system_menu.not.found"
- flash.args = [params.id]
- flash.defaultMessage = "System_menu not found with id ${params.id}"
- redirect(action:list)
- }
- else { return [ system_menu : system_menu ] }
- }
- def delete = {
- def system_menu = System_menu.get( params.id )
- if(system_menu) {
- system_menu.delete()
- flash.message = "system_menu.deleted"
- flash.args = [params.id]
- flash.defaultMessage = "System_menu ${params.id} deleted"
- redirect(action:list)
- }
- else {
- flash.message = "system_menu.not.found"
- flash.args = [params.id]
- flash.defaultMessage = "System_menu not found with id ${params.id}"
- redirect(action:list)
- }
- }
- def edit = {
- def system_menu = System_menu.get( params.id )
- if(!system_menu) {
- flash.message = "system_menu.not.found"
- flash.args = [params.id]
- flash.defaultMessage = "System_menu not found with id ${params.id}"
- redirect(action:list)
- }
- else {
- return [ system_menu : system_menu ]
- }
- }
- def update = {
- def system_menu = System_menu.get( params.id )
- if(system_menu) {
- system_menu.properties = params
- if(!system_menu.hasErrors() && system_menu.save()) {
- flash.message = "system_menu.updated"
- flash.args = [params.id]
- flash.defaultMessage = "System_menu ${params.id} updated"
- redirect(action:show,id:system_menu.id)
- }
- else {
- render(view:'edit',model:[system_menu:system_menu])
- }
- }
- else {
- flash.message = "system_menu.not.found"
- flash.args = [params.id]
- flash.defaultMessage = "System_menu not found with id ${params.id}"
- redirect(action:edit,id:params.id)
- }
- }
- def create = {
- def system_menu = new System_menu()
- system_menu.properties = params
- return ['system_menu':system_menu]
- }
- def save = {
- def system_menu = new System_menu(params)
- if(!system_menu.hasErrors() && system_menu.save()) {
- flash.message = "system_menu.created"
- flash.args = ["${system_menu.id}"]
- flash.defaultMessage = "System_menu ${system_menu.id} created"
- redirect(action:show,id:system_menu.id)
- }
- else {
- render(view:'create',model:[system_menu:system_menu])
- }
- }
- }