function route(expressApp){

    expressApp.get('/gameEvent', 'gameEvent', expressApp.restrict, function (req, res) {
        expressApp.models.GameEvents.findAll().then(function(results) {
            res.render('gameEvent/list', {
                title: 'GameEvents',
                listObjs: results
            });
        }).catch(function(err) {
            next(err);
        });
    });

    expressApp.get('/gameEvent/create', 'gameEvent.create', expressApp.restrict, function (req, res) {
        res.render('gameEvent/create', {
            title: 'GameEvents Create'
        });
    });

    expressApp.get('/gameEvent/:id', 'gameEvent.show', expressApp.restrict, function(req, res) {
        var gameEventId = req.params.id;
        expressApp.models.GameEvents.findOne({
            where: {
                GameEventID: gameEventId
            }
        })
        .then(function(result){
            res.render('gameEvent/edit', {
                title: 'GameEvents',
                obj : result
            });
        }).catch(function(err) {
            next(err);
        });

    });

    expressApp.post('/gameEvent/', 'gameEvent.store', expressApp.restrict, function(req, res, next) {
        var gameEvent = req.body.gameEvent;
        expressApp.models.GameEvents.create({
            GameEventID  : gameEvent.GameEventID
            , EventCategory1 : gameEvent.EventCategory1
            , EventCategory2 : gameEvent.EventCategory2
            , EventCategory3 : gameEvent.EventCategory3
            , ItemListID : gameEvent.ItemListID

            , ItemCount : gameEvent.ItemCount
            , ItemStatus : gameEvent.ItemStatus
            , TargetGroup : gameEvent.TargetGroup
            , TargetOS : gameEvent.TargetOS
            , TargetDevice : gameEvent.TargetDevice
            , EventImageLink : gameEvent.EventImageLink
            , Title : gameEvent.Title
            , Content : gameEvent.Content

            , sCol1 : gameEvent.sCol1 || ''
            , sCol2 : gameEvent.sCol2 || ''
            , sCol3 : gameEvent.sCol3 || ''
            , sCol4 : gameEvent.sCol4 || ''
            , sCol5 : gameEvent.sCol5 || ''
            , sCol6 : gameEvent.sCol6 || ''
            , sCol7 : gameEvent.sCol7 || ''
            , sCol8 : gameEvent.sCol8 || ''
            , sCol9 : gameEvent.sCol9 || ''
            , sCol10 : gameEvent.sCol10 || ''

            , EventDurationFrom : gameEvent.EventDurationFrom
            , EventDurationTo  : gameEvent.EventDurationTo
            , OrderNumber   : gameEvent.OrderNumber
            , CreateAdminID    : gameEvent.CreateAdminID || ''

            , HideYN : gameEvent.HideYN
            , DeleteYN : gameEvent.DeleteYN
            , DataFromRegion : gameEvent.DataFromRegion || ''
            , DataFromRegionDT : gameEvent.DataFromRegionDT || '1900-01-01 00:00:00:000 +00:00'

        }).then(function() {
            res.redirect('/gameEvent');
        }).catch(function(err) {
            next(err);
        });

    });

    expressApp.post('/gameEvent/edit', 'gameEvent.update', expressApp.restrict, function(req, res, next) {
        var gameEvent = req.body.gameEvent;
        expressApp.models.GameEvents.update({

            EventCategory1 : gameEvent.EventCategory1
            , EventCategory2 : gameEvent.EventCategory2
            , EventCategory3 : gameEvent.EventCategory3
            , ItemListID : gameEvent.ItemListID

            , ItemCount : gameEvent.ItemCount
            , ItemStatus : gameEvent.ItemStatus
            , TargetGroup : gameEvent.TargetGroup
            , TargetOS : gameEvent.TargetOS
            , TargetDevice : gameEvent.TargetDevice
            , EventImageLink : gameEvent.EventImageLink
            , Title : gameEvent.Title
            , Content : gameEvent.Content

            , sCol1 : gameEvent.sCol1
            , sCol2 : gameEvent.sCol2
            , sCol3 : gameEvent.sCol3
            , sCol4 : gameEvent.sCol4
            , sCol5 : gameEvent.sCol5
            , sCol6 : gameEvent.sCol6
            , sCol7 : gameEvent.sCol7
            , sCol8 : gameEvent.sCol8
            , sCol9 : gameEvent.sCol9
            , sCol10 : gameEvent.sCol10

            , EventDurationFrom : gameEvent.EventDurationFrom
            , EventDurationTo  : gameEvent.EventDurationTo
            , OrderNumber   : gameEvent.OrderNumber

            , HideYN : gameEvent.HideYN
            , DeleteYN : gameEvent.DeleteYN

        }, {
            where: {GameEventID  : gameEvent.GameEventID}
        }).then(function() {
            res.redirect('/gameEvent');
        }).catch(function(err) {
            next(err);
        });
    });
}

module.exports = route;

@@ -99,32 +99,38 @@
 nction (req, res
+, next
 ) %7B%0A        expr
@@ -129,60 +129,576 @@
     
-expressApp.models.GameEvents.findAll().then(function
+var perPage = 15;%0A        var currentPage = Number(req.query.page %7C%7C 1);%0A        var filter = %7B%7D;%0A%0A        var Model = expressApp.models.GameEvents;%0A%0A        Model.findAll(%7B%0A                where : filter%0A            %7D)%0A            .then(function(filteredModel) %7B%0A                var count = filteredModel.length;%0A%0A                Model.findAll(%7B%0A                        where : filter,%0A                        limit : perPage,%0A                        offset : (currentPage %3C= 1) ? 0 : perPage*(currentPage-1)%0A                    %7D)%0A                    .then(function 
 (res
@@ -701,24 +701,36 @@
 (results) %7B%0A
+            
             
@@ -756,24 +756,36 @@
 nt/list', %7B%0A
+            
             
@@ -825,16 +825,28 @@
         
+            
 listObjs
@@ -854,17 +854,116 @@
  results
-%0A
+,%0A                            page:currentPage,%0A                            count:count%0A            
         
@@ -970,32 +970,44 @@
     %7D);%0A        
+       
+     
 %7D).catch(functio
@@ -1003,32 +1003,33 @@
 tch(function
+ 
 (err) %7B%0A
             
@@ -1008,32 +1008,120 @@
 unction (err) %7B%0A
+                    next(err);%0A                %7D);%0A%0A            %7D).catch(function(err)%7B%0A
             next

modify list paginaton for game event