Ejemplo n.º 1
0
 public void updatePrices(Date limit) {
   TextView totalPrice = (TextView) view.findViewById(R.id.totalPrice);
   totalPrice.setText(
       String.format(
           getResources().getString(R.string.averageOperationPrice),
           Intervention.getTotalInterventionPrice(currentCar.getId(), limit)));
   TextView averagePrice = (TextView) view.findViewById(R.id.averagePrice);
   averagePrice.setText(
       String.format(
           getResources().getString(R.string.averageOperationPrice),
           Intervention.getAverageInterventionPrice(currentCar.getId())));
 }
Ejemplo n.º 2
0
 public void updateLists() {
   interventionListForGrid =
       Intervention.findInterventionByNumericLimit(
           currentCar.getId(),
           " ORDER BY "
               + Intervention.DBModel.C_DATE
               + " DESC, "
               + Intervention.DBModel.C_ID
               + " DESC ",
           3);
   interventionListForChart =
       Intervention.findInterventionByNumericLimit(
           currentCar.getId(),
           " ORDER BY "
               + Intervention.DBModel.C_DATE
               + " ASC, "
               + Intervention.DBModel.C_ID
               + " ASC ",
           0);
 }
Ejemplo n.º 3
0
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    this.inflater = inflater;
    mCurrentDate = Calendar.getInstance();
    Date limit = mCurrentDate.getTime();
    limit.setMonth(0);
    limit.setDate(0);
    view = inflater.inflate(R.layout.fragment_operations, container, false);
    dateChartDetails = (LinearLayout) view.findViewById(R.id.dateChartDetails);
    chartDataDescription = (TextView) view.findViewById(R.id.chartDataDescription);
    chartDataCost = (TextView) view.findViewById(R.id.chartDataCost);
    chartDataDate = (TextView) view.findViewById(R.id.chartDataDate);
    operationChartTitle = (TextView) view.findViewById(R.id.operationChartTitle);
    operationChart = (LineChart) view.findViewById(R.id.operationChart);
    myIntervention = (TableLayout) view.findViewById(R.id.OperationList);

    interventionListForGrid =
        Intervention.findInterventionByNumericLimit(
            currentCar.getId(),
            " ORDER BY "
                + Intervention.DBModel.C_DATE
                + " DESC, "
                + Intervention.DBModel.C_ID
                + " DESC ",
            3);
    interventionListForChart =
        Intervention.findInterventionByNumericLimit(
            currentCar.getId(),
            " ORDER BY "
                + Intervention.DBModel.C_DATE
                + " ASC, "
                + Intervention.DBModel.C_ID
                + " ASC ",
            0);

    ArrayList<Entry> entries = new ArrayList<>();
    ArrayList<String> labels = new ArrayList<>();
    return view;
  }