Ejemplo n.º 1
0
 public void onClick(View v) {
   // TODO: validate that inputs are appropriate
   ContentValues initialValues = new ContentValues();
   initialValues.put(
       ExpenseContentProvider.DATEINCURRED,
       DateHelper.makeDateString(
           dateToday.getYear(), dateToday.getMonth() + 1, dateToday.getDayOfMonth()));
   initialValues.put(ExpenseContentProvider.EXCHANGE, 1.00);
   initialValues.put(ExpenseContentProvider.CURRENCY, "CDN");
   if (layoutExpenseType.getVisibility() == View.VISIBLE)
     initialValues.put(
         ExpenseContentProvider.CATEGORY, spinnerExpenseType.getSelectedItem().toString());
   else initialValues.put(ExpenseContentProvider.CATEGORY, txtAddType.getText().toString());
   initialValues.put(ExpenseContentProvider.AMOUNT, txtAmount.getText().toString());
   getContentResolver().insert(ExpenseContentProvider.CONTENT_URI, initialValues);
   resetInterface();
 }
Ejemplo n.º 2
0
 private String getSelectedDate() {
   return DateHelper.makeDateString(
       dateToday.getYear(), dateToday.getMonth() + 1, dateToday.getDayOfMonth());
 }
Ejemplo n.º 3
0
 protected void bindTodaysSpend(int year, int month, int dayOfMonth) {
   double spend =
       expenseData.getTodaysSpend(
           getApplicationContext(), DateHelper.makeDateString(year, month, dayOfMonth));
   lblTodaysSpendValue.setText(ExpenseContentProvider.MONEY_FORMAT.format(spend));
 }