Hi guys
I have a set of defined values which a user can pass to my program. I have set up a type enum as follows:
private enum PayMethod
{
CC = 1,
DB = 2,
CH = 3,
DD = 4,
SD = 5
}
What I want to do is ensure that the passed value is one of these options - either the character part or the numeric value. The value is passed in an XML node.
I've tried to create a function to compare the values but I don't want to do multiple if/case statements. Is there any way I can do a direct comparison between my values in the enum and the passed value?
Thanks as always
Craftor
I have a set of defined values which a user can pass to my program. I have set up a type enum as follows:
private enum PayMethod
{
CC = 1,
DB = 2,
CH = 3,
DD = 4,
SD = 5
}
What I want to do is ensure that the passed value is one of these options - either the character part or the numeric value. The value is passed in an XML node.
I've tried to create a function to compare the values but I don't want to do multiple if/case statements. Is there any way I can do a direct comparison between my values in the enum and the passed value?
Thanks as always
Craftor