Permalink
Browse files

Update PrintCustomsActivity.java

- Removed code duplication
  • Loading branch information...
1 parent 72440b5 commit c039a3af098ec51efb3cf65a3ee9126decda4876 @alexbiehl alexbiehl committed Mar 28, 2013
Showing with 6 additions and 11 deletions.
  1. +6 −11 src/main/java/org/fhw/asta/kasse/client/activity/PrintCustomsActivity.java
@@ -304,17 +304,12 @@ public void onSuccess(List<Person> result) {
strb.append("<table class='usertb'><tr class='headlineus'><td>RZ-Login</td><td class>Name</td><td>Vorname</td><td>Mobil</td><td>Festnetz</td><td>E-Mail</td><td>Straße</td><td>Ort</td></tr>");
int t = 0;
for (Person p : result) {
- if (t % 2 == 1) {
- strb.append("<tr class='uneven'><td>"+p.getLdapName()+"</td><td class>"+p.getSurname()+
- "</td><td>"+p.getPrename()+"</td><td>"+p.getPhoneMobile()+"</td><td>" +
- p.getPhoneHome()+"</td><td>"+p.getEmail()+"</td><td>" +
- p.getStreet()+" "+p.getStreetnumber()+"</td><td>"+p.getZipcode()+" "+p.getTown()+"</td></tr>");
- } else {
- strb.append("<tr class='even'><td>"+p.getLdapName()+"</td><td class>"+p.getSurname()+
- "</td><td>"+p.getPrename()+"</td><td>"+p.getPhoneMobile()+"</td><td>" +
- p.getPhoneHome()+"</td><td>"+p.getEmail()+"</td><td>" +
- p.getStreet()+" "+p.getStreetnumber()+"</td><td>"+p.getZipcode()+" "+p.getTown()+"</td></tr>");
- }
+
+ strb.append("<tr class='" + t % 2 == 1 ? "uneven" : "even" + "'><td>"+p.getLdapName()+"</td><td class>"+p.getSurname()+
+ "</td><td>"+p.getPrename()+"</td><td>"+p.getPhoneMobile()+"</td><td>" +
+ p.getPhoneHome()+"</td><td>"+p.getEmail()+"</td><td>" +
+ p.getStreet()+" "+p.getStreetnumber()+"</td><td>"+p.getZipcode()+" "+p.getTown()+"</td></tr>");
+
t++;
}
strb.append("</table>");

0 comments on commit c039a3a

Please sign in to comment.