function route(expressApp){

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

    expressApp.get('/memberItem/create', 'memberItem.create', expressApp.restrict, function (req, res) {

        res.render('memberItem/create', {
            title: 'MemberItems Create'
        });
    });

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

    });

    expressApp.post('/memberItem/', 'memberItem.store', expressApp.restrict, function(req, res, next) {
        var memberItem = req.body.memberItem;
        expressApp.models.MemberItems.create({
            MemberItemID : memberItem.MemberItemID

            , MemberID : memberItem.MemberID

            , ItemListID : memberItem.ItemListID

            , ItemCount : memberItem.ItemCount
            , ItemStatus : memberItem.ItemStatus

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

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

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

    expressApp.post('/memberItem/edit', 'memberItem.update', expressApp.restrict, function(req, res, next) {
        var memberItem = req.body.memberItem;
        expressApp.models.MemberItems.update({
            MemberID : memberItem.MemberID

            , ItemListID : memberItem.ItemListID

            , ItemCount : memberItem.ItemCount
            , ItemStatus : memberItem.ItemStatus

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

            , HideYN : memberItem.HideYN
            , DeleteYN : memberItem.DeleteYN

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

module.exports = route;

@@ -101,32 +101,38 @@
 nction (req, res
+, next
 ) %7B%0A        expr
@@ -131,61 +131,577 @@
     
-expressApp.models.MemberItems.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.MemberItems;%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
@@ -704,24 +704,36 @@
 (results) %7B%0A
+            
             
@@ -760,24 +760,36 @@
 em/list', %7B%0A
+            
             
@@ -830,16 +830,28 @@
         
+            
 listObjs
@@ -859,17 +859,116 @@
  results
-%0A
+,%0A                            page:currentPage,%0A                            count:count%0A            
         
@@ -975,32 +975,44 @@
     %7D);%0A        
+       
+     
 %7D).catch(functio
@@ -1008,32 +1008,33 @@
 tch(function
+ 
 (err) %7B%0A
             
@@ -1013,32 +1013,120 @@
 unction (err) %7B%0A
+                    next(err);%0A                %7D);%0A%0A            %7D).catch(function(err)%7B%0A
             next

modify list paginaton for member item