issue #210 closed

parent ab6b6a0a
...@@ -224,7 +224,7 @@ public class Device extends SQLiteOpenHelper { ...@@ -224,7 +224,7 @@ public class Device extends SQLiteOpenHelper {
Vector<User> users = new Vector<>(); Vector<User> users = new Vector<>();
Cursor cursor = db.query("users_detail", null, null, null, null, null, null, null); Cursor cursor = db.query("users_detail", null, null, null, null, null, null, null);
while (cursor.moveToNext()) while (cursor.moveToNext())
if (cursor.getInt(9) == id_sup) if (cursor.getInt(10) == id_sup)
users.add(new User(cursor.getInt(0), cursor.getString(1), cursor.getString(2), cursor.getString(3), cursor.getString(4), cursor.getInt(5), users.add(new User(cursor.getInt(0), cursor.getString(1), cursor.getString(2), cursor.getString(3), cursor.getString(4), cursor.getInt(5),
cursor.getString(6), cursor.getString(7), cursor.getString(8),cursor.getString(9),cursor.getInt(10), cursor.getString(11), cursor.getString(6), cursor.getString(7), cursor.getString(8),cursor.getString(9),cursor.getInt(10), cursor.getString(11),
cursor.getString(12), cursor.getString(13),cursor.getString(14), cursor.getString(15), cursor.getString(16), cursor.getString(17), cursor.getString(12), cursor.getString(13),cursor.getString(14), cursor.getString(15), cursor.getString(16), cursor.getString(17),
......
...@@ -151,9 +151,10 @@ public class UserLogin { ...@@ -151,9 +151,10 @@ public class UserLogin {
} catch (JSONException e) { } catch (JSONException e) {
e.printStackTrace(); e.printStackTrace();
} catch (LoginException e) { } catch (LoginException e) {
if (e.login_failed()) if (e.login_failed()) {
GUITools.show_alert(activity, R.string.userInetErrorMsg); Log.e(LOG_TAG,"Login offline not possible: "+e.getMessage());
else if (e.no_supervisor_students()) GUITools.show_alert(activity, R.string.userInetErrorMsg);
}else if (e.no_supervisor_students())
GUITools.show_alert(activity, R.string.noStudentsError); GUITools.show_alert(activity, R.string.noStudentsError);
} }
} }
...@@ -239,6 +240,7 @@ public class UserLogin { ...@@ -239,6 +240,7 @@ public class UserLogin {
} catch (JSONException e) { } catch (JSONException e) {
e.printStackTrace(); e.printStackTrace();
} catch (LoginException e) { } catch (LoginException e) {
Log.e(LOG_TAG,"Login offline not possible: "+e.getMessage());
GUITools.show_alert(activity, R.string.userInetErrorMsg); GUITools.show_alert(activity, R.string.userInetErrorMsg);
} }
} //offline student login } //offline student login
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment