Subversion Repositories bacoAlunos

Rev

Rev 1686 | Rev 1724 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1686 Rev 1711
Line 58... Line 58...
58
 
58
 
59
            $(webMessagesContainer).find(".web-messages").html("");
59
            $(webMessagesContainer).find(".web-messages").html("");
60
            if(resposta.service == "error")
60
            if(resposta.service == "error")
61
            {
61
            {
62
                $(webMessagesContainer).find(".web-messages").html('<div class="alert alert-danger">' + resposta.exception + '</div>');
62
                $(webMessagesContainer).find(".web-messages").html('<div class="alert alert-danger">' + resposta.exception + '</div>');
-
 
63
                if(handlerFail != undefined)
-
 
64
                    handlerFail(resposta.exception);
-
 
65
 
63
            }
66
            }
64
            else if(resposta.service == "fail")
67
            else if(resposta.service == "fail")
65
            {
68
            {
66
 
69
 
67
                for(var msg in resposta.messages)
70
                for(var msg in resposta.messages)
Line 86... Line 89...
86
                    handlerOk(resposta.response);
89
                    handlerOk(resposta.response);
87
            }
90
            }
88
        },
91
        },
89
        error: function() {
92
        error: function() {
90
            $(webMessagesContainer).find(".web-messages").html('<div class="alert alert-danger">Erro de comunicação, por favor tente novamente</div>');
93
            $(webMessagesContainer).find(".web-messages").html('<div class="alert alert-danger">Erro de comunicação, por favor tente novamente</div>');
-
 
94
            if(handlerFail != undefined)
-
 
95
                handlerFail(resposta.exception);
-
 
96
 
91
        }
97
        }
92
    });
98
    });
93
}
99
}
94
 
100
 
95
 
101
 
Line 123... Line 129...
123
        {
129
        {
124
            $(webMessagesContainer).find(".web-messages").html("");
130
            $(webMessagesContainer).find(".web-messages").html("");
125
            if(resposta.service == "error")
131
            if(resposta.service == "error")
126
            {
132
            {
127
                $(webMessagesContainer).find(".web-messages").html('<div class="alert alert-danger">' + resposta.exception + '</div>');
133
                $(webMessagesContainer).find(".web-messages").html('<div class="alert alert-danger">' + resposta.exception + '</div>');
-
 
134
                if(handlerFail != undefined)
-
 
135
                    handlerFail();
128
            }
136
            }
129
            else if(resposta.service == "fail")
137
            else if(resposta.service == "fail")
130
            {
138
            {
131
 
139
 
132
                for(var msg in resposta.messages)
140
                for(var msg in resposta.messages)
Line 137... Line 145...
137
                {
145
                {
138
                    $(webMessagesContainer).find(".web-messages").append('<div class="alert alert-warning">' + resposta.errors[error] + '</div>');
146
                    $(webMessagesContainer).find(".web-messages").append('<div class="alert alert-warning">' + resposta.errors[error] + '</div>');
139
                }
147
                }
140
                if(handlerFail != undefined)
148
                if(handlerFail != undefined)
141
                    handlerFail();
149
                    handlerFail();
142
 
-
 
143
            }
150
            }
144
            else if(resposta.service == "ok")
151
            else if(resposta.service == "ok")
145
            {
152
            {
146
                for(var msg in resposta.messages)
153
                for(var msg in resposta.messages)
147
                {
154
                {
Line 156... Line 163...
156
            }
163
            }
157
        },
164
        },
158
        error: function(resposta)
165
        error: function(resposta)
159
        {
166
        {
160
            $(webMessagesContainer).find(".web-messages").html('<div class="alert alert-danger">Erro de comunicação, por favor tente novamente</div>');
167
            $(webMessagesContainer).find(".web-messages").html('<div class="alert alert-danger">Erro de comunicação, por favor tente novamente</div>');
-
 
168
            if(handlerFail != undefined)
-
 
169
                handlerFail();
-
 
170
 
161
        }
171
        }
162
    });
172
    });
163
}
173
}
164
174