Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "PositionId": "574c1ccd02182121008b1980",
- "PositionRefNo": "00353","PositionInformation": {
- "LastActionTypeItem": null,
- "LastActionTime": null,
- "UseableActionTypes": [{
- "ActionType": "StartPosition",
- "ActionTypeDisplay": "Start"
- }],
- "LoadList": [{
- "Id": "5714ef197283771ac820269f",
- "OrderDate": "2016-04-18T17:25:00+03:00",
- "RefNo": "00265",
- "StatusName": "bla bla",
- "BranchName": "xxxxx",
- "ArrivalBranchName": "aaaaaa",
- "DepartureCityName": "bbbbb",
- "DepartureCountyName": "",
- "ArrivalCityName": "",
- "ArrivalCountyName": "",
- "OrderContent": "10 ",
- "UnloadingCustomerAddressType": "Warehouse"
- }, {
- "Id": "5714f761728377367414db0b",
- "OrderDate": "2016-04-18T18:02:00+03:00",
- "RefNo": "00266",
- "StatusName": "",
- "BranchName": "",
- "ArrivalBranchName": "",
- "DepartureCityName": "",
- "DepartureCountyName": "",
- "ArrivalCityName": "",
- "ArrivalCountyName": "",
- "OrderContent": "4 Palet",
- "UnloadingCustomerAddressType": "Warehouse"
- }, {
- "Id": "5716432372837636548073ae",
- "OrderDate": "2016-04-19T17:39:00+03:00",
- "RefNo": "00266-001",
- "StatusName": "",
- "BranchName": "",
- "ArrivalBranchName": "",
- "DepartureCityName": "",
- "DepartureCountyName": "",
- "ArrivalCityName": "",
- "ArrivalCountyName": "",
- "OrderContent": "1 Piece",
- "UnloadingCustomerAddressType": "www"
- }, {
- "Id": "571641967507d650b49c805a",
- "OrderDate": "2016-04-19T16:51:00+03:00",
- "RefNo": "00268",
- "StatusName": "cc",
- "BranchName": "dd",
- "ArrivalBranchName": "ee",
- "DepartureCityName": "ff",
- "DepartureCountyName": "gg",
- "ArrivalCityName": "g",
- "ArrivalCountyName": "",
- "OrderContent": "10 Palet",
- "UnloadingCustomerAddressType": ""
- }],
- "Status": true,
- "Message": "",
- }
- }
- public class DomMobileLoadList {
- private String PositionId;
- private String PositionRefNo;
- private String Message;
- private Boolean Status;
- private ArrayList<LoadList> LoadList;
- private ArrayList<PositionInformation> PositionInformation;
- public DomMobileLoadList(JSONObject jObj) throws JSONException
- {
- this.PositionId = jObj.isNull("PositionId") || jObj.getString("PositionId").equals("null") ? "" : jObj.optString("PositionId");
- this.PositionRefNo = jObj.isNull("PositionRefNo") || jObj.getString("PositionRefNo").equals("null") ? "" : jObj.optString("PositionRefNo");
- this.Message = jObj.isNull("Message") || jObj.getString("Message").equals("null") ? "" : jObj.optString("Message");
- this.Status = jObj.optBoolean("Status");
- if(!jObj.isNull("LoadList"))
- {
- /*
- JSONObject jsonObject = jObj.getJSONObject("LoadList");
- this.LoadList = new ArrayList<LoadList>();
- this.LoadList.add(new LoadList(jsonObject));
- */
- this.LoadList = new ArrayList<LoadList>();
- JSONArray array = jObj.getJSONArray("LoadList");
- for (int i = 0; i < array.length(); i++)
- {
- this.LoadList.add(new LoadList(array.getJSONObject(i)));
- }
- }
- if(!jObj.isNull("PositionInformation"))
- {
- JSONObject jobposInfo = jObj.getJSONObject("PositionInformation");
- this.PositionInformation = new ArrayList<PositionInformation>();
- this.PositionInformation.add(new PositionInformation(jobposInfo));
- }
- }
- public String getPositionId() {
- return PositionId;
- }
- public void setPositionId(String positionId) {
- PositionId = positionId;
- }
- public String getPositionRefNo() {
- return PositionRefNo;
- }
- public void setPositionRefNo(String positionRefNo) {
- PositionRefNo = positionRefNo;
- }
- public String getMessage() {
- return Message;
- }
- public void setMessage(String message) {
- Message = message;
- }
- public Boolean getStatus() {
- return Status;
- }
- public void setStatus(Boolean status) {
- Status = status;
- }
- public ArrayList<LoadList> getLoadList() {
- return LoadList;
- }
- public void setLoadList(ArrayList<LoadList> loadList) {
- LoadList = loadList;
- }
- }
- public class DomMobileLoadListAdapter extends BaseAdapter{
- // LoadList vardฤฑ DomMobileLoadList olarak deฤiลtirdim .
- Activity activity;
- private ArrayList<DomMobileLoadList> items;
- private LayoutInflater inflater = null;
- public DomMobileLoadListAdapter(Activity activity, ArrayList<DomMobileLoadList> items) {
- this.activity = activity;
- this.items = items;
- this.inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- }
- @Override
- public int getCount() {
- // TODO Auto-generated method stub
- return items.size();
- }
- @Override
- public Object getItem(int position) {
- return position;
- }
- public DomMobileLoadList getLast()
- {
- return this.items.get(getCount()-1);
- }
- @Override
- public long getItemId(int position) {
- // TODO Auto-generated method stub
- return position;
- }
- public void insertItem(int index, DomMobileLoadList item)
- {
- this.items.add(index, item);
- }
- public void addItem(DomMobileLoadList item)
- {
- this.items.add(item);
- }
- public ArrayList<DomMobileLoadList> getItems()
- {
- return this.items;
- }
- public void removeItem(int position)
- {
- this.items.remove(position);
- }
- public void removeItem(LoadList item)
- {
- this.items.remove(item);
- }
- @SuppressWarnings("unused")
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- View vi = convertView;
- final DomMobileLoadList item = items.get(position);
- if(convertView == null)
- vi = inflater.inflate(R.layout.dom_position_details, null);
- TextView txt_departurecityname=(TextView)vi.findViewById(R.id.departure_city_name);
- TextView txt_departurecountyname = (TextView)vi.findViewById(R.id.departure_countname);
- TextView txt_arrivalcityname = (TextView)vi.findViewById(R.id.arrival_cityname);
- TextView txt_arrivalcountyname = (TextView)vi.findViewById(R.id.arrival_countname);
- TextView txt_branchname = (TextView)vi.findViewById(R.id.txt_antrepo);
- TextView txt_ordercontent = (TextView)vi.findViewById(R.id.txt_ordercontent);
- TextView txt_unloadingcustomeraddresstype =(TextView)vi.findViewById(R.id.txt_unloadingcustomeraddresstype);
- /*
- txt_departurecityname.setText(item.getDepartureCityName());
- txt_departurecountyname.setText(item.getDepartureCountyName());
- txt_arrivalcityname.setText(item.getArrivalCityName());
- txt_arrivalcountyname.setText(item.getArrivalCountyName());
- txt_branchname.setText(item.getBranchName());
- txt_ordercontent.setText(item.getOrderContent());
- txt_unloadingcustomeraddresstype.setText(item.getUnloadingCustomerAddressType());
- */
- for (int i = 0; i < item.getLoadList().size(); i++) {
- txt_arrivalcityname.setText(item.getLoadList().get(i).getArrivalCityName());
- txt_departurecountyname.setText(item.getLoadList().get(i).getDepartureCountyName());
- txt_arrivalcityname.setText((item.getLoadList().get(i).getArrivalCityName()));
- txt_arrivalcountyname.setText((item.getLoadList().get(i).getArrivalCountyName()));
- txt_branchname.setText((item.getLoadList().get(i).getBranchName()));
- txt_ordercontent.setText((item.getLoadList().get(i).getOrderContent()));
- txt_unloadingcustomeraddresstype.setText((item.getLoadList().get(i).getUnloadingCustomerAddressType()));
- }
- return vi;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement