use of ca.etsmtl.applets.etsmobile.model.ListeDesElementsEvaluation in project ETSMobile-Android2 by ApplETS.
the class SignetsMobileSoap method listeElementsEvaluation.
/**
* Liste des ��l��ments d'��valuation (devoirs, labos, examens, etc.) avec
* la note obtenue et les statisques, comme dans SIGNETS
*/
public ListeDesElementsEvaluation listeElementsEvaluation(final String codeAccesUniversel, final String motPasse, final String pSigle, final String pGroupe, final String pSession) throws Exception {
return (ListeDesElementsEvaluation) execute(new IWcfMethod() {
@Override
public ExtendedSoapSerializationEnvelope CreateSoapEnvelope() {
ExtendedSoapSerializationEnvelope __envelope = createEnvelope();
SoapObject __soapReq = new SoapObject("http://etsmtl.ca/", "listeElementsEvaluation");
__envelope.setOutputSoapObject(__soapReq);
PropertyInfo __info = null;
__info = new PropertyInfo();
__info.namespace = "http://etsmtl.ca/";
__info.name = "codeAccesUniversel";
__info.type = PropertyInfo.STRING_CLASS;
__info.setValue(codeAccesUniversel);
__soapReq.addProperty(__info);
__info = new PropertyInfo();
__info.namespace = "http://etsmtl.ca/";
__info.name = "motPasse";
__info.type = PropertyInfo.STRING_CLASS;
__info.setValue(motPasse);
__soapReq.addProperty(__info);
__info = new PropertyInfo();
__info.namespace = "http://etsmtl.ca/";
__info.name = "pSigle";
__info.type = PropertyInfo.STRING_CLASS;
__info.setValue(pSigle);
__soapReq.addProperty(__info);
__info = new PropertyInfo();
__info.namespace = "http://etsmtl.ca/";
__info.name = "pGroupe";
__info.type = PropertyInfo.STRING_CLASS;
__info.setValue(pGroupe);
__soapReq.addProperty(__info);
__info = new PropertyInfo();
__info.namespace = "http://etsmtl.ca/";
__info.name = "pSession";
__info.type = PropertyInfo.STRING_CLASS;
__info.setValue(pSession);
__soapReq.addProperty(__info);
return __envelope;
}
@Override
public Object ProcessResult(ExtendedSoapSerializationEnvelope __envelope, SoapObject __result) throws Exception {
return (ListeDesElementsEvaluation) getResult(ListeDesElementsEvaluation.class, __result, "listeElementsEvaluationResult", __envelope);
}
}, "http://etsmtl.ca/listeElementsEvaluation");
}
use of ca.etsmtl.applets.etsmobile.model.ListeDesElementsEvaluation in project ETSMobile-Android2 by ApplETS.
the class NoteManager method deleteExpiredListeDesElementsEvaluation.
/**
* Deletes marks in DB that doesn't exist on API
*
* @param
*/
private void deleteExpiredListeDesElementsEvaluation(String id) {
DatabaseHelper dbHelper = new DatabaseHelper(context);
try {
Dao<ListeDesElementsEvaluation, String> listeDesElementsEvaluationDao = dbHelper.getDao(ListeDesElementsEvaluation.class);
ListeDesElementsEvaluation listeDesElementsEvaluation = listeDesElementsEvaluationDao.queryForId(id);
if (listeDesElementsEvaluation != null) {
Dao<ElementEvaluation, String> elementsEvaluationDao = dbHelper.getDao(ElementEvaluation.class);
DeleteBuilder<ElementEvaluation, String> deleteBuilder = elementsEvaluationDao.deleteBuilder();
Where where = deleteBuilder.where();
where.eq("listeDesElementsEvaluation_id", listeDesElementsEvaluation);
deleteBuilder.delete();
}
listeDesElementsEvaluationDao.deleteById(id);
} catch (SQLException e) {
e.printStackTrace();
}
}
use of ca.etsmtl.applets.etsmobile.model.ListeDesElementsEvaluation in project ETSMobile-Android2 by ApplETS.
the class NoteManager method deleteExpiredCours.
/**
* Deletes courses in DB that doesn't exist on API
*
* @param
*/
public void deleteExpiredCours(ListeDeCours listeDeCours) {
DatabaseHelper dbHelper = new DatabaseHelper(context);
HashMap<String, Cours> coursHashMap = new HashMap<String, Cours>();
for (Cours cours : listeDeCours.liste) {
cours.id = cours.sigle + cours.session;
coursHashMap.put(cours.id, cours);
}
ArrayList<Cours> dbCours = new ArrayList<Cours>();
try {
dbCours = (ArrayList<Cours>) dbHelper.getDao(Cours.class).queryForAll();
ArrayList<ListeDesElementsEvaluation> dbliste = (ArrayList<ListeDesElementsEvaluation>) dbHelper.getDao(ListeDesElementsEvaluation.class).queryForAll();
for (Cours coursNew : dbCours) {
if (!coursHashMap.containsKey(coursNew.id)) {
Dao<Cours, String> coursDao = dbHelper.getDao(Cours.class);
coursDao.deleteById(coursNew.id);
deleteExpiredListeDesElementsEvaluation(coursNew.id);
}
}
} catch (SQLException e) {
e.printStackTrace();
}
}
use of ca.etsmtl.applets.etsmobile.model.ListeDesElementsEvaluation in project ETSMobile-Android2 by ApplETS.
the class NoteManager method getListElementsEvaluation.
public ListeDesElementsEvaluation getListElementsEvaluation(String id) {
DatabaseHelper dbHelper = new DatabaseHelper(context);
ListeDesElementsEvaluation listElementsEvaluation = null;
try {
Dao<ListeDesElementsEvaluation, String> listElementsEvaluationsDao = dbHelper.getDao(ListeDesElementsEvaluation.class);
listElementsEvaluation = listElementsEvaluationsDao.queryForId(id);
} catch (SQLException e) {
Log.e("SQL Exception", e.getMessage());
}
return listElementsEvaluation;
}
use of ca.etsmtl.applets.etsmobile.model.ListeDesElementsEvaluation in project ETSMobile-Android2 by ApplETS.
the class NoteManager method updateElementsEvaluation.
/**
* Rajout de l'id pour identifier les éléments d'évaluation par rapport au cours effectué dans une session
*/
public void updateElementsEvaluation(ListeDesElementsEvaluation listElementsEvaluation) {
DatabaseHelper dbHelper = new DatabaseHelper(context);
try {
dbHelper.getDao(ListeDesElementsEvaluation.class).createOrUpdate(listElementsEvaluation);
for (ElementEvaluation elementEvaluation : listElementsEvaluation.liste) {
elementEvaluation.id = listElementsEvaluation.id + elementEvaluation.nom;
elementEvaluation.listeDesElementsEvaluation = listElementsEvaluation;
dbHelper.getDao(ElementEvaluation.class).createOrUpdate(elementEvaluation);
}
} catch (SQLException e) {
Log.e("SQL Exception", e.getMessage());
}
}
Aggregations