{"size": 1412, "ext": "js", "max_stars_repo_path": "src/app/pages/Login/Login.controller.js", "max_stars_repo_name": "Affan007/Akevo-Customized", "max_stars_repo_stars_event_min_datetime": "2017-07-04T07:06:18.000Z", "max_stars_repo_stars_event_max_datetime": "2017-07-04T07:06:18.000Z", "max_issues_repo_path": "src/app/pages/Login/Login.controller.js", "max_issues_repo_name": "Affan007/Akevo-Customized", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/app/pages/Login/Login.controller.js", "max_forks_repo_name": "Affan007/Akevo-Customized", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.1475409836, "max_line_length": 76, "alphanum_fraction": 0.5021246459}
/**
 * @author v.lugovsky
 * created on 16.12.2015
 */
(function () {
  'use strict';

  angular.module('BlurAdmin.signin')
      .controller('SignInCtrl', SignInCtrl);
  function SignInCtrl($scope, $state, $window, $timeout,User,$location) {
    console.log("hi");


    $scope.Login = function() {
        var userdata={
          'username': $scope.UserName,
          'password': $scope.Password

        };

        // console.log(userdata);
        User.Login(userdata)
            .success(function(data) {
              // User.SetUser(data.);
                    $location.path('/dashboard');

            })
            .error(function(data) {
                // console.log(data)
            })

  }

    // $scope.Login = function() {
    //
    //   if ($scope.UserName=='Owner'&& $scope.Password=='Owner'){
    //        User.SetUser($scope.UserName);
    //        $location.path('/reseller/resellerMod');
    //   }
    //   else if($scope.UserName=='Partner'&& $scope.Password=='Partner'){
    //      User.SetUser($scope.UserName);
    //   $location.path('/reseller/resellerMod');
    //   }
    //   else if($scope.UserName=='Reseller'&& $scope.Password=='Reseller'){
    //      User.SetUser($scope.UserName);
    //   $location.path('/reseller/resellerMod');
    //   }
    //   else{
    //       $location.path('/signin');
    //   }
    //
    //   }



    }
  /** @ngInject */


})();
