mardi 9 avril 2019

How to fix the validation to be better?

Im doing a phone validation for 2 brands and both validation have almost the same meaning only different digits.

        if (!MobileFormat(num, brand,currency))
        {
            if (brand.Equals(Brand.LED.ToString()))
            {
                key = "The number of phone numbers must be "9" digits.";
            }
            else
            {
                key = "The number of phone numbers must be "10" digits.";
            }

        }

i expect the key to be in single line and not double and only change the digit.

Aucun commentaire:

Enregistrer un commentaire