Search in sources :

Example 1 with ListeDeCours

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");
}
Also used : ListeDeCours(ca.etsmtl.applets.etsmobile.model.ListeDeCours) SoapObject(org.ksoap2.serialization.SoapObject) PropertyInfo(org.ksoap2.serialization.PropertyInfo)

Example 2 with ListeDeCours

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();
    }
}
Also used : DatabaseHelper(ca.etsmtl.applets.etsmobile.db.DatabaseHelper) HashMap(java.util.HashMap) SQLException(java.sql.SQLException) ArrayList(java.util.ArrayList) ListeDesElementsEvaluation(ca.etsmtl.applets.etsmobile.model.ListeDesElementsEvaluation) ListeDeCours(ca.etsmtl.applets.etsmobile.model.ListeDeCours) Cours(ca.etsmtl.applets.etsmobile.model.Cours)

Example 3 with ListeDeCours

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");
}
Also used : ListeDeCours(ca.etsmtl.applets.etsmobile.model.ListeDeCours) SoapObject(org.ksoap2.serialization.SoapObject) PropertyInfo(org.ksoap2.serialization.PropertyInfo)

Example 4 with ListeDeCours

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;
}
Also used : ListeDeCours(ca.etsmtl.applets.etsmobile.model.ListeDeCours) ViewGroup(android.view.ViewGroup) ListeDeSessions(ca.etsmtl.applets.etsmobile.model.ListeDeSessions) NoteManager(ca.etsmtl.applets.etsmobile.util.NoteManager)

Aggregations

ListeDeCours (ca.etsmtl.applets.etsmobile.model.ListeDeCours)4 PropertyInfo (org.ksoap2.serialization.PropertyInfo)2 SoapObject (org.ksoap2.serialization.SoapObject)2 ViewGroup (android.view.ViewGroup)1 DatabaseHelper (ca.etsmtl.applets.etsmobile.db.DatabaseHelper)1 Cours (ca.etsmtl.applets.etsmobile.model.Cours)1 ListeDeSessions (ca.etsmtl.applets.etsmobile.model.ListeDeSessions)1 ListeDesElementsEvaluation (ca.etsmtl.applets.etsmobile.model.ListeDesElementsEvaluation)1 NoteManager (ca.etsmtl.applets.etsmobile.util.NoteManager)1 SQLException (java.sql.SQLException)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1