@@ -961,68 +961,4 @@ public String getHfId(String code) {
961961 }
962962 return id ;
963963 }
964-
965- public JSONArray getServices () {
966- String nullOverride ="" ;
967- JSONArray resultSet = new JSONArray ();
968- try {
969- String query = "SELECT * FROM tblServices" ;
970- Cursor cursor1 = db .rawQuery (query , null );
971- cursor1 .moveToFirst ();
972- // looping through all rows
973- while (!cursor1 .isAfterLast ()) {
974- int totalColumns = cursor1 .getColumnCount ();
975- JSONObject rowObject = new JSONObject ();
976- for (int i = 0 ; i < totalColumns ; i ++) {
977- try {
978- if (cursor1 .getString (i ) != null )
979- rowObject .put (cursor1 .getColumnName (i ), cursor1 .getString (i ));
980- else
981- rowObject .put (cursor1 .getColumnName (i ), nullOverride );
982- } catch (JSONException e ) {
983- e .printStackTrace ();
984- Log .d ("Tag Name" , e .getMessage ());
985- }
986- }
987- resultSet .put (rowObject );
988- cursor1 .moveToNext ();
989- }
990- cursor1 .close ();
991- } catch (Exception e ) {
992- e .printStackTrace ();
993- }
994- return resultSet ;
995- }
996-
997- public JSONArray getItems () {
998- String nullOverride ="" ;
999- JSONArray resultSet = new JSONArray ();
1000- try {
1001- String query = "SELECT * FROM tblItems" ;
1002- Cursor cursor1 = db .rawQuery (query , null );
1003- cursor1 .moveToFirst ();
1004- // looping through all rows
1005- while (!cursor1 .isAfterLast ()) {
1006- int totalColumns = cursor1 .getColumnCount ();
1007- JSONObject rowObject = new JSONObject ();
1008- for (int i = 0 ; i < totalColumns ; i ++) {
1009- try {
1010- if (cursor1 .getString (i ) != null )
1011- rowObject .put (cursor1 .getColumnName (i ), cursor1 .getString (i ));
1012- else
1013- rowObject .put (cursor1 .getColumnName (i ), nullOverride );
1014- } catch (JSONException e ) {
1015- e .printStackTrace ();
1016- Log .d ("Tag Name" , e .getMessage ());
1017- }
1018- }
1019- resultSet .put (rowObject );
1020- cursor1 .moveToNext ();
1021- }
1022- cursor1 .close ();
1023- } catch (Exception e ) {
1024- e .printStackTrace ();
1025- }
1026- return resultSet ;
1027- }
1028964}
0 commit comments