Subversion Repositories SmartDukaan

Rev

Rev 2427 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2427 Rev 6788
Line 49... Line 49...
49
    }
49
    }
50
    
50
    
51
    @UiHandler("submitButton")
51
    @UiHandler("submitButton")
52
    void authenticate(ClickEvent event) {
52
    void authenticate(ClickEvent event) {
53
        //authenticate username & password with production role.
53
        //authenticate username & password with production role.
54
        loginService.authenticateUser(userId.getText(), password.getText(), Utils.ROLE_PRODUCTION, new AsyncCallback<String>() {
54
        loginService.authenticateUser(userId.getText(), password.getText(), new AsyncCallback<String>() {
55
            @Override
55
            @Override
56
            public void onSuccess(String result) {
56
            public void onSuccess(String result) {
57
                if(result != null) {
57
                if(result != null && Long.parseLong(result) == Utils.ROLE_PRODUCTION) {
58
                    //Authentication successful. Call update on production.
58
                    //Authentication successful. Call update on production.
59
                    pushToProduction();
59
               		pushToProduction();
60
                } else {
60
                } else {
61
                    Window.alert("Authentication failed");
61
                    Window.alert("Authentication failed");
62
                }
62
                }
63
            }
63
            }
64
            @Override
64
            @Override