1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
| public class DetailClientActivity extends FideliteActivity {
clientBDD cliBDD = new clientBDD(this);
int identifiant;
String nomduclient;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bundle objetbundle = this.getIntent().getExtras();
identifiant = objetbundle.getInt("identifiant");
cliBDD.open();
cli = cliBDD.getClientwithId(identifiant);
LinearLayout LL = new LinearLayout(this);
TextView description = new TextView(this);
TextView tv = new TextView(this);
TextView description1 = new TextView(this);
TextView tv1 = new TextView(this);
TextView description2 = new TextView(this);
TextView tv2 = new TextView(this);
TextView description3 = new TextView(this);
TextView tv3 = new TextView(this);
TextView description4 = new TextView(this);
TextView tv4 = new TextView(this);
TextView description5 = new TextView(this);
TextView tv5 = new TextView(this);
TextView description6 = new TextView(this);
TextView tv6 = new TextView(this);
TextView description7 = new TextView(this);
TextView tv7 = new TextView(this);
TextView description8 = new TextView(this);
TextView tv8 = new TextView(this);
LayoutParams LLParam = new LinearLayout.LayoutParams(
LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
LayoutParams LPdes = new LinearLayout.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
LayoutParams LPtv = new LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT);
LayoutParams LPdes1 = new LinearLayout.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
LayoutParams LPtv1 = new LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT);
LayoutParams LPdes2 = new LinearLayout.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
LayoutParams LPtv2 = new LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT);
LayoutParams LPdes3 = new LinearLayout.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
LayoutParams LPtv3 = new LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT);
LayoutParams LPdes4 = new LinearLayout.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
LayoutParams LPtv4 = new LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT);
LayoutParams LPdes5 = new LinearLayout.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
LayoutParams LPtv5 = new LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT);
LayoutParams LPdes6 = new LinearLayout.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
LayoutParams LPtv6 = new LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT);
LayoutParams LPdes7 = new LinearLayout.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
LayoutParams LPtv7 = new LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT);
LayoutParams LPdes8 = new LinearLayout.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
LayoutParams LPtv8 = new LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT);
LL.setOrientation(LinearLayout.VERTICAL);
LL.setLayoutParams(LLParam);
description.setLayoutParams(LPdes);
tv.setLayoutParams(LPtv);
description1.setLayoutParams(LPdes1);
tv1.setLayoutParams(LPtv1);
description2.setLayoutParams(LPdes2);
tv2.setLayoutParams(LPtv2);
description3.setLayoutParams(LPdes3);
tv3.setLayoutParams(LPtv3);
description4.setLayoutParams(LPdes4);
tv4.setLayoutParams(LPtv4);
description5.setLayoutParams(LPdes5);
tv5.setLayoutParams(LPtv5);
description6.setLayoutParams(LPdes6);
tv6.setLayoutParams(LPtv6);
description7.setLayoutParams(LPdes7);
tv7.setLayoutParams(LPtv7);
description8.setLayoutParams(LPdes8);
tv8.setLayoutParams(LPtv8);
LL.addView(description);
LL.addView(tv);
LL.addView(description1);
LL.addView(tv1);
LL.addView(description2);
LL.addView(tv2);
LL.addView(description3);
LL.addView(tv3);
LL.addView(description4);
LL.addView(tv4);
LL.addView(description5);
LL.addView(tv5);
LL.addView(description6);
LL.addView(tv6);
LL.addView(description7);
LL.addView(tv7);
LL.addView(description8);
LL.addView(tv8);
description.setText("Nom : ");
tv.setText(cli.getNom());
description1.setText("Prénom : ");
tv1.setText(cli.getPrenom());
description2.setText("Adresse : ");
tv2.setText(cli.getAdresse());
description3.setText("Code Postal : ");
tv3.setText(cli.getCp());
description4.setText("Ville : ");
tv4.setText(cli.getVille());
description5.setText("Mail : ");
tv5.setText(cli.getMail());
description6.setText("Téléphone : ");
tv6.setText(cli.getTel());
description7.setText("Nombres de pizzas en cours : ");
tv7.setText(String.valueOf(cli.getNbpizzaencours()));
description8.setText("Nombres de pizzas total : ");
tv8.setText(String.valueOf(cli.getNbpizzatotal()));
setContentView(LL);
cliBDD.close();
}
} |
Partager