Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 1080 Rev 1103
Line 116... Line 116...
116
		});
116
		});
117
	}
117
	}
Line 118... Line 118...
118
	
118
	
119
	private void traiterReponse(JSONValue reponseValeur, String type) {
119
	private void traiterReponse(JSONValue reponseValeur, String type) {
120
		Information info = new Information(type);
-
 
121
		String message = "";
120
		Information info = new Information(type);
Line 122... Line 121...
122
		String idsNonSuppr = "";
121
		String idsNonSuppr = "";
123
		
122
		
124
		// Si la requête est un succès, réception d'une chaîne
123
		// Si la requête est un succès, réception d'une chaîne
125
		if (type.equals("suppression_projet") && reponseValeur.isArray() != null)	{
124
		if (type.equals("suppression_projet") && reponseValeur.isArray() != null)	{
126
			JSONArray tableauInfo = reponseValeur.isArray();
-
 
127
			idsNonSuppr = tableauInfo.get(0).isString().stringValue();
125
			JSONArray tableauInfo = reponseValeur.isArray();
128
			
126
			idsNonSuppr = tableauInfo.get(0).isString().stringValue();
-
 
127
		} else if (reponseValeur.isString() != null) {
-
 
128
			String idOuMessage = reponseValeur.isString().stringValue();
-
 
129
			if (idOuMessage.matches("^[0-9]+$")) {
-
 
130
				info.setDonnee(idOuMessage);
-
 
131
			} else {
-
 
132
				info.setDonnee("");
129
		} else if (reponseValeur.isString() != null) {
133
				info.setMessage(idOuMessage);
130
			message = reponseValeur.isString().stringValue();
134
			}
131
		} else {
135
		} else {
132
			info.setDeboguage("La réponse n'est pas une chaine JSON.");
-
 
133
		}
136
			info.setDeboguage("La réponse n'est pas une chaine JSON.");
134
		info.setDonnee(0, message);
137
		}
135
		info.setDonnee(1, idsNonSuppr);
138
		info.setDonnee(1, idsNonSuppr);
136
		vueARafraichir.rafraichir(info);
139
		vueARafraichir.rafraichir(info);
137
	}
140
	}