|
@@ -0,0 +1,86 @@
|
|
|
|
|
+package com.psi.gabontel.mobileapp.helper.objects;
|
|
|
|
|
+
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
|
+import java.util.Iterator;
|
|
|
|
|
+import java.util.LinkedHashMap;
|
|
|
|
|
+
|
|
|
|
|
+import org.json.simple.JSONObject;
|
|
|
|
|
+
|
|
|
|
|
+import com.psi.common.db.DataRow;
|
|
|
|
|
+import com.psi.common.db.DataRowCollection;
|
|
|
|
|
+import com.psi.common.db.DbWrapper;
|
|
|
|
|
+import com.psi.gabontel.mobileapp.helper.objects.OcsPackages.Package;
|
|
|
|
|
+
|
|
|
|
|
+public class SatconPackages {
|
|
|
|
|
+
|
|
|
|
|
+ private static DbWrapper db = DbWrapper.getInstance();
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ private static ArrayList<Package> packages;
|
|
|
|
|
+
|
|
|
|
|
+ public static ArrayList<Package> getPackages() {
|
|
|
|
|
+ return packages;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ static {
|
|
|
|
|
+
|
|
|
|
|
+ packages = new ArrayList<Package>();
|
|
|
|
|
+
|
|
|
|
|
+ DataRowCollection rows = db.QueryDataRows("SELECT PACKAGECODE,PACKAGENUMBER,PACKAGEPRICE/100 as PACKAGEPRICE,LABEL FROM TBLPACKAGESSATCON WHERE STATUS = 1 ORDER BY ID ASC");
|
|
|
|
|
+
|
|
|
|
|
+ Iterator<DataRow> iterator = rows.iterator();
|
|
|
|
|
+ while(iterator.hasNext()) {
|
|
|
|
|
+ DataRow row = iterator.next();
|
|
|
|
|
+ Package pckge = new Package();
|
|
|
|
|
+ pckge.setLabel(row.getString("LABEL"));
|
|
|
|
|
+ pckge.setPackagecode(row.getString("PACKAGECODE"));
|
|
|
|
|
+ pckge.setPackagenumber("PACKAGENUMBER");
|
|
|
|
|
+ pckge.setPackageprice("PACKAGEPRICE");
|
|
|
|
|
+ packages.add(pckge);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public static class Package {
|
|
|
|
|
+
|
|
|
|
|
+ private String packagecode;
|
|
|
|
|
+ private String packageprice;
|
|
|
|
|
+ private String packagenumber;
|
|
|
|
|
+ private String label;
|
|
|
|
|
+ public String getPackagecode() {
|
|
|
|
|
+ return packagecode;
|
|
|
|
|
+ }
|
|
|
|
|
+ public void setPackagecode(String packagecode) {
|
|
|
|
|
+ this.packagecode = packagecode;
|
|
|
|
|
+ }
|
|
|
|
|
+ public String getPackageprice() {
|
|
|
|
|
+ return packageprice;
|
|
|
|
|
+ }
|
|
|
|
|
+ public void setPackageprice(String packageprice) {
|
|
|
|
|
+ this.packageprice = packageprice;
|
|
|
|
|
+ }
|
|
|
|
|
+ public String getPackagenumber() {
|
|
|
|
|
+ return packagenumber;
|
|
|
|
|
+ }
|
|
|
|
|
+ public void setPackagenumber(String packagenumber) {
|
|
|
|
|
+ this.packagenumber = packagenumber;
|
|
|
|
|
+ }
|
|
|
|
|
+ public String getLabel() {
|
|
|
|
|
+ return label;
|
|
|
|
|
+ }
|
|
|
|
|
+ public void setLabel(String label) {
|
|
|
|
|
+ this.label = label;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public String toString() {
|
|
|
|
|
+ JSONObject obj = new JSONObject();
|
|
|
|
|
+ obj.put("packagecode", this.packagecode);
|
|
|
|
|
+ obj.put("packageprice",this.packageprice);
|
|
|
|
|
+ obj.put("packagenumber", this.packagenumber);
|
|
|
|
|
+ obj.put("label",this.label);
|
|
|
|
|
+
|
|
|
|
|
+ return obj.toJSONString();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+}
|