Exemplo n.º 1
0
 private void initData() {
   data = getData();
   sellerNameTv.setText(data.getShopKeeperName());
   listView.setAdapter(new CarAdapter(getActivity(), data));
   setListViewHeightBasedOnChildren(listView);
   setPrice();
 }
Exemplo n.º 2
0
 private void setPrice() {
   priceTv.setText(UnitUtil.toRMB(data.getPrice()));
 }
 private void addToCarOrder(Good g) {
   CarOrder o = CarOrder.getCarOrder(context);
   String shopId = Constants.seller.getShopId();
   try {
     if (!shopId.equals(o.getShopId())) {
       o = new CarOrder();
     }
   } catch (Exception e) {
     e.printStackTrace();
   }
   o.setBuyerName(Constants.seller.getShopName());
   o.setShopId(shopId);
   o.setBuyerName(Constants.user.getUserName());
   o.setShopKeeperName(Constants.seller.getShopName());
   o.setUserId(Constants.user.getUserId());
   Integer shopType = Constants.seller.getShopType();
   if (shopType != null) {
     o.setSeaRecordId(
         shopType.intValue() == Seller.TYPE_FARMER
             ? null
             : ((Fisherman) Constants.seller).getSeaRecordId());
   }
   List<Good> goods = o.getOrdersDetail();
   if (goods == null) {
     goods = new ArrayList<Good>();
   }
   g.setNumber(1);
   goods.add(g);
   o.setOrdersDetail(goods);
   CarOrder.saveCarOrder(o, context);
 }