checkStatus method

bool checkStatus(
  1. BuildContext contex, {
  2. bool isShowMsg = true,
})

Implementation

bool checkStatus(BuildContext contex, {bool isShowMsg = true}) {
  if (_isDisposed) {
    return false;
  }

  for (var table in _tables.values) {
    if (table.rows.isEmpty) {
      continue;
    }

    if (!table.containerColumn('status')) {
      continue;
    }

    var firstRow = table.rows.first;
    String? statusValue = firstRow['status']?.toString().trim().toUpperCase();
    String? msgValue = table.containerColumn('msg')
        ? firstRow['Msg']?.toString()
        : null;
    String message = firstRow['note'].toString();

    if (statusValue == 'N') {
      if (isShowMsg) {
        message.V_MsgBox(contex, type: CyberMsgBoxType.error);
      }
      return false;
    }

    if (msgValue == 'Y' && isShowMsg) {
      message.V_MsgBox(contex, type: CyberMsgBoxType.warning);
    }
  }

  return true;
}