Instead of dealing with strings, you could use an
enum
. That way you can directly assign value to paymentType.
paymentType = (int)Enum.Parse(typeof(YourEnum),"ValueHere");
Based on what controls you are using on screen, you could bind it to these enum values. Better still, you and use set of
RadioButton
. Assign
Tag
property of all radio buttons and have a single
CheckedChanged
event handler for all. In the handler, you can use something like this:
int paymentType = (int)(sender as RadioButton).Tag;