Advertisement
Guest User

Untitled

a guest
Mar 9th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. invoiceApp.controller('masterReportConrtoller', ['$scope', '$location', 'authService', 'usSpinnerService', 'dateService', 'settingsService','$rootScope',
  2. function ($scope, $location, authService, usSpinnerService, dateService, settingsService, $rootScope )
  3. ////Is User Valid
  4. ////
  5. //$rootScope.$on("masterReportConrtoller", function () {
  6. // $scope.parentmethod();
  7. // });
  8. //$scope.parentmethod = function () {
  9. // //
  10. $scope.masterReportConrtoller.getUserDetails = function () {
  11. debugger;
  12. settingsService.getUserDetails().then(function (response) {
  13. var loginData = {
  14. userName: response.d.user.Email,
  15. password: response.d.user.UserPassword
  16.  
  17. };
  18. authService.login(loginData).then(function (response) {
  19. debugger;
  20. $scope.Limit = response.d.organization.Limit;
  21. });
  22. $scope.Limit = response.d.organization.Limit;
  23. $scope.DocumentUsage = response.d.organization.DocumentUsage;
  24. $scope.ExpirationDate = $scope.DateConvertfromJson(response.d.organization.ExpirationDate);
  25. var fullDate = new Date();
  26. if (fullDate <= $scope.ExpirationDate) {
  27. $scope.ISvalidUser = false;
  28. $rootScope.$broadcast('masterReportConrtoller', false);
  29. }
  30. else {
  31. $rootScope.$broadcast('masterReportConrtoller', true);
  32. }
  33. });
  34. }
  35. }]);
  36.  
  37.  
  38. invoiceApp.controller('InvoiceController', ['$scope', '$location', '$cookieStore', 'documentService', 'dialogs', 'usSpinnerService', 'settingsService', 'associatedEmailsService', '$rootScope',
  39. function ($scope, $location, $cookieStore, documentService, dialogs, usSpinnerService, settingsService, associatedEmailsService, $rootScope) {
  40.  
  41.  
  42. $rootScope.$on('masterReportConrtoller');}
  43.  
  44. $state.go('state2', { someParam : 'broken magic' });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement