Case 2
If CCType is present, and CCQty and/or CCDate is present do nothing
Case 3
If CCType is not present, but if CCQty and CCDate is present or if any one if this (CCQty or CCDate)is present.
Then Log message to console “CC type is present. But CCQty and/or CCDate values are present.”
If String.IsNullOrEmpty(CCType) AndAlso String.IsNullOrEmpty(CCQty) AndAlso String.IsNullOrEmpty(CCDate)
// Case 1: If all three variables are empty, do nothing
// No action needed
ElseIf Not String.IsNullOrEmpty(CCType) AndAlso (Not String.IsNullOrEmpty(CCQty) Or Not String.IsNullOrEmpty(CCDate))
// Case 2: If CCType is present and CCQty and/or CCDate is present, do nothing
// No action needed
ElseIf String.IsNullOrEmpty(CCType) AndAlso (Not String.IsNullOrEmpty(CCQty) Or Not String.IsNullOrEmpty(CCDate))
// Case 3: If CCType is not present, but CCQty and/or CCDate is present
// Log the message to console
Log Message: “CC type is not present. But CCQty and/or CCDate values are present.”
Else
// Any other scenario not covered above
// No action needed
// Optionally, you can add logging or additional actions here
Can you share the variable types? “Empty” would mean different things, depending on if your variables are strings, ints, datatables, datetime objects, etc.
If
`String.IsNullOrEmpty(CCType) And String.IsNullOrEmpty(CCQty) And String.IsNullOrEmpty(CCDate)`
Then:
- Do nothing (Case 1)
ElseIf
Condition: `Not String.IsNullOrEmpty(CCType) And (Not String.IsNullOrEmpty(CCQty) Or Not String.IsNullOrEmpty(CCDate))`
Then:
- Do nothing (Case 2)
ElseIf
Condition: `String.IsNullOrEmpty(CCType) And (Not String.IsNullOrEmpty(CCQty) Or Not String.IsNullOrEmpty(CCDate))`
Then:
- Log Message-> "CC type is not present. But CCQty and/or CCDate values are present." (Case 3)
Else
- Do nothing or add Log message