use of ca.etsmtl.applets.etsmobile.model.ListeDeCours in project ETSMobile-Android2 by ApplETS.
the class SignetsMobileSoap method listeCoursIntervalleSessions.
/**
* Liste des cours de l'��tudiant entre deux sessions : sigle, groupe,
* session, programme, cote finale, nombre de cr��dits et titre du cours,
* tri��e par session et sigle.
*/
public ListeDeCours listeCoursIntervalleSessions(final String codeAccesUniversel, final String motPasse, final String SesDebut, final String SesFin) throws Exception {
return (ListeDeCours) execute(new IWcfMethod() {
@Override
public ExtendedSoapSerializationEnvelope CreateSoapEnvelope() {
ExtendedSoapSerializationEnvelope __envelope = createEnvelope();
SoapObject __soapReq = new SoapObject("http://etsmtl.ca/", "listeCoursIntervalleSessions");
__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 = "SesDebut";
__info.type = PropertyInfo.STRING_CLASS;
__info.setValue(SesDebut);
__soapReq.addProperty(__info);
__info = new PropertyInfo();
__info.namespace = "http://etsmtl.ca/";
__info.name = "SesFin";
__info.type = PropertyInfo.STRING_CLASS;
__info.setValue(SesFin);
__soapReq.addProperty(__info);
return __envelope;
}
@Override
public Object ProcessResult(ExtendedSoapSerializationEnvelope __envelope, SoapObject __result) throws Exception {
return (ListeDeCours) getResult(ListeDeCours.class, __result, "listeCoursIntervalleSessionsResult", __envelope);
}
}, "http://etsmtl.ca/listeCoursIntervalleSessions");
}
use of ca.etsmtl.applets.etsmobile.model.ListeDeCours 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.ListeDeCours in project ETSMobile-Android2 by ApplETS.
the class SignetsMobileSoap method listeCours.
/**
* Liste de tous les cours de l'��tudiant: sigle, groupe, session,
* programme, cote finale, nombre de cr��dits et titre du cours, tri��e par
* session et sigle.
*/
public ListeDeCours listeCours(final String codeAccesUniversel, final String motPasse) throws Exception {
return (ListeDeCours) execute(new IWcfMethod() {
@Override
public ExtendedSoapSerializationEnvelope CreateSoapEnvelope() {
ExtendedSoapSerializationEnvelope __envelope = createEnvelope();
SoapObject __soapReq = new SoapObject("http://etsmtl.ca/", "listeCours");
__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);
return __envelope;
}
@Override
public Object ProcessResult(ExtendedSoapSerializationEnvelope __envelope, SoapObject __result) throws Exception {
return (ListeDeCours) getResult(ListeDeCours.class, __result, "listeCoursResult", __envelope);
}
}, "http://etsmtl.ca/listeCours");
}
use of ca.etsmtl.applets.etsmobile.model.ListeDeCours in project ETSMobile-Android2 by ApplETS.
the class NotesFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
ViewGroup v = (ViewGroup) inflater.inflate(R.layout.fragment_note, container, false);
super.onCreateView(inflater, v, savedInstanceState);
mListView = (ListView) v.findViewById(R.id.activity_note_listview);
listeDeCours = new ListeDeCours();
listeDeSessions = new ListeDeSessions();
mNoteManager = new NoteManager(getActivity());
mNoteManager.addObserver(this);
mapNoteACeJour = new HashMap<>();
loadingView.showLoadingView();
refreshList();
dataManager.getDataFromSignet(SignetsMethods.LIST_COURS, ApplicationManager.userCredentials, this, "");
dataManager.getDataFromSignet(SignetsMethods.LIST_SESSION, ApplicationManager.userCredentials, this, "");
return v;
}
Aggregations