Alice52 / c-tutorial

The repository is about c, including c, csharp, cpp.
MIT License
0 stars 0 forks source link

[common] if usage #24

Open Alice52 opened 4 years ago

Alice52 commented 4 years ago
public enum TASequence
{
    SUBMITTED_FILL = 0,
    PROCESSING_FILL = 1,
    IN_TRANSIT_FILL = 2,
    COMPLETED_FILL = -1,
    VOIDED_FILL = 4,
    SUBMITTED_CREDIT = 0,
    PROCESSING_CREDIT = 1,
    IN_TRANSIT_CREDIT = -1,
    COMPLETED_CREDIT = 0,
    VOIDED_CREDIT = 3
}

string suffix = actionType == BType.TABLE_FILL ? "_FILL" : "_CREDIT";
int currentStatusWeight = (int)Enum.Parse(typeof(ASequence), currentStatus + suffix);
int expectStatusWeight = (int)Enum.Parse(typeof(ASequence), expectStatus + suffix);
return currentStatusWeight >= expectStatusWeight;