Skip to content

Commit

Permalink
Wrapping Up
Browse files Browse the repository at this point in the history
  • Loading branch information
RahulZoldyck committed Jan 20, 2016
1 parent 0181cb3 commit 18b0695
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -467,11 +467,49 @@ public void UpdateSubs(String subs){
finalTimetable.add(sub);
}
handler.delete_day(day);
handler.add_day(finalTimetable.get(0),finalTimetable.get(1),finalTimetable.get(2),finalTimetable.get(3),
finalTimetable.get(4),finalTimetable.get(5),finalTimetable.get(6),finalTimetable.get(7),finalTimetable.get(8));
getActivity().startActivity(new Intent(getActivity(),CRhome.class));
getActivity().finish();
handler.add_day(finalTimetable.get(0), finalTimetable.get(1), finalTimetable.get(2), finalTimetable.get(3),
finalTimetable.get(4), finalTimetable.get(5), finalTimetable.get(6), finalTimetable.get(7), finalTimetable.get(8));
}
String[] a = new String[9];
a = handler.get_tomo();
JSONObject j = new JSONObject();
for (int i = 1; i <= 8; i++) {
try {
j.put(EditUpcomingTT.slots[i - 1], a[i]);
} catch (JSONException e) {
e.printStackTrace();
}
}
UpdateTTService.startActionUpcoming(getActivity(), j);
List<String[]> all = new ArrayList<>();
all.add(handler.get_mon());
all.add(handler.get_tue());
all.add(handler.get_wed());
all.add(handler.get_thur());
all.add(handler.get_fri());

j = new JSONObject();

for (String[] k : all) {
JSONObject js = new JSONObject();
for (int i = 1; i <= 8; i++) {
try {
js.accumulate(EditUpcomingTT.slots[i - 1], k[i]);
} catch (JSONException e) {
e.printStackTrace();
}
}
try {
j.put(k[0], js);
} catch (JSONException e) {
e.printStackTrace();
}
}

UpdateTTService.startActionTT(getActivity(), j);

getActivity().startActivity(new Intent(getActivity(),CRhome.class));
getActivity().finish();
}

private void chatOut(String msg) {
Expand Down
64 changes: 32 additions & 32 deletions app/src/main/java/com/delta/attendancemanager/EditWeeklyTT.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,38 +21,38 @@ public class EditWeeklyTT extends ActionBarActivity {
public static boolean ischanged;
MySqlAdapter handler;

@Override
public void onBackPressed() {
if (ischanged) {
List<String[]> all = new ArrayList<>();
all.add(handler.get_mon());
all.add(handler.get_tue());
all.add(handler.get_wed());
all.add(handler.get_thur());
all.add(handler.get_fri());

JSONObject j = new JSONObject();

for (String[] k : all) {
JSONObject js = new JSONObject();
for (int i = 1; i <= 8; i++) {
try {
js.accumulate(EditUpcomingTT.slots[i - 1], k[i]);
} catch (JSONException e) {
e.printStackTrace();
}
}
try {
j.put(k[0], js);
} catch (JSONException e) {
e.printStackTrace();
}
}

UpdateTTService.startActionTT(this, j);
}
super.onBackPressed();
}
// @Override
// public void onBackPressed() {
// if (ischanged) {
// List<String[]> all = new ArrayList<>();
// all.add(handler.get_mon());
// all.add(handler.get_tue());
// all.add(handler.get_wed());
// all.add(handler.get_thur());
// all.add(handler.get_fri());
//
// JSONObject j = new JSONObject();
//
// for (String[] k : all) {
// JSONObject js = new JSONObject();
// for (int i = 1; i <= 8; i++) {
// try {
// js.accumulate(EditUpcomingTT.slots[i - 1], k[i]);
// } catch (JSONException e) {
// e.printStackTrace();
// }
// }
// try {
// j.put(k[0], js);
// } catch (JSONException e) {
// e.printStackTrace();
// }
// }
//
// UpdateTTService.startActionTT(this, j);
// }
// super.onBackPressed();
// }

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand Down

0 comments on commit 18b0695

Please sign in to comment.