@Override
 public View getView(int position, View convertView, ViewGroup parent) {
   ViewHolder holder;
   if (convertView == null) {
     convertView = layoutInflater.inflate(R.layout.list_local_car_buy, null);
     holder = new ViewHolder();
     holder.storeTextView = (TextView) convertView.findViewById(R.id.local_car_store_name);
     holder.goodsListView = (InnerListView) convertView.findViewById(R.id.local_car_goods);
     holder.diliverTextView = (TextView) convertView.findViewById(R.id.local_car_store_diliver);
     holder.paymentTextView = (TextView) convertView.findViewById(R.id.local_car_store_pay);
     holder.moneyTextView = (TextView) convertView.findViewById(R.id.local_car_store_money);
     holder.moneyDetailTextView =
         (TextView) convertView.findViewById(R.id.local_car_store_money_detail);
     convertView.setTag(holder);
   } else {
     holder = (ViewHolder) convertView.getTag();
   }
   ModelLocalCar localCar = localCars.get(position);
   holder.storeTextView.setText(localCar.getStore().getServicename());
   holder.goodsListView.setAdapter(new CarGoodsAdapter(localCar));
   holder.diliverTextView.setText(localCar.getDiliver().getName());
   holder.paymentTextView.setText(localCar.getPayment().getName());
   holder.moneyTextView.setText(
       Parameters.CONSTANT_RMB + decimalFormat.format(localCar.getTotalMoney()));
   holder.moneyDetailTextView.setText(
       getMoneyDetailString(localCar.getGoodsMoney(), localCar.getPostFee()));
   return convertView;
 }
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
      ViewHolder holder;
      if (convertView == null) {
        convertView = layoutInflater.inflate(R.layout.list_car_local, null);
        holder = new ViewHolder();
        holder.selectionImageView = (ImageView) convertView.findViewById(R.id.local_car_check);
        holder.selectButton = (LinearLayout) convertView.findViewById(R.id.local_car_selectall);
        holder.storeTextView = (TextView) convertView.findViewById(R.id.local_car_store);
        holder.storePostInfoTextView =
            (TextView) convertView.findViewById(R.id.local_car_post_info);
        holder.moneyTextView = (TextView) convertView.findViewById(R.id.local_car_total);
        holder.moneyDetailTextView =
            (TextView) convertView.findViewById(R.id.local_car_total_detail);
        holder.goodsListView = (InnerListView) convertView.findViewById(R.id.local_car_list);
        holder.diliverPayButton =
            (LinearLayout) convertView.findViewById(R.id.local_car_pay_diliver);
        holder.diliverPayTextView =
            (TextView) convertView.findViewById(R.id.local_car_pay_diliver_type);
        convertView.setTag(holder);
      } else {
        holder = (ViewHolder) convertView.getTag();
      }
      if (localCars.get(position).isSelected()) {
        holder.selectionImageView.setImageResource(R.drawable.iconfont_check_checked);
      } else {
        holder.selectionImageView.setImageResource(R.drawable.iconfont_check_normal);
      }
      final ModelLocalCar localCar = localCars.get(position);
      holder.storeTextView.setText(localCar.getStore().getServicename());
      holder.storePostInfoTextView.setText(getStorePostInfoString(localCar.getStorePostInfo()));
      holder.moneyTextView.setText(
          Parameters.CONSTANT_RMB + decimalFormat.format(localCar.getTotalMoney()));
      holder.moneyDetailTextView.setText(
          getMoneyDetailString(localCar.getGoodsMoney(), localCar.getPostFee()));
      holder.goodsListView.setAdapter(new CarGoodsAdapter(localCar));
      holder.diliverPayTextView.setText(getDiliverPayString(localCar));
      holder.selectButton.setOnClickListener(
          new OnClickListener() {

            @Override
            public void onClick(View v) {
              showLoading();
              LocalCarController.selectStore(localCar);
              hideLoading();
              refresh();
            }
          });
      holder.diliverPayButton.setOnClickListener(
          new OnClickListener() {

            @Override
            public void onClick(View v) {
              new DiliverPaymentDialog(localCar).show(getFragmentManager(), null);
            }
          });
      return convertView;
    }
 public static int selectPayment(ModelLocalCar localCar, ModelPayment payment) {
   List<ModelLocalCar> localCars = getLocalCars();
   for (int i = 0; i < localCars.size(); i++) {
     if (localCars.get(i).getStore().getNo().equals(localCar.getStore().getNo())) {
       // 定位到此店铺,修改付款方式
       localCars.get(i).setPayment(payment);
       break;
     }
   }
   return save(localCars);
 }
 public static int selectDiliver(ModelLocalCar localCar, ModelDiliver diliver) {
   List<ModelLocalCar> localCars = getLocalCars();
   for (int i = 0; i < localCars.size(); i++) {
     if (localCars.get(i).getStore().getNo().equals(localCar.getStore().getNo())) {
       // 定位到此店铺,修改配送方式
       localCars.get(i).setDiliver(diliver);
       break;
     }
   }
   return save(localCars);
 }
 public static int selectStore(ModelLocalCar localCar) {
   List<ModelLocalCar> localCars = getLocalCars();
   boolean b = !localCar.isSelected();
   for (int i = 0; i < localCars.size(); i++) {
     if (localCars.get(i).getStore().getNo().equals(localCar.getStore().getNo())) {
       // 定位到此店铺,遍历店铺下所有产品,修改选择状态
       for (int j = 0; j < localCars.get(i).getCarGoods().size(); j++) {
         localCars.get(i).getCarGoods().get(j).setSelected(b);
       }
       break;
     }
   }
   return save(localCars);
 }