示例#1
0
  public void CloseActivity(DataTable data) {
    Bundle bundleDataResult = new Bundle();
    bundleDataResult.putString(bundleTableUpdated, data.GetTableName());

    setIntentResult("", RESULT_OK, bundleDataResult);
    finish();
  }
示例#2
0
  public boolean SaveDataToTable(DataTable data) {
    boolean bSuccess = false;
    // update data into database
    if (data.GetDataRow().Validate()) {
      boolean bInsertMode = (GetStartMode() == StartMode.NEW);
      long lRowId = RequestedRowId();
      Database.Result result = data.UpdateData(bInsertMode, lRowId);
      if (result == Database.Result.Success) {
        // if important dates changed, reset alarm
        // if (DateValuesChanged(bundleDateValues))
        // AlarmsManager.ResetAlarm(userdb, prefs, data, lRowId);

        bSuccess = true;
      } else {
        utils.ShowMsgResStr(Database.GetErrDesc(result), Utils.MSGTYPE_ERROR);
      }
    } else {
      utils.ShowMsgResStr(R.string.infoEnterAllRequiredData, Utils.MSGTYPE_INFO);
    }
    return bSuccess;
  }
示例#3
0
  public boolean DeleteDataFromTable(DataTable data) {
    boolean bSuccess = false;
    long lRowId = RequestedRowId();
    Database.Result result = data.DeleteData(lRowId);
    if (result == Database.Result.Success) {
      // check if alarm for delete and delete it
      // AlarmsManager.DeleteAlarm(userdb, prefs, data, lRowId);

      bSuccess = true;
    } else {
      utils.ShowMsgResStr(Database.GetErrDesc(result), Utils.MSGTYPE_ERROR);
    }
    return bSuccess;
  }
示例#4
0
  public boolean OpenDataForEdit(DataTable data) {
    long lRowId = RequestedRowId();
    Database.Result result = data.GetRowDataForEdit(lRowId);
    if (result == Database.Result.Success) {
      // save date values for change test
      SaveDateValuesBeforeChange(bundleDateValues);

      return true;
    } else {
      // return fail result for caller
      int iMsgId = Database.GetErrDesc(result);
      Bundle extras = PutBundledMessage(iMsgId);
      setIntentResult("", RESULT_CANCELED, extras);

      return false;
    }
  }