app-tax-analysis.ctrl.js 1.37 KB
Newer Older
gary's avatar
gary committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
frameworkModule
    .controller('appTaxAnalysisController', ['$scope','$log', 'SweetAlert', '$translate', 'menuService', '$timeout', 'userService', 'loginContext', 'Upload', 'apiInterceptor','$state',
        function ($scope,$log, SweetAlert, $translate, menuService, $timeout, userService, loginContext, Upload, apiInterceptor,$state) {
            'use strict';

            $log.debug('appTaxAnalysisController.ctor()...');

            $scope.toggleMenu = function () {
                $rootScope.$broadcast(enums.adminEvent.layoutChanged);
            };

            userService.getUserPermission(loginContext.userName).success(function (data) {
                $timeout(function () {
                    menuService.getMenusForDisplay(4, loginContext.userId).success(function (menuData) {
                        $scope.menuData = menuData;
                    });
                }, 500);
            });

            $scope.loginUser = loginContext.userName;
            $scope.specialUser = $scope.loginUser.toLowerCase();

            $scope.convertTo2BitNumber = function (number) {
                var str = "" + number;
                var pad = "00";
                return pad.substring(0, pad.length - str.length) + str;
            };

            (function initialize() {
                $log.debug('appTaxAnalysisController.initialize()...');
            })();
        }
    ]);